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 fb75cbb..2970ebd 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/generated/collisions.pyi b/BlazeSudio/collisions/generated/collisions.pyi index 36e2051..5b3732b 100644 --- a/BlazeSudio/collisions/generated/collisions.pyi +++ b/BlazeSudio/collisions/generated/collisions.pyi @@ -1,9 +1,9 @@ import shapely.geometry as shapelyGeom from _typeshed import Incomplete -from enum import Enum -from typing import Any, Dict, Iterable, Type +from enum import IntEnum +from typing import Any, Dict, Iterable -__all__ = ['rotate', 'rotateBy0', 'direction', 'pointOnCircle', 'shapelyToColl', 'collToShapely', 'drawShape', 'ShpGroups', 'checkShpType', 'ClosedShape', 'Shape', 'NoShape', 'Shapes', 'Point', 'Line', 'Circle', 'Arc', 'Rect', 'RotatedRect', 'Polygon', 'ShapeCombiner'] +__all__ = ['rotate', 'rotateBy0', 'direction', 'pointOnCircle', 'shapelyToColl', 'collToShapely', 'drawShape', 'ShpGroups', 'ShpTyps', 'checkShpType', 'ClosedShape', 'Shape', 'NoShape', 'Shapes', 'Point', 'Line', 'Circle', 'Arc', 'Rect', 'RotatedRect', 'Polygon', 'ShapeCombiner'] Number = int | float verboseOutput = Iterable[Any] | None @@ -57,21 +57,38 @@ def pointOnCircle(angle: Number, strength: Number = 1) -> pointLike: pointLike: The point on the unit circle at angle `angle` * strength """ -class ShpGroups(Enum): +class ShpGroups(IntEnum): """ An enum representing the different groups you can put shapes in. """ CLOSED: int LINES: int + NOTSTRAIGHT: int GROUP: int -def checkShpType(shape: Shape | Shapes, typs: Type | ShpGroups | Iterable[Type | ShpGroups]) -> bool: +class ShpTyps(IntEnum): + """ + An enum representing the different possible shapes. + """ + NoShape: int + Group: int + Point: int + Line: int + Circle: int + Arc: int + Rect: int + RotRect: int + Polygon: int + +def checkShpType(shape: Shape | Shapes, *typs: ShpTyps | ShpGroups) -> bool: """ Checks to see if a shape is of a certain type or group. + This checks if it is of ANY of the specified types or groups. + Args: shape (Shape or Shapes]): The input shape or shapes to check the type of. - typs (ShpTypes, ShpGroups, or an Iterable[ShpTypes or ShpGroups]): The shape type(s) &/or group(s) to check for. + *typs (Iterable[ShpTypes | ShpGroups]): The shape type(s) &/or group(s) to check for. Returns: bool: Whether the shape is of the specified type(s) or group(s). @@ -111,6 +128,7 @@ 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?""" GROUPS: Incomplete + TYPE: Incomplete x: Number y: Number bounciness: Incomplete @@ -134,11 +152,21 @@ class Shape: Finds where this shape collides with another shape(s) Args: - othershape (Shape / Shapes / Iterable[Shape]): The shape(s) to check for collision with + othershape (Shape / Shapes / Iterable[Shape]): The shape(s) to check for collision with. Returns: Iterable[pointLike]: Points that lie both on this shape and the input shape(s) """ + def isContaining(self, othershape: 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. + + Args: + othershape (Shape / Shapes / Iterable[Shape]): The shape to check if it is fully enclosed within this shape. + + Returns: + bool: Whether the shape is fully enclosed within this shape. + """ def distance_to(self, othershape: Shape) -> Number: """ Finds the distance between this shape and another shape. @@ -202,7 +230,7 @@ class Shape: def toPoints(self) -> Iterable[pointLike]: """ Returns: - Iterable[pointLike]: Get a list of all the Points that make up this object. For Circles, Arcs and Shape's, this will be empty. + 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. """ def area(self) -> Number: """ @@ -250,6 +278,7 @@ class NoShape(Shape): class Shapes: """A class which holds multiple shapes and can be used to do things with all of them at once.""" GROUPS: Incomplete + TYPE: Incomplete shapes: Incomplete def __init__(self, *shapes: Shape) -> None: """ @@ -293,7 +322,7 @@ class Shapes: Example: `shapes.remove_shapes(Shape1, Shape2)` OR `shapes.remove_shapes(*[Shape1, Shape2])` """ - def collides(self, shapes: Shape | Shapes | Iterable['Shape']) -> bool: + def collides(self, shapes: Shape | Shapes | Iterable[Shape]) -> bool: """ Checks for collisions between all the shapes in this object and the input shape(s). @@ -303,7 +332,7 @@ class Shapes: Returns: bool: True if *any* of the shapes in this object collide with *any* of the input shapes """ - def whereCollides(self, shapes: Shape | Shapes | Iterable['Shape']) -> Iterable[pointLike]: + def whereCollides(self, shapes: Shape | Shapes | Iterable[Shape]) -> Iterable[pointLike]: """ Find the points where this object collides with the input shape(s). @@ -325,6 +354,16 @@ class Shapes: Returns: Iterable[pointLike]: All the closest point(s) ON each of these objects """ + def isContaining(self, othershape: Shape | Shapes | Iterable[Shape]) -> bool: + """ + Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that. + + Args: + othershape (Shape / Shapes / Iterable[Shape]): The shape to check if it is fully enclosed within this shape. + + Returns: + bool: Whether the shape is fully enclosed within this shape. + """ def isCorner(self, point: pointLike, precision: Number = ...) -> Dict[Shape | Shapes, bool]: """ Takes each object and finds whether the input point is on the corner of that object. @@ -370,11 +409,12 @@ class Shapes: Makes a copy of this class but keeps the same shapes. """ def __iter__(self): ... + def __len__(self) -> int: ... def __getitem__(self, index: int) -> Shape | Shapes: ... def __setitem__(self, index: int, new: Shape | Shapes) -> None: ... class Point(Shape): - """An infintesimally small point in space defined by an x and y coordinate.""" + TYPE: Incomplete def __init__(self, x: Number, y: Number, bounciness: float = ...) -> None: """ Args: @@ -470,6 +510,7 @@ class Point(Shape): class Line(Shape): """A line segment object defined by a start and an end point.""" GROUPS: Incomplete + TYPE: Incomplete def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = ...) -> None: """ Args: @@ -600,6 +641,7 @@ 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 `.toLines()` or `.toPoints()` it will return an empty list; so please check for it *before* closed shapes.""" GROUPS: Incomplete + TYPE: Incomplete def __init__(self, x: Number, y: Number, r: Number, bounciness: float = ...) -> None: """ Args: @@ -677,7 +719,7 @@ class Circle(Shape): """ def isCorner(self, point: pointLike, precision: Number = ...) -> bool: """ - Finds whether a point is on a corner of this shape. + Finds whether a point is on a corner of this shape. But because circles don't have any corners, this will return False. Args: point (pointLike): The point to find if it's a corner @@ -714,6 +756,7 @@ class Arc(Circle): **ANGLES ARE MEASURED IN DEGREES.**""" GROUPS: Incomplete + TYPE: Incomplete precision: Incomplete bounciness: Incomplete def __init__(self, x: Number, y: Number, rad: Number, startAngle: Number, endAngle: Number, precision: Number = ..., bounciness: float = ...) -> None: @@ -774,6 +817,22 @@ class Arc(Circle): Returns: Iterable[Number]: (min x, min y, max x, max y) """ + def isCorner(self, point: pointLike, precision: Number = ...) -> bool: + """ + Finds whether a point is on a corner of this shape. + + Args: + point (pointLike): The point to find if it's a corner + precision (Number, optional): The decimal places to round to to check. Defaults to 5. + + Returns: + bool: Whether the point is on a corner of this shape + """ + def toPoints(self): + """ + Returns: + Iterable[pointLike]: Get a list of all the Points that make up this object. + """ def copy(self) -> Arc: """ Because Noah's first arc broke, now you need another one. @@ -881,6 +940,7 @@ class ClosedShape(Shape): class Rect(ClosedShape): """A Rectangle. It is defined with an x, y, width and height.""" + TYPE: Incomplete def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = ...) -> None: """ Args: @@ -924,6 +984,7 @@ class RotatedRect(ClosedShape): """A rectangle...... That is rotated. It is rotated around it's x and y coordinates. Defined as an x, y, width, height and rotation.""" + TYPE: Incomplete cachedPoints: Incomplete cacheRequirements: Incomplete def __init__(self, x: Number, y: Number, w: Number, h: Number, rotation: Number, bounciness: float = ...) -> None: @@ -977,6 +1038,7 @@ class RotatedRect(ClosedShape): class Polygon(ClosedShape): """A convex or concave polygon. It is defined with a list of points.""" + TYPE: Incomplete points: Incomplete def __init__(self, *points: pointLike, errorOnLT3: bool = True, bounciness: float = ...) -> None: """ diff --git a/BlazeSudio/collisions/lib/collisions.c b/BlazeSudio/collisions/lib/collisions.c index bb31273..11e2faf 100644 --- a/BlazeSudio/collisions/lib/collisions.c +++ b/BlazeSudio/collisions/lib/collisions.c @@ -1501,29 +1501,33 @@ 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_closestPointTo; -struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos; -struct __pyx_obj_10collisions___pyx_scope_struct_11__collides; -struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo; -struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent; +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__collides; -struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache; -struct __pyx_obj_10collisions___pyx_scope_struct_19__collides; -struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__; -struct __pyx_obj_10collisions___pyx_scope_struct_22_area; -struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr; -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_genexpr; +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_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_30_union; +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_defaults; typedef struct __pyx_defaults __pyx_defaults; struct __pyx_defaults1; @@ -1572,6 +1576,8 @@ struct __pyx_defaults22; typedef struct __pyx_defaults22 __pyx_defaults22; struct __pyx_defaults23; typedef struct __pyx_defaults23 __pyx_defaults23; +struct __pyx_defaults24; +typedef struct __pyx_defaults24 __pyx_defaults24; struct __pyx_defaults { PyObject *__pyx_arg_width; }; @@ -1628,17 +1634,17 @@ struct __pyx_defaults16 { double __pyx_arg_bounciness; }; struct __pyx_defaults17 { - PyObject *__pyx_arg_vel; PyObject *__pyx_arg_precision; }; struct __pyx_defaults18 { + PyObject *__pyx_arg_vel; PyObject *__pyx_arg_precision; }; struct __pyx_defaults19 { PyObject *__pyx_arg_precision; }; struct __pyx_defaults20 { - double __pyx_arg_bounciness; + PyObject *__pyx_arg_precision; }; struct __pyx_defaults21 { double __pyx_arg_bounciness; @@ -1649,8 +1655,11 @@ struct __pyx_defaults22 { struct __pyx_defaults23 { double __pyx_arg_bounciness; }; +struct __pyx_defaults24 { + double __pyx_arg_bounciness; +}; -/* "collisions.py":612 +/* "collisions.py":667 * Number: The sum of all the areas of the shapes. * """ * return sum(s.area() for s in self.shapes) # <<<<<<<<<<<<<< @@ -1667,7 +1676,7 @@ struct __pyx_obj_10collisions___pyx_scope_struct__genexpr { }; -/* "collisions.py":622 +/* "collisions.py":677 * """ * 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) # <<<<<<<<<<<<<< @@ -1707,7 +1716,7 @@ struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr { }; -/* "collisions.py":628 +/* "collisions.py":683 * Make a copy of this class with a copy of each shape in it. * """ * return Shapes(s.copy() for s in self.shapes) # <<<<<<<<<<<<<< @@ -1724,8 +1733,8 @@ struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr { }; -/* "collisions.py":723 - * return (self.x, self.y) +/* "collisions.py":786 + * return False * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldPoint: Union['Point',pointLike], @@ -1737,7 +1746,7 @@ struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos { }; -/* "collisions.py":986 +/* "collisions.py":1053 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -1750,7 +1759,7 @@ struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo { }; -/* "collisions.py":1060 +/* "collisions.py":1127 * return tries[0][0] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -1763,207 +1772,263 @@ struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner { }; -/* "collisions.py":1420 +/* "collisions.py":1403 + * 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 { + PyObject_HEAD + PyObject *__pyx_v_self; +}; + + +/* "collisions.py":1414 + * 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 { + PyObject_HEAD + struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *__pyx_outer_scope; + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_p; +}; + + +/* "collisions.py":1507 * 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_9_closestPointTo { +struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":1469 +/* "collisions.py":1556 * return self.closestPointTo(Point(*ps[0])) * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldCir: 'Circle', * newCir: 'Circle', */ -struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos { +struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos { PyObject_HEAD PyObject *__pyx_v_oldCir; }; -/* "collisions.py":1703 +/* "collisions.py":1792 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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_11__collides { +struct __pyx_obj_10collisions___pyx_scope_struct_13__collides { PyObject_HEAD PyObject *__pyx_v_othershape; }; -/* "collisions.py":1711 - * if checkShpType(othershape, (Line, Circle)): - * if checkShpType(othershape, Circle): +/* "collisions.py":1800 + * 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_12_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; }; -/* "collisions.py":1746 +/* "collisions.py":1838 * 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_13_closestPointTo { +struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo { PyObject_HEAD PyObject *__pyx_v_othershape; PyObject *__pyx_v_self; }; -/* "collisions.py":1965 +/* "collisions.py":2084 * 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_14_tangent { +struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent { PyObject_HEAD PyObject *__pyx_v_point; }; -/* "collisions.py":1999 +/* "collisions.py":2118 * 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_15_closestPointTo { +struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo { PyObject_HEAD PyObject *__pyx_v_othershape; PyObject *__pyx_v_self; }; -/* "collisions.py":2331 - * return self.w * self.h +/* "collisions.py":2388 + * 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 { + PyObject_HEAD + PyObject *__pyx_v_self; +}; + + +/* "collisions.py":2396 + * 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 { + PyObject_HEAD + struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *__pyx_outer_scope; + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_p; +}; + + +/* "collisions.py":2474 + * 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, Point): + * if checkShpType(othershape, ShpTyps.Point): */ -struct __pyx_obj_10collisions___pyx_scope_struct_16__collides { +struct __pyx_obj_10collisions___pyx_scope_struct_20__collides { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2351 +/* "collisions.py":2494 * ) - * if checkShpType(othershape, Arc): + * 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_17_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; }; -/* "collisions.py":2428 +/* "collisions.py":2572 * 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_18_getCache { +struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache { PyObject_HEAD PyObject *__pyx_v_cos; PyObject *__pyx_v_sin; }; -/* "collisions.py":2471 - * return self.w * self.h +/* "collisions.py":2619 + * 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_19__collides { +struct __pyx_obj_10collisions___pyx_scope_struct_23__collides { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2499 +/* "collisions.py":2640 * return False - * if checkShpType(othershape, Arc): + * 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_20_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; }; -/* "collisions.py":2536 +/* "collisions.py":2677 * 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_21___setitem__ { +struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2605 +/* "collisions.py":2747 * 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_22_area { +struct __pyx_obj_10collisions___pyx_scope_struct_26_area { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2613 +/* "collisions.py":2755 * """ * 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_23_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_22_area *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_26_area *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; PyObject *__pyx_t_0; @@ -1972,42 +2037,42 @@ struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr { }; -/* "collisions.py":2617 +/* "collisions.py":2759 * ) + (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_24__collides { +struct __pyx_obj_10collisions___pyx_scope_struct_28__collides { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2645 +/* "collisions.py":2787 * return False - * if checkShpType(othershape, Arc): + * 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_25_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; }; -/* "collisions.py":2707 +/* "collisions.py":2863 * 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_26_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -2016,14 +2081,14 @@ struct __pyx_obj_10collisions___pyx_scope_struct_26_genexpr { }; -/* "collisions.py":2708 +/* "collisions.py":2864 * 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_27_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -2032,14 +2097,14 @@ struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr { }; -/* "collisions.py":2710 +/* "collisions.py":2866 * 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_28_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -2048,14 +2113,14 @@ struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr { }; -/* "collisions.py":2711 +/* "collisions.py":2867 * ], [ * max(i[2] for i in rs), * max(i[3] for i in rs) # <<<<<<<<<<<<<< * ] * return Shapes(Rect( */ -struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -2064,31 +2129,31 @@ struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr { }; -/* "collisions.py":2773 +/* "collisions.py":2929 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< * def union(*shapes: Shape) -> Shapes: # FIXME * """ */ -struct __pyx_obj_10collisions___pyx_scope_struct_30_union { +struct __pyx_obj_10collisions___pyx_scope_struct_34_union { PyObject_HEAD - PyObject *__pyx_9genexpr78__pyx_v_j; + PyObject *__pyx_9genexpr81__pyx_v_j; PyObject *__pyx_v_p1; PyObject *__pyx_v_s; }; -/* "collisions.py":2805 +/* "collisions.py":2961 * 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_31_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_30_union *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_k; }; @@ -2439,11 +2504,28 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); -/* PySequenceContains.proto */ -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* pyfrozenset_new.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); + +/* PySetContains.proto */ +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS @@ -2761,18 +2843,6 @@ static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *k #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif -/* GCCDiagnostics.proto */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define __Pyx_HAS_GCC_DIAGNOSTIC -#endif - -/* BuildPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, - int prepend_sign, char padding_char); - -/* CIntToPyUnicode.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char); - /* py_abs.proto */ #if CYTHON_USE_PYLONG_INTERNALS static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); @@ -2984,23 +3054,6 @@ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj); /* PyIntCompare.proto */ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); -/* UnpackUnboundCMethod.proto */ -typedef struct { - PyObject *type; - PyObject **method_name; - PyCFunction func; - PyObject *method; - int flag; -} __Pyx_CachedCFunction; - -/* CallUnboundCMethod1.proto */ -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#else -#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) -#endif - /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); @@ -3037,6 +3090,18 @@ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObje #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* BuildPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char); + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char); + /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); @@ -3063,6 +3128,12 @@ static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t __Pyx__PyObject_PopIndex(L, py_ix)) #endif +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ @@ -3375,8 +3446,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__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_cp[] = "cp"; static const char __pyx_k_cs[] = "cs"; static const char __pyx_k_d1[] = "d1"; @@ -3432,11 +3506,10 @@ static const char __pyx_k_yj[] = "yj"; static const char __pyx_k_yk[] = "yk"; static const char __pyx_k_Any[] = "Any"; static const char __pyx_k_Arc[] = "Arc"; -static const char __pyx_k__16[] = ">"; -static const char __pyx_k__22[] = "\302\260-"; -static const char __pyx_k__23[] = "\302\260>"; -static const char __pyx_k__34[] = "*"; -static const char __pyx_k__35[] = "."; +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_all[] = "__all__"; static const char __pyx_k_any[] = "any"; static const char __pyx_k_arc[] = "arc"; @@ -3449,6 +3522,7 @@ static const char __pyx_k_hit[] = "hit"; static const char __pyx_k_inf[] = "inf"; static const char __pyx_k_int[] = "int"; static const char __pyx_k_key[] = "key"; +static const char __pyx_k_len[] = "__len__"; static const char __pyx_k_lns[] = "lns"; static const char __pyx_k_max[] = "max"; static const char __pyx_k_min[] = "min"; @@ -3473,13 +3547,12 @@ 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_Enum[] = "Enum"; 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__138[] = "_"; -static const char __pyx_k__299[] = "?"; +static const char __pyx_k_TYPE[] = "TYPE"; +static const char __pyx_k__147[] = "_"; +static const char __pyx_k__324[] = "?"; static const char __pyx_k_alls[] = "alls"; static const char __pyx_k_area[] = "area"; static const char __pyx_k_args[] = "args"; @@ -3503,6 +3576,7 @@ static const char __pyx_k_mins[] = "mins"; static const char __pyx_k_mycp[] = "mycp"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_newP[] = "newP"; +static const char __pyx_k_newp[] = "newp"; static const char __pyx_k_objs[] = "objs"; static const char __pyx_k_oldP[] = "oldP"; static const char __pyx_k_olns[] = "olns"; @@ -3521,6 +3595,7 @@ static const char __pyx_k_typs[] = "typs"; static const char __pyx_k_Arc_2[] = ".reformat"; 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_Type_ShpGroups_Iterable_Un[] = "Union[Type, ShpGroups, Iterable[Union[Type, ShpGroups]]]"; static const char __pyx_k_Union_pointLike_Iterable_pointLi[] = "Union[pointLike, Iterable[pointLike]]"; static const char __pyx_k_tuple_Circle_pointLike_verboseOu[] = "tuple['Circle', pointLike, verboseOutput]"; static const char __pyx_k_tuple_ClosedShape_pointLike_verb[] = "tuple['ClosedShape', pointLike, verboseOutput]"; static const char __pyx_k_tuple_Line_pointLike_verboseOutp[] = "tuple['Line', pointLike, verboseOutput]"; static const char __pyx_k_tuple_Shape_pointLike_verboseOut[] = "tuple['Shape', pointLike, verboseOutput]"; static const char __pyx_k_tuple_pointLike_pointLike_verbos[] = "tuple[pointLike, pointLike, verboseOutput]"; +static const char __pyx_k_An_enum_representing_the_differ_2[] = "\n An enum representing the different possible shapes.\n "; static const char __pyx_k_ClosedShape_handleCollisionsPos_2[] = "ClosedShape.handleCollisionsPos"; 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_ClosedShape_closestPointTo_local_2[] = "ClosedShape.closestPointTo..calculate"; -static const char __pyx_k_Union_Shape_Shapes_Iterable_Shap_2[] = "Union[Shape, 'Shapes', Iterable['Shape']]"; +static const char __pyx_k_Union_Shape_Shapes_Iterable_Shap_2[] = "Union[Shape, 'Shapes', Iterable[Shape]]"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_10collisions_checkForPygame(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_2rotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_origin, PyObject *__pyx_v_point, PyObject *__pyx_v_angle); /* proto */ @@ -4050,33 +4153,36 @@ static PyObject *__pyx_pf_10collisions_20__defaults__(CYTHON_UNUSED PyObject *__ static PyObject *__pyx_pf_10collisions_5Shape___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, double __pyx_v_bounciness); /* proto */ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_6distance_to(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_12_collides(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_14_where(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_16closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_8distance_to(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_12__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_14_collides(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_16_where(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_18_contains(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_20closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ static PyObject *__pyx_pf_10collisions_22__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_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_5Shape_20tangent(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_point, PyObject *__pyx_v_vel); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_22toLines(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_24toPoints(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_26area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_28rect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_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_5Shape_24tangent(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_point, PyObject *__pyx_v_vel); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_26toLines(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_28toPoints(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_30area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_32rect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_24__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_30handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_oldP, PyObject *__pyx_v_newP, CYTHON_UNUSED PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_verbose); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_32handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, CYTHON_UNUSED PyObject *__pyx_v_objs, PyObject *__pyx_v_verbose); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_34copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_36__getitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_it); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_38__setitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_it, CYTHON_UNUSED PyObject *__pyx_v_new); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_40__iter__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Shape_42__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_34handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_oldP, PyObject *__pyx_v_newP, CYTHON_UNUSED PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_verbose); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_36handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, CYTHON_UNUSED PyObject *__pyx_v_objs, PyObject *__pyx_v_verbose); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_38copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_40__getitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_it); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_42__setitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_it, CYTHON_UNUSED PyObject *__pyx_v_new); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_44__iter__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_5Shape_46__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_7NoShape___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_7NoShape_2_collides(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ static PyObject *__pyx_pf_10collisions_7NoShape_4_where(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_7NoShape_6area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_7NoShape_8copy(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_7NoShape_10__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_7NoShape_6_contains(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ +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_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 */ @@ -4085,24 +4191,26 @@ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyOb 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(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_6Shapes_16isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel); /* 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_4area_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_20area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_22area(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_22rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_24rect(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_24copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_26copy_leave_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_28__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_30__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_32__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_34__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_36__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* 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_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 */ @@ -4112,16 +4220,17 @@ static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject static PyObject *__pyx_pf_10collisions_5Point_10_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ 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_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(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_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_5Point_18handleCollisionsVel(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_20copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ -static PyObject *__pyx_pf_10collisions_5Point_24__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_26__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_5Point_28__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_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_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 */ @@ -4133,129 +4242,141 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_16toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_18toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +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); /* proto */ 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); /* proto */ -static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_4Line_22_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_6_where_line(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2); /* proto */ -static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_4Line_24_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject *__pyx_self, PyObject *__pyx_v_ln, PyObject *__pyx_v_point, PyObject *__pyx_v_recalculate); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObject *__pyx_self, PyObject *__pyx_v_ln, PyObject *__pyx_v_point, PyObject *__pyx_v_recalculate); /* proto */ 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_24closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* 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_4Line_8isCorner_rountTuple(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_10collisions_4Line_26isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision); /* 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_28tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel); /* 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_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_30handleCollisionsPos(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_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_4Line_32handleCollisionsVel(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_34copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_4Line_36__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ -static PyObject *__pyx_pf_10collisions_4Line_38__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_40__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_4Line_42__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_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_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_6_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* 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_6_where_sign(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_8_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda13(PyObject *__pyx_self, PyObject *__pyx_v_p); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda14(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_10closestPointTo(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_pf_10collisions_6Circle_10_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_12handleCollisionsPos(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_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_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsVel(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_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_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_16isCorner(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_18tangent(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_20copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_22__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_24__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_26__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_28__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_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_50__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 */ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_6flip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_3Arc_8_contains(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_this); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda17(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda18(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda18(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda19(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_phi); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_angle); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_20copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_26__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_3Arc_28__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_phi); /* proto */ +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_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 */ +static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_10collisions_3Arc_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_3Arc_32__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_angle); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda19(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ln, PyObject *__pyx_v_oln, PyObject *__pyx_v_recalculate); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate(PyObject *__pyx_self, PyObject *__pyx_v_ln, PyObject *__pyx_v_point, PyObject *__pyx_v_recalculate); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda21(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda21(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda22(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda23(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_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* 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_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_54__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_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10collisions_11ClosedShape_10isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision); /* proto */ -static PyObject *__pyx_pf_10collisions_11ClosedShape_12toLines(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_11ClosedShape_14toPoints(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_11ClosedShape_16__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ -static PyObject *__pyx_pf_10collisions_11ClosedShape_18__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_11ClosedShape_20__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_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_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_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 */ +static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_10collisions_4Rect_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10collisions_4Rect_6_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_4Rect_8toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_4Rect_10toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_4Rect_12copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_4Rect_14__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_16__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_60__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_4Rect_10toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_4Rect_12toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +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_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 */ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_11RotatedRect_6area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_11RotatedRect_8_containsPoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_10collisions_11RotatedRect_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_11RotatedRect_10toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_11RotatedRect_14copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_11RotatedRect_12toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_11RotatedRect_14toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_11RotatedRect_16copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ 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_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_11RotatedRect_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_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_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 */ @@ -4276,14 +4397,14 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_3genexpr(CY static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shapes); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda36(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda37(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +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_9genexpr78_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda39(PyObject *__pyx_self, PyObject *__pyx_v_x); /* 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_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_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 */ @@ -4296,31 +4417,36 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr(PyTypeOb 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_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_10_handleCollisionsPos(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_11__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_12_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_13_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_14_tangent(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__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_18_getCache(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_19__collides(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___setitem__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_22_area(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_23_genexpr(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_genexpr(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_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_30_union(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 __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}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { @@ -4358,29 +4484,33 @@ typedef struct { 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_closestPointTo; - PyObject *__pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos; - PyObject *__pyx_type_10collisions___pyx_scope_struct_11__collides; - PyObject *__pyx_type_10collisions___pyx_scope_struct_12_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_13_closestPointTo; - PyObject *__pyx_type_10collisions___pyx_scope_struct_14_tangent; + 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__collides; - PyObject *__pyx_type_10collisions___pyx_scope_struct_17_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_18_getCache; - PyObject *__pyx_type_10collisions___pyx_scope_struct_19__collides; - PyObject *__pyx_type_10collisions___pyx_scope_struct_20_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_21___setitem__; - PyObject *__pyx_type_10collisions___pyx_scope_struct_22_area; - PyObject *__pyx_type_10collisions___pyx_scope_struct_23_genexpr; - 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_genexpr; + 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_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_30_union; + 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; #endif PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct__genexpr; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr; @@ -4391,29 +4521,33 @@ typedef struct { 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_closestPointTo; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_11__collides; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_12_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_14_tangent; + 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__collides; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_17_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_18_getCache; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_19__collides; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_21___setitem__; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_22_area; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_23_genexpr; - 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_genexpr; + 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_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_30_union; + 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; PyObject *__pyx_n_s_A; PyObject *__pyx_n_s_AVERYSMALLNUMBER; PyObject *__pyx_kp_s_A_Rectangle_It_is_defined_with_a; @@ -4426,7 +4560,7 @@ typedef struct { PyObject *__pyx_kp_s_A_rectangle_That_is_rotated_It_i; PyObject *__pyx_kp_s_A_section_of_a_circle_s_circumfr; PyObject *__pyx_kp_s_An_enum_representing_the_differ; - PyObject *__pyx_kp_s_An_infintesimally_small_point_in; + PyObject *__pyx_kp_s_An_enum_representing_the_differ_2; PyObject *__pyx_n_s_Any; PyObject *__pyx_n_s_Arc; PyObject *__pyx_n_u_Arc; @@ -4439,6 +4573,7 @@ typedef struct { PyObject *__pyx_n_s_Arc___str; PyObject *__pyx_n_s_Arc__collides; PyObject *__pyx_n_s_Arc__collides_locals_genexpr; + PyObject *__pyx_n_s_Arc__contains; PyObject *__pyx_n_s_Arc__where; PyObject *__pyx_n_s_Arc_angleInRange; PyObject *__pyx_n_s_Arc_area; @@ -4450,7 +4585,9 @@ typedef struct { PyObject *__pyx_n_s_Arc_copy; PyObject *__pyx_n_s_Arc_endPoints; PyObject *__pyx_n_s_Arc_flip; + PyObject *__pyx_n_s_Arc_isCorner; PyObject *__pyx_n_s_Arc_rect; + PyObject *__pyx_n_s_Arc_toPoints; PyObject *__pyx_n_s_B; PyObject *__pyx_n_s_BASEBOUNCINESS; PyObject *__pyx_n_s_BASEPRECISION; @@ -4470,6 +4607,8 @@ typedef struct { PyObject *__pyx_n_s_Circle___setitem; PyObject *__pyx_n_s_Circle___str; PyObject *__pyx_n_s_Circle__collides; + PyObject *__pyx_n_s_Circle__contains; + PyObject *__pyx_n_s_Circle__contains_locals_genexpr; PyObject *__pyx_n_s_Circle__where; PyObject *__pyx_n_s_Circle__where_locals_sign; PyObject *__pyx_n_s_Circle_area; @@ -4488,6 +4627,9 @@ typedef struct { PyObject *__pyx_n_s_ClosedShape___getitem; PyObject *__pyx_n_s_ClosedShape___iter; PyObject *__pyx_n_s_ClosedShape___str; + PyObject *__pyx_n_s_ClosedShape__contains; + PyObject *__pyx_n_s_ClosedShape__containsPoint; + PyObject *__pyx_n_s_ClosedShape__contains_locals_gen; PyObject *__pyx_n_s_ClosedShape__where; PyObject *__pyx_n_s_ClosedShape_closestPointTo; PyObject *__pyx_n_s_ClosedShape_closestPointTo_local; @@ -4508,12 +4650,13 @@ typedef struct { PyObject *__pyx_n_s_Dx; PyObject *__pyx_n_s_Dy; PyObject *__pyx_n_s_E; - PyObject *__pyx_n_s_Enum; PyObject *__pyx_n_s_GROUP; PyObject *__pyx_n_s_GROUPS; PyObject *__pyx_n_s_GeometryCollection; + PyObject *__pyx_n_s_Group; PyObject *__pyx_n_s_ImportError; PyObject *__pyx_n_s_IndexError; + PyObject *__pyx_n_s_IntEnum; PyObject *__pyx_n_s_Iterable; PyObject *__pyx_kp_s_Iterable_Line; PyObject *__pyx_kp_s_Iterable_Line_2; @@ -4533,6 +4676,7 @@ typedef struct { PyObject *__pyx_n_s_Line___str; PyObject *__pyx_n_s_Line__collides; PyObject *__pyx_n_s_Line__collides_locals_direction; + PyObject *__pyx_n_s_Line__contains; PyObject *__pyx_n_s_Line__onSegment; PyObject *__pyx_n_s_Line__where; PyObject *__pyx_n_s_Line__where_locals_line; @@ -4562,6 +4706,7 @@ typedef struct { PyObject *__pyx_n_s_MultiPoint; PyObject *__pyx_n_s_MultiPolygon; PyObject *__pyx_n_s_N; + PyObject *__pyx_n_s_NOTSTRAIGHT; PyObject *__pyx_n_s_NoShape; PyObject *__pyx_n_u_NoShape; PyObject *__pyx_kp_u_NoShape_2; @@ -4569,6 +4714,7 @@ typedef struct { PyObject *__pyx_n_s_NoShape___init; PyObject *__pyx_n_s_NoShape___str; PyObject *__pyx_n_s_NoShape__collides; + PyObject *__pyx_n_s_NoShape__contains; PyObject *__pyx_n_s_NoShape__where; PyObject *__pyx_n_s_NoShape_area; PyObject *__pyx_n_s_NoShape_copy; @@ -4584,6 +4730,7 @@ typedef struct { PyObject *__pyx_n_s_Point___setitem; PyObject *__pyx_n_s_Point___str; PyObject *__pyx_n_s_Point__collides; + PyObject *__pyx_n_s_Point__contains; PyObject *__pyx_n_s_Point__where; PyObject *__pyx_n_s_Point_area; PyObject *__pyx_n_s_Point_closestPointTo; @@ -4621,11 +4768,13 @@ typedef struct { PyObject *__pyx_n_s_Rect___str; PyObject *__pyx_n_s_Rect__collides; PyObject *__pyx_n_s_Rect__collides_locals_genexpr; + PyObject *__pyx_n_s_Rect__containsPoint; PyObject *__pyx_n_s_Rect_area; PyObject *__pyx_n_s_Rect_copy; PyObject *__pyx_n_s_Rect_rect; PyObject *__pyx_n_s_Rect_toLines; PyObject *__pyx_n_s_Rect_toPoints; + PyObject *__pyx_n_s_RotRect; PyObject *__pyx_n_s_RotatedRect; PyObject *__pyx_n_u_RotatedRect; PyObject *__pyx_kp_u_RotatedRect_2; @@ -4636,6 +4785,7 @@ typedef struct { PyObject *__pyx_n_s_RotatedRect___str; PyObject *__pyx_n_s_RotatedRect__collides; PyObject *__pyx_n_s_RotatedRect__collides_locals_gen; + PyObject *__pyx_n_s_RotatedRect__containsPoint; PyObject *__pyx_n_s_RotatedRect_area; PyObject *__pyx_n_s_RotatedRect_copy; PyObject *__pyx_n_s_RotatedRect_getCache; @@ -4668,6 +4818,7 @@ typedef struct { PyObject *__pyx_n_s_Shape___setitem; PyObject *__pyx_n_s_Shape___str; PyObject *__pyx_n_s_Shape__collides; + PyObject *__pyx_n_s_Shape__contains; PyObject *__pyx_n_s_Shape__where; PyObject *__pyx_n_s_Shape_area; PyObject *__pyx_n_s_Shape_check_rects; @@ -4677,6 +4828,7 @@ typedef struct { PyObject *__pyx_n_s_Shape_distance_to; PyObject *__pyx_n_s_Shape_handleCollisionsPos; PyObject *__pyx_n_s_Shape_handleCollisionsVel; + PyObject *__pyx_n_s_Shape_isContaining; PyObject *__pyx_n_s_Shape_isCorner; PyObject *__pyx_n_s_Shape_rect; PyObject *__pyx_n_s_Shape_tangent; @@ -4689,6 +4841,7 @@ typedef struct { PyObject *__pyx_n_s_Shapes___getitem; PyObject *__pyx_n_s_Shapes___init; PyObject *__pyx_n_s_Shapes___iter; + PyObject *__pyx_n_s_Shapes___len; PyObject *__pyx_n_s_Shapes___repr; PyObject *__pyx_n_s_Shapes___setitem; PyObject *__pyx_n_s_Shapes___str; @@ -4701,6 +4854,7 @@ typedef struct { PyObject *__pyx_n_s_Shapes_copy; PyObject *__pyx_n_s_Shapes_copy_leave_shapes; PyObject *__pyx_n_s_Shapes_copy_locals_genexpr; + PyObject *__pyx_n_s_Shapes_isContaining; PyObject *__pyx_n_s_Shapes_isCorner; PyObject *__pyx_n_s_Shapes_rect; PyObject *__pyx_n_s_Shapes_rect_locals_genexpr; @@ -4708,13 +4862,16 @@ typedef struct { PyObject *__pyx_n_s_Shapes_remove_shapes; PyObject *__pyx_n_s_Shapes_tangent; PyObject *__pyx_n_s_Shapes_whereCollides; - PyObject *__pyx_kp_u_Shapes_with; + PyObject *__pyx_kp_u_Shapes_with_shapes; PyObject *__pyx_n_s_ShpGroups; PyObject *__pyx_n_u_ShpGroups; + PyObject *__pyx_n_s_ShpTyps; + PyObject *__pyx_n_u_ShpTyps; + PyObject *__pyx_n_s_TYPE; + PyObject *__pyx_n_s_TYPE_MATCHES; PyObject *__pyx_kp_s_The_base_Shape_class_This_defaul; PyObject *__pyx_kp_s_These_are_shapes_like_rects_and; PyObject *__pyx_n_s_ThisClosestP; - PyObject *__pyx_n_s_Type; PyObject *__pyx_n_s_Union; PyObject *__pyx_kp_s_Union_Number_pointLike; PyObject *__pyx_kp_s_Union_Point_pointLike; @@ -4725,19 +4882,21 @@ typedef struct { PyObject *__pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2; PyObject *__pyx_kp_s_Union_Shapes_Iterable_Shape; PyObject *__pyx_kp_s_Union_Shapes_Iterable_Shape_2; - PyObject *__pyx_kp_s_Union_Type_ShpGroups_Iterable_Un; + PyObject *__pyx_kp_s_Union_ShpTyps_ShpGroups; PyObject *__pyx_kp_s_Union_pointLike_Iterable_pointLi; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s_W; - PyObject *__pyx_n_s__138; - PyObject *__pyx_kp_u__16; - PyObject *__pyx_kp_u__22; - PyObject *__pyx_kp_u__23; - PyObject *__pyx_n_s__299; + PyObject *__pyx_n_s__147; + PyObject *__pyx_kp_u__24; + PyObject *__pyx_kp_u__25; PyObject *__pyx_kp_u__3; - PyObject *__pyx_n_s__34; - PyObject *__pyx_kp_u__35; + PyObject *__pyx_n_s__324; + PyObject *__pyx_n_s__36; + PyObject *__pyx_kp_u__37; PyObject *__pyx_kp_u__4; + PyObject *__pyx_kp_u__5; + PyObject *__pyx_kp_u__6; + PyObject *__pyx_kp_u__7; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_add_shape; PyObject *__pyx_n_s_add_shapes; @@ -4780,6 +4939,7 @@ typedef struct { PyObject *__pyx_n_s_checked; PyObject *__pyx_n_s_cirO; PyObject *__pyx_n_s_circle; + PyObject *__pyx_n_s_class; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_close; @@ -4800,6 +4960,8 @@ typedef struct { PyObject *__pyx_n_s_combineRects; PyObject *__pyx_n_s_concave_hull; PyObject *__pyx_n_s_constrainAng; + PyObject *__pyx_n_s_contains; + PyObject *__pyx_n_s_containsPoint; PyObject *__pyx_n_s_coords; PyObject *__pyx_n_s_copy; PyObject *__pyx_n_s_copy_leave_shapes; @@ -4872,7 +5034,9 @@ typedef struct { PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_int; PyObject *__pyx_n_s_intermediateObj; + PyObject *__pyx_n_s_intersection; PyObject *__pyx_n_s_intersections; + PyObject *__pyx_n_s_isContaining; PyObject *__pyx_n_s_isCorner; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_is_empty; @@ -4885,6 +5049,7 @@ typedef struct { PyObject *__pyx_n_s_j; PyObject *__pyx_n_s_k; PyObject *__pyx_n_s_key; + PyObject *__pyx_n_s_len; PyObject *__pyx_n_s_li; PyObject *__pyx_kp_s_lib_collisions_py; PyObject *__pyx_n_s_line; @@ -4915,6 +5080,7 @@ typedef struct { PyObject *__pyx_n_s_newPoint; PyObject *__pyx_n_s_newShp; PyObject *__pyx_n_s_newobj; + PyObject *__pyx_n_s_newp; PyObject *__pyx_n_s_newp1; PyObject *__pyx_n_s_newp2; PyObject *__pyx_n_s_newpts; @@ -5030,7 +5196,7 @@ typedef struct { PyObject *__pyx_n_s_shapely_geometry; PyObject *__pyx_n_s_shapely_ops; PyObject *__pyx_n_s_shapes; - PyObject *__pyx_kp_u_shapes_2; + PyObject *__pyx_n_s_shpTyps; PyObject *__pyx_n_s_sign; PyObject *__pyx_n_s_sin; PyObject *__pyx_n_s_slns; @@ -5076,6 +5242,7 @@ typedef struct { PyObject *__pyx_kp_s_tuple_Shape_pointLike_verboseOut; PyObject *__pyx_kp_s_tuple_int_int_int; PyObject *__pyx_kp_s_tuple_pointLike_pointLike_verbos; + PyObject *__pyx_n_s_typ_set; PyObject *__pyx_n_s_typing; PyObject *__pyx_n_s_typs; PyObject *__pyx_n_s_u; @@ -5141,27 +5308,34 @@ typedef struct { PyObject *__pyx_int_270; PyObject *__pyx_int_360; PyObject *__pyx_int_neg_1; + PyObject *__pyx_int_neg_2; + PyObject *__pyx_int_neg_3; + PyObject *__pyx_int_neg_4; + PyObject *__pyx_int_neg_5; + PyObject *__pyx_int_neg_6; + PyObject *__pyx_int_neg_7; + PyObject *__pyx_int_neg_8; + PyObject *__pyx_int_neg_9; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__7; - PyObject *__pyx_tuple__9; + PyObject *__pyx_tuple__8; + PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__14; - PyObject *__pyx_tuple__18; + PyObject *__pyx_tuple__15; + PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__24; + PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__29; - PyObject *__pyx_tuple__32; - PyObject *__pyx_tuple__36; - PyObject *__pyx_tuple__37; + PyObject *__pyx_tuple__28; + PyObject *__pyx_tuple__31; + PyObject *__pyx_tuple__34; + PyObject *__pyx_tuple__38; PyObject *__pyx_tuple__39; PyObject *__pyx_tuple__41; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__47; - PyObject *__pyx_tuple__48; + PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__50; PyObject *__pyx_tuple__52; PyObject *__pyx_tuple__54; @@ -5169,102 +5343,110 @@ typedef struct { PyObject *__pyx_tuple__58; PyObject *__pyx_tuple__60; PyObject *__pyx_tuple__62; - PyObject *__pyx_tuple__64; - PyObject *__pyx_tuple__66; - PyObject *__pyx_tuple__68; + PyObject *__pyx_tuple__65; + PyObject *__pyx_tuple__67; + PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__71; - PyObject *__pyx_tuple__73; - PyObject *__pyx_tuple__74; - PyObject *__pyx_tuple__76; - PyObject *__pyx_tuple__82; - PyObject *__pyx_tuple__84; - PyObject *__pyx_tuple__87; - PyObject *__pyx_tuple__89; - PyObject *__pyx_tuple__99; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__8; - PyObject *__pyx_tuple__101; - PyObject *__pyx_tuple__105; - PyObject *__pyx_tuple__108; + 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__110; - PyObject *__pyx_tuple__112; - PyObject *__pyx_tuple__114; - PyObject *__pyx_tuple__116; + PyObject *__pyx_tuple__113; + PyObject *__pyx_tuple__115; PyObject *__pyx_tuple__118; - PyObject *__pyx_tuple__123; - PyObject *__pyx_tuple__125; - PyObject *__pyx_tuple__129; - PyObject *__pyx_tuple__139; - PyObject *__pyx_tuple__141; - PyObject *__pyx_tuple__144; - PyObject *__pyx_tuple__146; + 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__154; - PyObject *__pyx_tuple__158; + PyObject *__pyx_tuple__153; + PyObject *__pyx_tuple__155; + PyObject *__pyx_tuple__159; PyObject *__pyx_tuple__163; - PyObject *__pyx_tuple__165; PyObject *__pyx_tuple__167; - PyObject *__pyx_tuple__169; - PyObject *__pyx_tuple__171; PyObject *__pyx_tuple__173; PyObject *__pyx_tuple__175; - PyObject *__pyx_tuple__182; - PyObject *__pyx_tuple__186; - PyObject *__pyx_tuple__188; - PyObject *__pyx_tuple__190; + PyObject *__pyx_tuple__177; + PyObject *__pyx_tuple__179; + PyObject *__pyx_tuple__181; + PyObject *__pyx_tuple__183; + PyObject *__pyx_tuple__185; PyObject *__pyx_tuple__192; + PyObject *__pyx_tuple__196; + PyObject *__pyx_tuple__198; + PyObject *__pyx_tuple__200; PyObject *__pyx_tuple__202; PyObject *__pyx_tuple__204; - PyObject *__pyx_tuple__206; - PyObject *__pyx_tuple__209; - PyObject *__pyx_tuple__211; - PyObject *__pyx_tuple__213; - PyObject *__pyx_tuple__215; - PyObject *__pyx_tuple__217; - PyObject *__pyx_tuple__219; + 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__236; - PyObject *__pyx_tuple__243; - PyObject *__pyx_tuple__247; + 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__258; - PyObject *__pyx_tuple__261; - PyObject *__pyx_tuple__264; + PyObject *__pyx_tuple__263; PyObject *__pyx_tuple__267; - PyObject *__pyx_tuple__270; - PyObject *__pyx_tuple__272; - PyObject *__pyx_tuple__274; + PyObject *__pyx_tuple__269; + PyObject *__pyx_tuple__276; PyObject *__pyx_tuple__278; - PyObject *__pyx_tuple__287; - PyObject *__pyx_tuple__289; + PyObject *__pyx_tuple__280; + PyObject *__pyx_tuple__283; + PyObject *__pyx_tuple__285; + PyObject *__pyx_tuple__288; PyObject *__pyx_tuple__291; - PyObject *__pyx_tuple__293; - PyObject *__pyx_tuple__295; - PyObject *__pyx_tuple__297; - PyObject *__pyx_codeobj__10; + PyObject *__pyx_tuple__294; + 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__318; + PyObject *__pyx_tuple__320; + PyObject *__pyx_tuple__322; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__15; - PyObject *__pyx_codeobj__17; + PyObject *__pyx_codeobj__14; + PyObject *__pyx_codeobj__16; + PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__25; + PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__27; - PyObject *__pyx_codeobj__28; + PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__30; - PyObject *__pyx_codeobj__31; + PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__33; - PyObject *__pyx_codeobj__38; + PyObject *__pyx_codeobj__35; PyObject *__pyx_codeobj__40; PyObject *__pyx_codeobj__42; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; - PyObject *__pyx_codeobj__49; + PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__55; @@ -5272,165 +5454,181 @@ typedef struct { PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__61; PyObject *__pyx_codeobj__63; - PyObject *__pyx_codeobj__65; - PyObject *__pyx_codeobj__67; - PyObject *__pyx_codeobj__69; + PyObject *__pyx_codeobj__64; + PyObject *__pyx_codeobj__66; + PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__72; - PyObject *__pyx_codeobj__75; - PyObject *__pyx_codeobj__77; - PyObject *__pyx_codeobj__78; + PyObject *__pyx_codeobj__73; + PyObject *__pyx_codeobj__74; + PyObject *__pyx_codeobj__76; PyObject *__pyx_codeobj__79; - PyObject *__pyx_codeobj__80; PyObject *__pyx_codeobj__81; + PyObject *__pyx_codeobj__82; PyObject *__pyx_codeobj__83; + PyObject *__pyx_codeobj__84; PyObject *__pyx_codeobj__85; - PyObject *__pyx_codeobj__86; - PyObject *__pyx_codeobj__88; + PyObject *__pyx_codeobj__87; + PyObject *__pyx_codeobj__89; PyObject *__pyx_codeobj__90; - PyObject *__pyx_codeobj__91; PyObject *__pyx_codeobj__92; - 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__106; + PyObject *__pyx_codeobj__105; PyObject *__pyx_codeobj__107; + PyObject *__pyx_codeobj__108; PyObject *__pyx_codeobj__109; PyObject *__pyx_codeobj__111; - PyObject *__pyx_codeobj__113; - PyObject *__pyx_codeobj__115; + PyObject *__pyx_codeobj__112; + PyObject *__pyx_codeobj__114; + PyObject *__pyx_codeobj__116; PyObject *__pyx_codeobj__117; PyObject *__pyx_codeobj__119; - PyObject *__pyx_codeobj__120; PyObject *__pyx_codeobj__121; - PyObject *__pyx_codeobj__122; - PyObject *__pyx_codeobj__124; + PyObject *__pyx_codeobj__123; + PyObject *__pyx_codeobj__125; PyObject *__pyx_codeobj__126; PyObject *__pyx_codeobj__127; PyObject *__pyx_codeobj__128; - PyObject *__pyx_codeobj__130; + PyObject *__pyx_codeobj__129; PyObject *__pyx_codeobj__131; - PyObject *__pyx_codeobj__132; PyObject *__pyx_codeobj__133; 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__147; - PyObject *__pyx_codeobj__148; + PyObject *__pyx_codeobj__146; PyObject *__pyx_codeobj__149; PyObject *__pyx_codeobj__151; PyObject *__pyx_codeobj__152; - PyObject *__pyx_codeobj__153; - PyObject *__pyx_codeobj__155; + PyObject *__pyx_codeobj__154; PyObject *__pyx_codeobj__156; PyObject *__pyx_codeobj__157; - PyObject *__pyx_codeobj__159; + PyObject *__pyx_codeobj__158; PyObject *__pyx_codeobj__160; PyObject *__pyx_codeobj__161; PyObject *__pyx_codeobj__162; PyObject *__pyx_codeobj__164; + PyObject *__pyx_codeobj__165; PyObject *__pyx_codeobj__166; PyObject *__pyx_codeobj__168; + PyObject *__pyx_codeobj__169; PyObject *__pyx_codeobj__170; + PyObject *__pyx_codeobj__171; PyObject *__pyx_codeobj__172; PyObject *__pyx_codeobj__174; PyObject *__pyx_codeobj__176; - PyObject *__pyx_codeobj__177; PyObject *__pyx_codeobj__178; - PyObject *__pyx_codeobj__179; PyObject *__pyx_codeobj__180; - PyObject *__pyx_codeobj__181; - PyObject *__pyx_codeobj__183; + PyObject *__pyx_codeobj__182; PyObject *__pyx_codeobj__184; - PyObject *__pyx_codeobj__185; + PyObject *__pyx_codeobj__186; 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__200; PyObject *__pyx_codeobj__201; 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__214; - PyObject *__pyx_codeobj__216; - PyObject *__pyx_codeobj__218; + 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__233; PyObject *__pyx_codeobj__235; + 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__242; - PyObject *__pyx_codeobj__244; + PyObject *__pyx_codeobj__243; PyObject *__pyx_codeobj__245; - PyObject *__pyx_codeobj__246; - PyObject *__pyx_codeobj__248; + PyObject *__pyx_codeobj__247; 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__258; PyObject *__pyx_codeobj__259; PyObject *__pyx_codeobj__260; + PyObject *__pyx_codeobj__261; PyObject *__pyx_codeobj__262; - PyObject *__pyx_codeobj__263; + PyObject *__pyx_codeobj__264; PyObject *__pyx_codeobj__265; PyObject *__pyx_codeobj__266; PyObject *__pyx_codeobj__268; - PyObject *__pyx_codeobj__269; + PyObject *__pyx_codeobj__270; PyObject *__pyx_codeobj__271; + PyObject *__pyx_codeobj__272; PyObject *__pyx_codeobj__273; + PyObject *__pyx_codeobj__274; PyObject *__pyx_codeobj__275; - PyObject *__pyx_codeobj__276; PyObject *__pyx_codeobj__277; PyObject *__pyx_codeobj__279; - PyObject *__pyx_codeobj__280; 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__288; + PyObject *__pyx_codeobj__287; + PyObject *__pyx_codeobj__289; PyObject *__pyx_codeobj__290; PyObject *__pyx_codeobj__292; - PyObject *__pyx_codeobj__294; - PyObject *__pyx_codeobj__296; - PyObject *__pyx_codeobj__298; + PyObject *__pyx_codeobj__293; + PyObject *__pyx_codeobj__295; + PyObject *__pyx_codeobj__297; + PyObject *__pyx_codeobj__299; + PyObject *__pyx_codeobj__300; + PyObject *__pyx_codeobj__301; + PyObject *__pyx_codeobj__303; + PyObject *__pyx_codeobj__304; + 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__313; + PyObject *__pyx_codeobj__315; + PyObject *__pyx_codeobj__317; + PyObject *__pyx_codeobj__319; + PyObject *__pyx_codeobj__321; + PyObject *__pyx_codeobj__323; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -5491,52 +5689,60 @@ static int __pyx_m_clear(PyObject *m) { 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_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_9_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_11__collides); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_11__collides); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_12_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_12_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_13_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_14_tangent); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_14_tangent); + 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__collides); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_16__collides); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_17_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_17_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_18_getCache); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_18_getCache); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_19__collides); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_19__collides); - 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___setitem__); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_21___setitem__); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_22_area); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_22_area); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_23_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_23_genexpr); - 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_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_26_genexpr); + 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_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_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_30_union); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_30_union); + 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); Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_31_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr); + 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_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); @@ -5549,7 +5755,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_A_rectangle_That_is_rotated_It_i); Py_CLEAR(clear_module_state->__pyx_kp_s_A_section_of_a_circle_s_circumfr); Py_CLEAR(clear_module_state->__pyx_kp_s_An_enum_representing_the_differ); - Py_CLEAR(clear_module_state->__pyx_kp_s_An_infintesimally_small_point_in); + Py_CLEAR(clear_module_state->__pyx_kp_s_An_enum_representing_the_differ_2); Py_CLEAR(clear_module_state->__pyx_n_s_Any); Py_CLEAR(clear_module_state->__pyx_n_s_Arc); Py_CLEAR(clear_module_state->__pyx_n_u_Arc); @@ -5562,6 +5768,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Arc___str); Py_CLEAR(clear_module_state->__pyx_n_s_Arc__collides); Py_CLEAR(clear_module_state->__pyx_n_s_Arc__collides_locals_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_Arc__contains); Py_CLEAR(clear_module_state->__pyx_n_s_Arc__where); Py_CLEAR(clear_module_state->__pyx_n_s_Arc_angleInRange); Py_CLEAR(clear_module_state->__pyx_n_s_Arc_area); @@ -5573,7 +5780,9 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Arc_copy); Py_CLEAR(clear_module_state->__pyx_n_s_Arc_endPoints); Py_CLEAR(clear_module_state->__pyx_n_s_Arc_flip); + Py_CLEAR(clear_module_state->__pyx_n_s_Arc_isCorner); Py_CLEAR(clear_module_state->__pyx_n_s_Arc_rect); + Py_CLEAR(clear_module_state->__pyx_n_s_Arc_toPoints); Py_CLEAR(clear_module_state->__pyx_n_s_B); Py_CLEAR(clear_module_state->__pyx_n_s_BASEBOUNCINESS); Py_CLEAR(clear_module_state->__pyx_n_s_BASEPRECISION); @@ -5593,6 +5802,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Circle___setitem); Py_CLEAR(clear_module_state->__pyx_n_s_Circle___str); Py_CLEAR(clear_module_state->__pyx_n_s_Circle__collides); + Py_CLEAR(clear_module_state->__pyx_n_s_Circle__contains); + Py_CLEAR(clear_module_state->__pyx_n_s_Circle__contains_locals_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_Circle__where); Py_CLEAR(clear_module_state->__pyx_n_s_Circle__where_locals_sign); Py_CLEAR(clear_module_state->__pyx_n_s_Circle_area); @@ -5611,6 +5822,9 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape___getitem); Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape___iter); Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape___str); + Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape__contains); + Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape__containsPoint); + Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape__contains_locals_gen); Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape__where); Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape_closestPointTo); Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape_closestPointTo_local); @@ -5631,12 +5845,13 @@ static int __pyx_m_clear(PyObject *m) { 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); - Py_CLEAR(clear_module_state->__pyx_n_s_Enum); Py_CLEAR(clear_module_state->__pyx_n_s_GROUP); Py_CLEAR(clear_module_state->__pyx_n_s_GROUPS); Py_CLEAR(clear_module_state->__pyx_n_s_GeometryCollection); + Py_CLEAR(clear_module_state->__pyx_n_s_Group); Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); + Py_CLEAR(clear_module_state->__pyx_n_s_IntEnum); Py_CLEAR(clear_module_state->__pyx_n_s_Iterable); Py_CLEAR(clear_module_state->__pyx_kp_s_Iterable_Line); Py_CLEAR(clear_module_state->__pyx_kp_s_Iterable_Line_2); @@ -5656,6 +5871,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Line___str); Py_CLEAR(clear_module_state->__pyx_n_s_Line__collides); Py_CLEAR(clear_module_state->__pyx_n_s_Line__collides_locals_direction); + Py_CLEAR(clear_module_state->__pyx_n_s_Line__contains); Py_CLEAR(clear_module_state->__pyx_n_s_Line__onSegment); Py_CLEAR(clear_module_state->__pyx_n_s_Line__where); Py_CLEAR(clear_module_state->__pyx_n_s_Line__where_locals_line); @@ -5685,6 +5901,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_MultiPoint); Py_CLEAR(clear_module_state->__pyx_n_s_MultiPolygon); Py_CLEAR(clear_module_state->__pyx_n_s_N); + Py_CLEAR(clear_module_state->__pyx_n_s_NOTSTRAIGHT); Py_CLEAR(clear_module_state->__pyx_n_s_NoShape); Py_CLEAR(clear_module_state->__pyx_n_u_NoShape); Py_CLEAR(clear_module_state->__pyx_kp_u_NoShape_2); @@ -5692,6 +5909,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_NoShape___init); Py_CLEAR(clear_module_state->__pyx_n_s_NoShape___str); Py_CLEAR(clear_module_state->__pyx_n_s_NoShape__collides); + Py_CLEAR(clear_module_state->__pyx_n_s_NoShape__contains); Py_CLEAR(clear_module_state->__pyx_n_s_NoShape__where); Py_CLEAR(clear_module_state->__pyx_n_s_NoShape_area); Py_CLEAR(clear_module_state->__pyx_n_s_NoShape_copy); @@ -5707,6 +5925,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Point___setitem); Py_CLEAR(clear_module_state->__pyx_n_s_Point___str); Py_CLEAR(clear_module_state->__pyx_n_s_Point__collides); + Py_CLEAR(clear_module_state->__pyx_n_s_Point__contains); Py_CLEAR(clear_module_state->__pyx_n_s_Point__where); Py_CLEAR(clear_module_state->__pyx_n_s_Point_area); Py_CLEAR(clear_module_state->__pyx_n_s_Point_closestPointTo); @@ -5744,11 +5963,13 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Rect___str); Py_CLEAR(clear_module_state->__pyx_n_s_Rect__collides); Py_CLEAR(clear_module_state->__pyx_n_s_Rect__collides_locals_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_Rect__containsPoint); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_area); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_copy); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_toLines); Py_CLEAR(clear_module_state->__pyx_n_s_Rect_toPoints); + Py_CLEAR(clear_module_state->__pyx_n_s_RotRect); Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect); Py_CLEAR(clear_module_state->__pyx_n_u_RotatedRect); Py_CLEAR(clear_module_state->__pyx_kp_u_RotatedRect_2); @@ -5759,6 +5980,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect___str); Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect__collides); Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect__collides_locals_gen); + Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect__containsPoint); Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect_area); Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect_copy); Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect_getCache); @@ -5791,6 +6013,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Shape___setitem); Py_CLEAR(clear_module_state->__pyx_n_s_Shape___str); Py_CLEAR(clear_module_state->__pyx_n_s_Shape__collides); + Py_CLEAR(clear_module_state->__pyx_n_s_Shape__contains); Py_CLEAR(clear_module_state->__pyx_n_s_Shape__where); Py_CLEAR(clear_module_state->__pyx_n_s_Shape_area); Py_CLEAR(clear_module_state->__pyx_n_s_Shape_check_rects); @@ -5800,6 +6023,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Shape_distance_to); Py_CLEAR(clear_module_state->__pyx_n_s_Shape_handleCollisionsPos); Py_CLEAR(clear_module_state->__pyx_n_s_Shape_handleCollisionsVel); + Py_CLEAR(clear_module_state->__pyx_n_s_Shape_isContaining); Py_CLEAR(clear_module_state->__pyx_n_s_Shape_isCorner); Py_CLEAR(clear_module_state->__pyx_n_s_Shape_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Shape_tangent); @@ -5812,6 +6036,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Shapes___getitem); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes___init); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes___iter); + Py_CLEAR(clear_module_state->__pyx_n_s_Shapes___len); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes___repr); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes___setitem); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes___str); @@ -5824,6 +6049,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_copy); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_copy_leave_shapes); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_copy_locals_genexpr); + Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_isContaining); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_isCorner); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_rect_locals_genexpr); @@ -5831,13 +6057,16 @@ static int __pyx_m_clear(PyObject *m) { 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_whereCollides); - Py_CLEAR(clear_module_state->__pyx_kp_u_Shapes_with); + Py_CLEAR(clear_module_state->__pyx_kp_u_Shapes_with_shapes); Py_CLEAR(clear_module_state->__pyx_n_s_ShpGroups); Py_CLEAR(clear_module_state->__pyx_n_u_ShpGroups); + Py_CLEAR(clear_module_state->__pyx_n_s_ShpTyps); + Py_CLEAR(clear_module_state->__pyx_n_u_ShpTyps); + Py_CLEAR(clear_module_state->__pyx_n_s_TYPE); + Py_CLEAR(clear_module_state->__pyx_n_s_TYPE_MATCHES); Py_CLEAR(clear_module_state->__pyx_kp_s_The_base_Shape_class_This_defaul); Py_CLEAR(clear_module_state->__pyx_kp_s_These_are_shapes_like_rects_and); Py_CLEAR(clear_module_state->__pyx_n_s_ThisClosestP); - Py_CLEAR(clear_module_state->__pyx_n_s_Type); Py_CLEAR(clear_module_state->__pyx_n_s_Union); Py_CLEAR(clear_module_state->__pyx_kp_s_Union_Number_pointLike); Py_CLEAR(clear_module_state->__pyx_kp_s_Union_Point_pointLike); @@ -5848,19 +6077,21 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2); Py_CLEAR(clear_module_state->__pyx_kp_s_Union_Shapes_Iterable_Shape); Py_CLEAR(clear_module_state->__pyx_kp_s_Union_Shapes_Iterable_Shape_2); - Py_CLEAR(clear_module_state->__pyx_kp_s_Union_Type_ShpGroups_Iterable_Un); + Py_CLEAR(clear_module_state->__pyx_kp_s_Union_ShpTyps_ShpGroups); 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__138); - Py_CLEAR(clear_module_state->__pyx_kp_u__16); - Py_CLEAR(clear_module_state->__pyx_kp_u__22); - Py_CLEAR(clear_module_state->__pyx_kp_u__23); - Py_CLEAR(clear_module_state->__pyx_n_s__299); + 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__34); - Py_CLEAR(clear_module_state->__pyx_kp_u__35); + 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_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_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_add_shape); Py_CLEAR(clear_module_state->__pyx_n_s_add_shapes); @@ -5903,6 +6134,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_checked); Py_CLEAR(clear_module_state->__pyx_n_s_cirO); Py_CLEAR(clear_module_state->__pyx_n_s_circle); + Py_CLEAR(clear_module_state->__pyx_n_s_class); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_close); @@ -5923,6 +6155,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_combineRects); Py_CLEAR(clear_module_state->__pyx_n_s_concave_hull); Py_CLEAR(clear_module_state->__pyx_n_s_constrainAng); + Py_CLEAR(clear_module_state->__pyx_n_s_contains); + Py_CLEAR(clear_module_state->__pyx_n_s_containsPoint); Py_CLEAR(clear_module_state->__pyx_n_s_coords); Py_CLEAR(clear_module_state->__pyx_n_s_copy); Py_CLEAR(clear_module_state->__pyx_n_s_copy_leave_shapes); @@ -5995,7 +6229,9 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_int); Py_CLEAR(clear_module_state->__pyx_n_s_intermediateObj); + Py_CLEAR(clear_module_state->__pyx_n_s_intersection); Py_CLEAR(clear_module_state->__pyx_n_s_intersections); + Py_CLEAR(clear_module_state->__pyx_n_s_isContaining); Py_CLEAR(clear_module_state->__pyx_n_s_isCorner); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_is_empty); @@ -6008,6 +6244,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_j); Py_CLEAR(clear_module_state->__pyx_n_s_k); Py_CLEAR(clear_module_state->__pyx_n_s_key); + Py_CLEAR(clear_module_state->__pyx_n_s_len); Py_CLEAR(clear_module_state->__pyx_n_s_li); Py_CLEAR(clear_module_state->__pyx_kp_s_lib_collisions_py); Py_CLEAR(clear_module_state->__pyx_n_s_line); @@ -6038,6 +6275,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_newPoint); Py_CLEAR(clear_module_state->__pyx_n_s_newShp); Py_CLEAR(clear_module_state->__pyx_n_s_newobj); + Py_CLEAR(clear_module_state->__pyx_n_s_newp); Py_CLEAR(clear_module_state->__pyx_n_s_newp1); Py_CLEAR(clear_module_state->__pyx_n_s_newp2); Py_CLEAR(clear_module_state->__pyx_n_s_newpts); @@ -6153,7 +6391,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_shapely_geometry); Py_CLEAR(clear_module_state->__pyx_n_s_shapely_ops); Py_CLEAR(clear_module_state->__pyx_n_s_shapes); - Py_CLEAR(clear_module_state->__pyx_kp_u_shapes_2); + Py_CLEAR(clear_module_state->__pyx_n_s_shpTyps); Py_CLEAR(clear_module_state->__pyx_n_s_sign); Py_CLEAR(clear_module_state->__pyx_n_s_sin); Py_CLEAR(clear_module_state->__pyx_n_s_slns); @@ -6199,6 +6437,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_tuple_Shape_pointLike_verboseOut); Py_CLEAR(clear_module_state->__pyx_kp_s_tuple_int_int_int); Py_CLEAR(clear_module_state->__pyx_kp_s_tuple_pointLike_pointLike_verbos); + Py_CLEAR(clear_module_state->__pyx_n_s_typ_set); Py_CLEAR(clear_module_state->__pyx_n_s_typing); Py_CLEAR(clear_module_state->__pyx_n_s_typs); Py_CLEAR(clear_module_state->__pyx_n_s_u); @@ -6264,27 +6503,34 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_int_270); Py_CLEAR(clear_module_state->__pyx_int_360); Py_CLEAR(clear_module_state->__pyx_int_neg_1); + Py_CLEAR(clear_module_state->__pyx_int_neg_2); + Py_CLEAR(clear_module_state->__pyx_int_neg_3); + Py_CLEAR(clear_module_state->__pyx_int_neg_4); + Py_CLEAR(clear_module_state->__pyx_int_neg_5); + Py_CLEAR(clear_module_state->__pyx_int_neg_6); + Py_CLEAR(clear_module_state->__pyx_int_neg_7); + Py_CLEAR(clear_module_state->__pyx_int_neg_8); + 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__5); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_tuple__9); + Py_CLEAR(clear_module_state->__pyx_tuple__8); + Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_tuple__18); + Py_CLEAR(clear_module_state->__pyx_tuple__15); + Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__24); + Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__29); - Py_CLEAR(clear_module_state->__pyx_tuple__32); - Py_CLEAR(clear_module_state->__pyx_tuple__36); - Py_CLEAR(clear_module_state->__pyx_tuple__37); + 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__38); Py_CLEAR(clear_module_state->__pyx_tuple__39); Py_CLEAR(clear_module_state->__pyx_tuple__41); 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__48); + 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__54); @@ -6292,102 +6538,110 @@ static int __pyx_m_clear(PyObject *m) { 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__64); - Py_CLEAR(clear_module_state->__pyx_tuple__66); - Py_CLEAR(clear_module_state->__pyx_tuple__68); + Py_CLEAR(clear_module_state->__pyx_tuple__65); + Py_CLEAR(clear_module_state->__pyx_tuple__67); + 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__74); - Py_CLEAR(clear_module_state->__pyx_tuple__76); - Py_CLEAR(clear_module_state->__pyx_tuple__82); - Py_CLEAR(clear_module_state->__pyx_tuple__84); - Py_CLEAR(clear_module_state->__pyx_tuple__87); - Py_CLEAR(clear_module_state->__pyx_tuple__89); - Py_CLEAR(clear_module_state->__pyx_tuple__99); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__8); - Py_CLEAR(clear_module_state->__pyx_tuple__101); - Py_CLEAR(clear_module_state->__pyx_tuple__105); - Py_CLEAR(clear_module_state->__pyx_tuple__108); + 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__110); - Py_CLEAR(clear_module_state->__pyx_tuple__112); - Py_CLEAR(clear_module_state->__pyx_tuple__114); - Py_CLEAR(clear_module_state->__pyx_tuple__116); + Py_CLEAR(clear_module_state->__pyx_tuple__113); + Py_CLEAR(clear_module_state->__pyx_tuple__115); Py_CLEAR(clear_module_state->__pyx_tuple__118); - Py_CLEAR(clear_module_state->__pyx_tuple__123); - Py_CLEAR(clear_module_state->__pyx_tuple__125); - Py_CLEAR(clear_module_state->__pyx_tuple__129); - 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__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__154); - Py_CLEAR(clear_module_state->__pyx_tuple__158); + Py_CLEAR(clear_module_state->__pyx_tuple__153); + Py_CLEAR(clear_module_state->__pyx_tuple__155); + Py_CLEAR(clear_module_state->__pyx_tuple__159); Py_CLEAR(clear_module_state->__pyx_tuple__163); - Py_CLEAR(clear_module_state->__pyx_tuple__165); Py_CLEAR(clear_module_state->__pyx_tuple__167); - Py_CLEAR(clear_module_state->__pyx_tuple__169); - Py_CLEAR(clear_module_state->__pyx_tuple__171); Py_CLEAR(clear_module_state->__pyx_tuple__173); Py_CLEAR(clear_module_state->__pyx_tuple__175); - Py_CLEAR(clear_module_state->__pyx_tuple__182); - 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__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__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__204); - Py_CLEAR(clear_module_state->__pyx_tuple__206); - Py_CLEAR(clear_module_state->__pyx_tuple__209); - Py_CLEAR(clear_module_state->__pyx_tuple__211); - Py_CLEAR(clear_module_state->__pyx_tuple__213); - Py_CLEAR(clear_module_state->__pyx_tuple__215); - Py_CLEAR(clear_module_state->__pyx_tuple__217); - Py_CLEAR(clear_module_state->__pyx_tuple__219); + 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__236); - Py_CLEAR(clear_module_state->__pyx_tuple__243); - Py_CLEAR(clear_module_state->__pyx_tuple__247); + 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__258); - Py_CLEAR(clear_module_state->__pyx_tuple__261); - Py_CLEAR(clear_module_state->__pyx_tuple__264); + Py_CLEAR(clear_module_state->__pyx_tuple__263); Py_CLEAR(clear_module_state->__pyx_tuple__267); - Py_CLEAR(clear_module_state->__pyx_tuple__270); - Py_CLEAR(clear_module_state->__pyx_tuple__272); - Py_CLEAR(clear_module_state->__pyx_tuple__274); + 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__287); - Py_CLEAR(clear_module_state->__pyx_tuple__289); + 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__291); - Py_CLEAR(clear_module_state->__pyx_tuple__293); - Py_CLEAR(clear_module_state->__pyx_tuple__295); - Py_CLEAR(clear_module_state->__pyx_tuple__297); - Py_CLEAR(clear_module_state->__pyx_codeobj__10); + Py_CLEAR(clear_module_state->__pyx_tuple__294); + 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__318); + Py_CLEAR(clear_module_state->__pyx_tuple__320); + Py_CLEAR(clear_module_state->__pyx_tuple__322); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__17); + Py_CLEAR(clear_module_state->__pyx_codeobj__14); + 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__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); + Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__27); - Py_CLEAR(clear_module_state->__pyx_codeobj__28); + Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__30); - Py_CLEAR(clear_module_state->__pyx_codeobj__31); + Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__33); - Py_CLEAR(clear_module_state->__pyx_codeobj__38); + 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__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); - Py_CLEAR(clear_module_state->__pyx_codeobj__49); + 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__55); @@ -6395,165 +6649,181 @@ static int __pyx_m_clear(PyObject *m) { 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__65); - Py_CLEAR(clear_module_state->__pyx_codeobj__67); - Py_CLEAR(clear_module_state->__pyx_codeobj__69); + Py_CLEAR(clear_module_state->__pyx_codeobj__64); + Py_CLEAR(clear_module_state->__pyx_codeobj__66); + 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__75); - Py_CLEAR(clear_module_state->__pyx_codeobj__77); - Py_CLEAR(clear_module_state->__pyx_codeobj__78); + 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__80); Py_CLEAR(clear_module_state->__pyx_codeobj__81); + Py_CLEAR(clear_module_state->__pyx_codeobj__82); 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__88); + Py_CLEAR(clear_module_state->__pyx_codeobj__87); + Py_CLEAR(clear_module_state->__pyx_codeobj__89); Py_CLEAR(clear_module_state->__pyx_codeobj__90); - Py_CLEAR(clear_module_state->__pyx_codeobj__91); Py_CLEAR(clear_module_state->__pyx_codeobj__92); - 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__106); + Py_CLEAR(clear_module_state->__pyx_codeobj__105); 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__113); - Py_CLEAR(clear_module_state->__pyx_codeobj__115); + Py_CLEAR(clear_module_state->__pyx_codeobj__112); + 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__120); Py_CLEAR(clear_module_state->__pyx_codeobj__121); - Py_CLEAR(clear_module_state->__pyx_codeobj__122); - Py_CLEAR(clear_module_state->__pyx_codeobj__124); + Py_CLEAR(clear_module_state->__pyx_codeobj__123); + Py_CLEAR(clear_module_state->__pyx_codeobj__125); 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__130); + Py_CLEAR(clear_module_state->__pyx_codeobj__129); Py_CLEAR(clear_module_state->__pyx_codeobj__131); - Py_CLEAR(clear_module_state->__pyx_codeobj__132); Py_CLEAR(clear_module_state->__pyx_codeobj__133); 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__147); - Py_CLEAR(clear_module_state->__pyx_codeobj__148); + Py_CLEAR(clear_module_state->__pyx_codeobj__146); Py_CLEAR(clear_module_state->__pyx_codeobj__149); 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__155); + 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__159); + 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__165); Py_CLEAR(clear_module_state->__pyx_codeobj__166); Py_CLEAR(clear_module_state->__pyx_codeobj__168); + 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__174); Py_CLEAR(clear_module_state->__pyx_codeobj__176); - 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__181); - Py_CLEAR(clear_module_state->__pyx_codeobj__183); + Py_CLEAR(clear_module_state->__pyx_codeobj__182); Py_CLEAR(clear_module_state->__pyx_codeobj__184); - Py_CLEAR(clear_module_state->__pyx_codeobj__185); + Py_CLEAR(clear_module_state->__pyx_codeobj__186); 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__200); Py_CLEAR(clear_module_state->__pyx_codeobj__201); 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__214); - Py_CLEAR(clear_module_state->__pyx_codeobj__216); - Py_CLEAR(clear_module_state->__pyx_codeobj__218); + 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__233); Py_CLEAR(clear_module_state->__pyx_codeobj__235); + 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__242); - Py_CLEAR(clear_module_state->__pyx_codeobj__244); + Py_CLEAR(clear_module_state->__pyx_codeobj__243); Py_CLEAR(clear_module_state->__pyx_codeobj__245); - Py_CLEAR(clear_module_state->__pyx_codeobj__246); - Py_CLEAR(clear_module_state->__pyx_codeobj__248); + Py_CLEAR(clear_module_state->__pyx_codeobj__247); 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__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__263); + 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__269); + Py_CLEAR(clear_module_state->__pyx_codeobj__270); Py_CLEAR(clear_module_state->__pyx_codeobj__271); + Py_CLEAR(clear_module_state->__pyx_codeobj__272); Py_CLEAR(clear_module_state->__pyx_codeobj__273); + Py_CLEAR(clear_module_state->__pyx_codeobj__274); Py_CLEAR(clear_module_state->__pyx_codeobj__275); - Py_CLEAR(clear_module_state->__pyx_codeobj__276); Py_CLEAR(clear_module_state->__pyx_codeobj__277); Py_CLEAR(clear_module_state->__pyx_codeobj__279); - Py_CLEAR(clear_module_state->__pyx_codeobj__280); 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__288); + Py_CLEAR(clear_module_state->__pyx_codeobj__287); + Py_CLEAR(clear_module_state->__pyx_codeobj__289); Py_CLEAR(clear_module_state->__pyx_codeobj__290); Py_CLEAR(clear_module_state->__pyx_codeobj__292); - Py_CLEAR(clear_module_state->__pyx_codeobj__294); - Py_CLEAR(clear_module_state->__pyx_codeobj__296); - Py_CLEAR(clear_module_state->__pyx_codeobj__298); + Py_CLEAR(clear_module_state->__pyx_codeobj__293); + 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__303); + Py_CLEAR(clear_module_state->__pyx_codeobj__304); + 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__313); + Py_CLEAR(clear_module_state->__pyx_codeobj__315); + Py_CLEAR(clear_module_state->__pyx_codeobj__317); + Py_CLEAR(clear_module_state->__pyx_codeobj__319); + Py_CLEAR(clear_module_state->__pyx_codeobj__321); + Py_CLEAR(clear_module_state->__pyx_codeobj__323); return 0; } #endif @@ -6592,52 +6862,60 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { 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_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_9_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_11__collides); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_11__collides); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_12_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_12_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_13_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_14_tangent); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_14_tangent); + 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__collides); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_16__collides); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_17_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_17_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_18_getCache); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_18_getCache); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_19__collides); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_19__collides); - 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___setitem__); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_21___setitem__); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_22_area); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_22_area); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_23_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_23_genexpr); - 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_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_26_genexpr); + 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_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_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_30_union); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_30_union); + 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); Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_31_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr); + 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_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); @@ -6650,7 +6928,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_A_rectangle_That_is_rotated_It_i); Py_VISIT(traverse_module_state->__pyx_kp_s_A_section_of_a_circle_s_circumfr); Py_VISIT(traverse_module_state->__pyx_kp_s_An_enum_representing_the_differ); - Py_VISIT(traverse_module_state->__pyx_kp_s_An_infintesimally_small_point_in); + Py_VISIT(traverse_module_state->__pyx_kp_s_An_enum_representing_the_differ_2); Py_VISIT(traverse_module_state->__pyx_n_s_Any); Py_VISIT(traverse_module_state->__pyx_n_s_Arc); Py_VISIT(traverse_module_state->__pyx_n_u_Arc); @@ -6663,6 +6941,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Arc___str); Py_VISIT(traverse_module_state->__pyx_n_s_Arc__collides); Py_VISIT(traverse_module_state->__pyx_n_s_Arc__collides_locals_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_Arc__contains); Py_VISIT(traverse_module_state->__pyx_n_s_Arc__where); Py_VISIT(traverse_module_state->__pyx_n_s_Arc_angleInRange); Py_VISIT(traverse_module_state->__pyx_n_s_Arc_area); @@ -6674,7 +6953,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Arc_copy); Py_VISIT(traverse_module_state->__pyx_n_s_Arc_endPoints); Py_VISIT(traverse_module_state->__pyx_n_s_Arc_flip); + Py_VISIT(traverse_module_state->__pyx_n_s_Arc_isCorner); Py_VISIT(traverse_module_state->__pyx_n_s_Arc_rect); + Py_VISIT(traverse_module_state->__pyx_n_s_Arc_toPoints); Py_VISIT(traverse_module_state->__pyx_n_s_B); Py_VISIT(traverse_module_state->__pyx_n_s_BASEBOUNCINESS); Py_VISIT(traverse_module_state->__pyx_n_s_BASEPRECISION); @@ -6694,6 +6975,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Circle___setitem); Py_VISIT(traverse_module_state->__pyx_n_s_Circle___str); Py_VISIT(traverse_module_state->__pyx_n_s_Circle__collides); + Py_VISIT(traverse_module_state->__pyx_n_s_Circle__contains); + Py_VISIT(traverse_module_state->__pyx_n_s_Circle__contains_locals_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_Circle__where); Py_VISIT(traverse_module_state->__pyx_n_s_Circle__where_locals_sign); Py_VISIT(traverse_module_state->__pyx_n_s_Circle_area); @@ -6712,6 +6995,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape___getitem); Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape___iter); Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape___str); + Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape__contains); + Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape__containsPoint); + Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape__contains_locals_gen); Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape__where); Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape_closestPointTo); Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape_closestPointTo_local); @@ -6732,12 +7018,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { 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); - Py_VISIT(traverse_module_state->__pyx_n_s_Enum); Py_VISIT(traverse_module_state->__pyx_n_s_GROUP); Py_VISIT(traverse_module_state->__pyx_n_s_GROUPS); Py_VISIT(traverse_module_state->__pyx_n_s_GeometryCollection); + Py_VISIT(traverse_module_state->__pyx_n_s_Group); Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); + Py_VISIT(traverse_module_state->__pyx_n_s_IntEnum); Py_VISIT(traverse_module_state->__pyx_n_s_Iterable); Py_VISIT(traverse_module_state->__pyx_kp_s_Iterable_Line); Py_VISIT(traverse_module_state->__pyx_kp_s_Iterable_Line_2); @@ -6757,6 +7044,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Line___str); Py_VISIT(traverse_module_state->__pyx_n_s_Line__collides); Py_VISIT(traverse_module_state->__pyx_n_s_Line__collides_locals_direction); + Py_VISIT(traverse_module_state->__pyx_n_s_Line__contains); Py_VISIT(traverse_module_state->__pyx_n_s_Line__onSegment); Py_VISIT(traverse_module_state->__pyx_n_s_Line__where); Py_VISIT(traverse_module_state->__pyx_n_s_Line__where_locals_line); @@ -6786,6 +7074,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_MultiPoint); Py_VISIT(traverse_module_state->__pyx_n_s_MultiPolygon); Py_VISIT(traverse_module_state->__pyx_n_s_N); + Py_VISIT(traverse_module_state->__pyx_n_s_NOTSTRAIGHT); Py_VISIT(traverse_module_state->__pyx_n_s_NoShape); Py_VISIT(traverse_module_state->__pyx_n_u_NoShape); Py_VISIT(traverse_module_state->__pyx_kp_u_NoShape_2); @@ -6793,6 +7082,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_NoShape___init); Py_VISIT(traverse_module_state->__pyx_n_s_NoShape___str); Py_VISIT(traverse_module_state->__pyx_n_s_NoShape__collides); + Py_VISIT(traverse_module_state->__pyx_n_s_NoShape__contains); Py_VISIT(traverse_module_state->__pyx_n_s_NoShape__where); Py_VISIT(traverse_module_state->__pyx_n_s_NoShape_area); Py_VISIT(traverse_module_state->__pyx_n_s_NoShape_copy); @@ -6808,6 +7098,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Point___setitem); Py_VISIT(traverse_module_state->__pyx_n_s_Point___str); Py_VISIT(traverse_module_state->__pyx_n_s_Point__collides); + Py_VISIT(traverse_module_state->__pyx_n_s_Point__contains); Py_VISIT(traverse_module_state->__pyx_n_s_Point__where); Py_VISIT(traverse_module_state->__pyx_n_s_Point_area); Py_VISIT(traverse_module_state->__pyx_n_s_Point_closestPointTo); @@ -6845,11 +7136,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Rect___str); Py_VISIT(traverse_module_state->__pyx_n_s_Rect__collides); Py_VISIT(traverse_module_state->__pyx_n_s_Rect__collides_locals_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_Rect__containsPoint); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_area); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_copy); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_toLines); Py_VISIT(traverse_module_state->__pyx_n_s_Rect_toPoints); + Py_VISIT(traverse_module_state->__pyx_n_s_RotRect); Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect); Py_VISIT(traverse_module_state->__pyx_n_u_RotatedRect); Py_VISIT(traverse_module_state->__pyx_kp_u_RotatedRect_2); @@ -6860,6 +7153,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect___str); Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect__collides); Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect__collides_locals_gen); + Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect__containsPoint); Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect_area); Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect_copy); Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect_getCache); @@ -6892,6 +7186,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Shape___setitem); Py_VISIT(traverse_module_state->__pyx_n_s_Shape___str); Py_VISIT(traverse_module_state->__pyx_n_s_Shape__collides); + Py_VISIT(traverse_module_state->__pyx_n_s_Shape__contains); Py_VISIT(traverse_module_state->__pyx_n_s_Shape__where); Py_VISIT(traverse_module_state->__pyx_n_s_Shape_area); Py_VISIT(traverse_module_state->__pyx_n_s_Shape_check_rects); @@ -6901,6 +7196,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Shape_distance_to); Py_VISIT(traverse_module_state->__pyx_n_s_Shape_handleCollisionsPos); Py_VISIT(traverse_module_state->__pyx_n_s_Shape_handleCollisionsVel); + Py_VISIT(traverse_module_state->__pyx_n_s_Shape_isContaining); Py_VISIT(traverse_module_state->__pyx_n_s_Shape_isCorner); Py_VISIT(traverse_module_state->__pyx_n_s_Shape_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Shape_tangent); @@ -6913,6 +7209,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Shapes___getitem); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes___init); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes___iter); + Py_VISIT(traverse_module_state->__pyx_n_s_Shapes___len); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes___repr); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes___setitem); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes___str); @@ -6925,6 +7222,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_copy); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_copy_leave_shapes); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_copy_locals_genexpr); + Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_isContaining); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_isCorner); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_rect_locals_genexpr); @@ -6932,13 +7230,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { 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_whereCollides); - Py_VISIT(traverse_module_state->__pyx_kp_u_Shapes_with); + Py_VISIT(traverse_module_state->__pyx_kp_u_Shapes_with_shapes); Py_VISIT(traverse_module_state->__pyx_n_s_ShpGroups); Py_VISIT(traverse_module_state->__pyx_n_u_ShpGroups); + Py_VISIT(traverse_module_state->__pyx_n_s_ShpTyps); + Py_VISIT(traverse_module_state->__pyx_n_u_ShpTyps); + Py_VISIT(traverse_module_state->__pyx_n_s_TYPE); + Py_VISIT(traverse_module_state->__pyx_n_s_TYPE_MATCHES); Py_VISIT(traverse_module_state->__pyx_kp_s_The_base_Shape_class_This_defaul); Py_VISIT(traverse_module_state->__pyx_kp_s_These_are_shapes_like_rects_and); Py_VISIT(traverse_module_state->__pyx_n_s_ThisClosestP); - Py_VISIT(traverse_module_state->__pyx_n_s_Type); Py_VISIT(traverse_module_state->__pyx_n_s_Union); Py_VISIT(traverse_module_state->__pyx_kp_s_Union_Number_pointLike); Py_VISIT(traverse_module_state->__pyx_kp_s_Union_Point_pointLike); @@ -6949,19 +7250,21 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2); Py_VISIT(traverse_module_state->__pyx_kp_s_Union_Shapes_Iterable_Shape); Py_VISIT(traverse_module_state->__pyx_kp_s_Union_Shapes_Iterable_Shape_2); - Py_VISIT(traverse_module_state->__pyx_kp_s_Union_Type_ShpGroups_Iterable_Un); + Py_VISIT(traverse_module_state->__pyx_kp_s_Union_ShpTyps_ShpGroups); 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__138); - Py_VISIT(traverse_module_state->__pyx_kp_u__16); - Py_VISIT(traverse_module_state->__pyx_kp_u__22); - Py_VISIT(traverse_module_state->__pyx_kp_u__23); - Py_VISIT(traverse_module_state->__pyx_n_s__299); + 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__34); - Py_VISIT(traverse_module_state->__pyx_kp_u__35); + 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_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_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_add_shape); Py_VISIT(traverse_module_state->__pyx_n_s_add_shapes); @@ -7004,6 +7307,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_checked); Py_VISIT(traverse_module_state->__pyx_n_s_cirO); Py_VISIT(traverse_module_state->__pyx_n_s_circle); + Py_VISIT(traverse_module_state->__pyx_n_s_class); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_close); @@ -7024,6 +7328,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_combineRects); Py_VISIT(traverse_module_state->__pyx_n_s_concave_hull); Py_VISIT(traverse_module_state->__pyx_n_s_constrainAng); + Py_VISIT(traverse_module_state->__pyx_n_s_contains); + Py_VISIT(traverse_module_state->__pyx_n_s_containsPoint); Py_VISIT(traverse_module_state->__pyx_n_s_coords); Py_VISIT(traverse_module_state->__pyx_n_s_copy); Py_VISIT(traverse_module_state->__pyx_n_s_copy_leave_shapes); @@ -7096,7 +7402,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_int); Py_VISIT(traverse_module_state->__pyx_n_s_intermediateObj); + Py_VISIT(traverse_module_state->__pyx_n_s_intersection); Py_VISIT(traverse_module_state->__pyx_n_s_intersections); + Py_VISIT(traverse_module_state->__pyx_n_s_isContaining); Py_VISIT(traverse_module_state->__pyx_n_s_isCorner); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_is_empty); @@ -7109,6 +7417,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_j); Py_VISIT(traverse_module_state->__pyx_n_s_k); Py_VISIT(traverse_module_state->__pyx_n_s_key); + Py_VISIT(traverse_module_state->__pyx_n_s_len); Py_VISIT(traverse_module_state->__pyx_n_s_li); Py_VISIT(traverse_module_state->__pyx_kp_s_lib_collisions_py); Py_VISIT(traverse_module_state->__pyx_n_s_line); @@ -7139,6 +7448,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_newPoint); Py_VISIT(traverse_module_state->__pyx_n_s_newShp); Py_VISIT(traverse_module_state->__pyx_n_s_newobj); + Py_VISIT(traverse_module_state->__pyx_n_s_newp); Py_VISIT(traverse_module_state->__pyx_n_s_newp1); Py_VISIT(traverse_module_state->__pyx_n_s_newp2); Py_VISIT(traverse_module_state->__pyx_n_s_newpts); @@ -7254,7 +7564,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_shapely_geometry); Py_VISIT(traverse_module_state->__pyx_n_s_shapely_ops); Py_VISIT(traverse_module_state->__pyx_n_s_shapes); - Py_VISIT(traverse_module_state->__pyx_kp_u_shapes_2); + Py_VISIT(traverse_module_state->__pyx_n_s_shpTyps); Py_VISIT(traverse_module_state->__pyx_n_s_sign); Py_VISIT(traverse_module_state->__pyx_n_s_sin); Py_VISIT(traverse_module_state->__pyx_n_s_slns); @@ -7300,6 +7610,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_tuple_Shape_pointLike_verboseOut); Py_VISIT(traverse_module_state->__pyx_kp_s_tuple_int_int_int); Py_VISIT(traverse_module_state->__pyx_kp_s_tuple_pointLike_pointLike_verbos); + Py_VISIT(traverse_module_state->__pyx_n_s_typ_set); Py_VISIT(traverse_module_state->__pyx_n_s_typing); Py_VISIT(traverse_module_state->__pyx_n_s_typs); Py_VISIT(traverse_module_state->__pyx_n_s_u); @@ -7365,27 +7676,34 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_int_270); Py_VISIT(traverse_module_state->__pyx_int_360); Py_VISIT(traverse_module_state->__pyx_int_neg_1); + Py_VISIT(traverse_module_state->__pyx_int_neg_2); + Py_VISIT(traverse_module_state->__pyx_int_neg_3); + Py_VISIT(traverse_module_state->__pyx_int_neg_4); + Py_VISIT(traverse_module_state->__pyx_int_neg_5); + Py_VISIT(traverse_module_state->__pyx_int_neg_6); + Py_VISIT(traverse_module_state->__pyx_int_neg_7); + Py_VISIT(traverse_module_state->__pyx_int_neg_8); + 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__5); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_tuple__9); + Py_VISIT(traverse_module_state->__pyx_tuple__8); + Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_tuple__18); + Py_VISIT(traverse_module_state->__pyx_tuple__15); + Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__24); + Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__29); - Py_VISIT(traverse_module_state->__pyx_tuple__32); - Py_VISIT(traverse_module_state->__pyx_tuple__36); - Py_VISIT(traverse_module_state->__pyx_tuple__37); + 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__38); Py_VISIT(traverse_module_state->__pyx_tuple__39); Py_VISIT(traverse_module_state->__pyx_tuple__41); 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__48); + 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__54); @@ -7393,102 +7711,110 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { 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__64); - Py_VISIT(traverse_module_state->__pyx_tuple__66); - Py_VISIT(traverse_module_state->__pyx_tuple__68); + Py_VISIT(traverse_module_state->__pyx_tuple__65); + Py_VISIT(traverse_module_state->__pyx_tuple__67); + 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__74); - Py_VISIT(traverse_module_state->__pyx_tuple__76); - Py_VISIT(traverse_module_state->__pyx_tuple__82); - Py_VISIT(traverse_module_state->__pyx_tuple__84); - Py_VISIT(traverse_module_state->__pyx_tuple__87); - Py_VISIT(traverse_module_state->__pyx_tuple__89); - Py_VISIT(traverse_module_state->__pyx_tuple__99); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__8); - Py_VISIT(traverse_module_state->__pyx_tuple__101); - Py_VISIT(traverse_module_state->__pyx_tuple__105); - Py_VISIT(traverse_module_state->__pyx_tuple__108); + 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__110); - Py_VISIT(traverse_module_state->__pyx_tuple__112); - Py_VISIT(traverse_module_state->__pyx_tuple__114); - Py_VISIT(traverse_module_state->__pyx_tuple__116); + Py_VISIT(traverse_module_state->__pyx_tuple__113); + Py_VISIT(traverse_module_state->__pyx_tuple__115); Py_VISIT(traverse_module_state->__pyx_tuple__118); - Py_VISIT(traverse_module_state->__pyx_tuple__123); - Py_VISIT(traverse_module_state->__pyx_tuple__125); - Py_VISIT(traverse_module_state->__pyx_tuple__129); - 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__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__154); - Py_VISIT(traverse_module_state->__pyx_tuple__158); + Py_VISIT(traverse_module_state->__pyx_tuple__153); + Py_VISIT(traverse_module_state->__pyx_tuple__155); + Py_VISIT(traverse_module_state->__pyx_tuple__159); Py_VISIT(traverse_module_state->__pyx_tuple__163); - Py_VISIT(traverse_module_state->__pyx_tuple__165); Py_VISIT(traverse_module_state->__pyx_tuple__167); - Py_VISIT(traverse_module_state->__pyx_tuple__169); - Py_VISIT(traverse_module_state->__pyx_tuple__171); Py_VISIT(traverse_module_state->__pyx_tuple__173); Py_VISIT(traverse_module_state->__pyx_tuple__175); - Py_VISIT(traverse_module_state->__pyx_tuple__182); - 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__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__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__204); - Py_VISIT(traverse_module_state->__pyx_tuple__206); - Py_VISIT(traverse_module_state->__pyx_tuple__209); - Py_VISIT(traverse_module_state->__pyx_tuple__211); - Py_VISIT(traverse_module_state->__pyx_tuple__213); - Py_VISIT(traverse_module_state->__pyx_tuple__215); - Py_VISIT(traverse_module_state->__pyx_tuple__217); - Py_VISIT(traverse_module_state->__pyx_tuple__219); + 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__236); - Py_VISIT(traverse_module_state->__pyx_tuple__243); - Py_VISIT(traverse_module_state->__pyx_tuple__247); + 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__258); - Py_VISIT(traverse_module_state->__pyx_tuple__261); - Py_VISIT(traverse_module_state->__pyx_tuple__264); + Py_VISIT(traverse_module_state->__pyx_tuple__263); Py_VISIT(traverse_module_state->__pyx_tuple__267); - Py_VISIT(traverse_module_state->__pyx_tuple__270); - Py_VISIT(traverse_module_state->__pyx_tuple__272); - Py_VISIT(traverse_module_state->__pyx_tuple__274); + 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__287); - Py_VISIT(traverse_module_state->__pyx_tuple__289); + 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__291); - Py_VISIT(traverse_module_state->__pyx_tuple__293); - Py_VISIT(traverse_module_state->__pyx_tuple__295); - Py_VISIT(traverse_module_state->__pyx_tuple__297); - Py_VISIT(traverse_module_state->__pyx_codeobj__10); + Py_VISIT(traverse_module_state->__pyx_tuple__294); + 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__318); + Py_VISIT(traverse_module_state->__pyx_tuple__320); + Py_VISIT(traverse_module_state->__pyx_tuple__322); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__17); + Py_VISIT(traverse_module_state->__pyx_codeobj__14); + 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__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); + Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__27); - Py_VISIT(traverse_module_state->__pyx_codeobj__28); + Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__30); - Py_VISIT(traverse_module_state->__pyx_codeobj__31); + Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__33); - Py_VISIT(traverse_module_state->__pyx_codeobj__38); + 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__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); - Py_VISIT(traverse_module_state->__pyx_codeobj__49); + 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__55); @@ -7496,165 +7822,181 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { 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__65); - Py_VISIT(traverse_module_state->__pyx_codeobj__67); - Py_VISIT(traverse_module_state->__pyx_codeobj__69); + Py_VISIT(traverse_module_state->__pyx_codeobj__64); + Py_VISIT(traverse_module_state->__pyx_codeobj__66); + 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__75); - Py_VISIT(traverse_module_state->__pyx_codeobj__77); - Py_VISIT(traverse_module_state->__pyx_codeobj__78); + 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__80); Py_VISIT(traverse_module_state->__pyx_codeobj__81); + Py_VISIT(traverse_module_state->__pyx_codeobj__82); 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__88); + Py_VISIT(traverse_module_state->__pyx_codeobj__87); + Py_VISIT(traverse_module_state->__pyx_codeobj__89); Py_VISIT(traverse_module_state->__pyx_codeobj__90); - Py_VISIT(traverse_module_state->__pyx_codeobj__91); Py_VISIT(traverse_module_state->__pyx_codeobj__92); - 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__106); + Py_VISIT(traverse_module_state->__pyx_codeobj__105); 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__113); - Py_VISIT(traverse_module_state->__pyx_codeobj__115); + Py_VISIT(traverse_module_state->__pyx_codeobj__112); + 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__120); Py_VISIT(traverse_module_state->__pyx_codeobj__121); - Py_VISIT(traverse_module_state->__pyx_codeobj__122); - Py_VISIT(traverse_module_state->__pyx_codeobj__124); + Py_VISIT(traverse_module_state->__pyx_codeobj__123); + Py_VISIT(traverse_module_state->__pyx_codeobj__125); 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__130); + Py_VISIT(traverse_module_state->__pyx_codeobj__129); Py_VISIT(traverse_module_state->__pyx_codeobj__131); - Py_VISIT(traverse_module_state->__pyx_codeobj__132); Py_VISIT(traverse_module_state->__pyx_codeobj__133); 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__147); - Py_VISIT(traverse_module_state->__pyx_codeobj__148); + Py_VISIT(traverse_module_state->__pyx_codeobj__146); Py_VISIT(traverse_module_state->__pyx_codeobj__149); 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__155); + 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__159); + 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__165); Py_VISIT(traverse_module_state->__pyx_codeobj__166); Py_VISIT(traverse_module_state->__pyx_codeobj__168); + 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__174); Py_VISIT(traverse_module_state->__pyx_codeobj__176); - 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__181); - Py_VISIT(traverse_module_state->__pyx_codeobj__183); + Py_VISIT(traverse_module_state->__pyx_codeobj__182); Py_VISIT(traverse_module_state->__pyx_codeobj__184); - Py_VISIT(traverse_module_state->__pyx_codeobj__185); + Py_VISIT(traverse_module_state->__pyx_codeobj__186); 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__200); Py_VISIT(traverse_module_state->__pyx_codeobj__201); 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__214); - Py_VISIT(traverse_module_state->__pyx_codeobj__216); - Py_VISIT(traverse_module_state->__pyx_codeobj__218); + 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__233); Py_VISIT(traverse_module_state->__pyx_codeobj__235); + 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__242); - Py_VISIT(traverse_module_state->__pyx_codeobj__244); + Py_VISIT(traverse_module_state->__pyx_codeobj__243); Py_VISIT(traverse_module_state->__pyx_codeobj__245); - Py_VISIT(traverse_module_state->__pyx_codeobj__246); - Py_VISIT(traverse_module_state->__pyx_codeobj__248); + Py_VISIT(traverse_module_state->__pyx_codeobj__247); 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__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__263); + 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__269); + Py_VISIT(traverse_module_state->__pyx_codeobj__270); Py_VISIT(traverse_module_state->__pyx_codeobj__271); + Py_VISIT(traverse_module_state->__pyx_codeobj__272); Py_VISIT(traverse_module_state->__pyx_codeobj__273); + Py_VISIT(traverse_module_state->__pyx_codeobj__274); Py_VISIT(traverse_module_state->__pyx_codeobj__275); - Py_VISIT(traverse_module_state->__pyx_codeobj__276); Py_VISIT(traverse_module_state->__pyx_codeobj__277); Py_VISIT(traverse_module_state->__pyx_codeobj__279); - Py_VISIT(traverse_module_state->__pyx_codeobj__280); 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__288); + Py_VISIT(traverse_module_state->__pyx_codeobj__287); + Py_VISIT(traverse_module_state->__pyx_codeobj__289); Py_VISIT(traverse_module_state->__pyx_codeobj__290); Py_VISIT(traverse_module_state->__pyx_codeobj__292); - Py_VISIT(traverse_module_state->__pyx_codeobj__294); - Py_VISIT(traverse_module_state->__pyx_codeobj__296); - Py_VISIT(traverse_module_state->__pyx_codeobj__298); + Py_VISIT(traverse_module_state->__pyx_codeobj__293); + 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__303); + Py_VISIT(traverse_module_state->__pyx_codeobj__304); + 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__313); + Py_VISIT(traverse_module_state->__pyx_codeobj__315); + Py_VISIT(traverse_module_state->__pyx_codeobj__317); + Py_VISIT(traverse_module_state->__pyx_codeobj__319); + Py_VISIT(traverse_module_state->__pyx_codeobj__321); + Py_VISIT(traverse_module_state->__pyx_codeobj__323); return 0; } #endif @@ -7693,29 +8035,33 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #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_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_9_closestPointTo -#define __pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos -#define __pyx_type_10collisions___pyx_scope_struct_11__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_11__collides -#define __pyx_type_10collisions___pyx_scope_struct_12_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_12_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_13_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_13_closestPointTo -#define __pyx_type_10collisions___pyx_scope_struct_14_tangent __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_14_tangent +#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__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_16__collides -#define __pyx_type_10collisions___pyx_scope_struct_17_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_17_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_18_getCache __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_18_getCache -#define __pyx_type_10collisions___pyx_scope_struct_19__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_19__collides -#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___setitem__ __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_21___setitem__ -#define __pyx_type_10collisions___pyx_scope_struct_22_area __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_22_area -#define __pyx_type_10collisions___pyx_scope_struct_23_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_23_genexpr -#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_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_26_genexpr +#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_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_28_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_30_union __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_30_union +#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 #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_1_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr @@ -7726,29 +8072,33 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #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_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo -#define __pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos -#define __pyx_ptype_10collisions___pyx_scope_struct_11__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_11__collides -#define __pyx_ptype_10collisions___pyx_scope_struct_12_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_12_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo -#define __pyx_ptype_10collisions___pyx_scope_struct_14_tangent __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_14_tangent +#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__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_16__collides -#define __pyx_ptype_10collisions___pyx_scope_struct_17_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_17_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_18_getCache __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_18_getCache -#define __pyx_ptype_10collisions___pyx_scope_struct_19__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_19__collides -#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___setitem__ __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_21___setitem__ -#define __pyx_ptype_10collisions___pyx_scope_struct_22_area __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_22_area -#define __pyx_ptype_10collisions___pyx_scope_struct_23_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_23_genexpr -#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_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_26_genexpr +#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_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_28_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_30_union __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_30_union +#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_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 @@ -7761,7 +8111,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_A_rectangle_That_is_rotated_It_i __pyx_mstate_global->__pyx_kp_s_A_rectangle_That_is_rotated_It_i #define __pyx_kp_s_A_section_of_a_circle_s_circumfr __pyx_mstate_global->__pyx_kp_s_A_section_of_a_circle_s_circumfr #define __pyx_kp_s_An_enum_representing_the_differ __pyx_mstate_global->__pyx_kp_s_An_enum_representing_the_differ -#define __pyx_kp_s_An_infintesimally_small_point_in __pyx_mstate_global->__pyx_kp_s_An_infintesimally_small_point_in +#define __pyx_kp_s_An_enum_representing_the_differ_2 __pyx_mstate_global->__pyx_kp_s_An_enum_representing_the_differ_2 #define __pyx_n_s_Any __pyx_mstate_global->__pyx_n_s_Any #define __pyx_n_s_Arc __pyx_mstate_global->__pyx_n_s_Arc #define __pyx_n_u_Arc __pyx_mstate_global->__pyx_n_u_Arc @@ -7774,6 +8124,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Arc___str __pyx_mstate_global->__pyx_n_s_Arc___str #define __pyx_n_s_Arc__collides __pyx_mstate_global->__pyx_n_s_Arc__collides #define __pyx_n_s_Arc__collides_locals_genexpr __pyx_mstate_global->__pyx_n_s_Arc__collides_locals_genexpr +#define __pyx_n_s_Arc__contains __pyx_mstate_global->__pyx_n_s_Arc__contains #define __pyx_n_s_Arc__where __pyx_mstate_global->__pyx_n_s_Arc__where #define __pyx_n_s_Arc_angleInRange __pyx_mstate_global->__pyx_n_s_Arc_angleInRange #define __pyx_n_s_Arc_area __pyx_mstate_global->__pyx_n_s_Arc_area @@ -7785,7 +8136,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Arc_copy __pyx_mstate_global->__pyx_n_s_Arc_copy #define __pyx_n_s_Arc_endPoints __pyx_mstate_global->__pyx_n_s_Arc_endPoints #define __pyx_n_s_Arc_flip __pyx_mstate_global->__pyx_n_s_Arc_flip +#define __pyx_n_s_Arc_isCorner __pyx_mstate_global->__pyx_n_s_Arc_isCorner #define __pyx_n_s_Arc_rect __pyx_mstate_global->__pyx_n_s_Arc_rect +#define __pyx_n_s_Arc_toPoints __pyx_mstate_global->__pyx_n_s_Arc_toPoints #define __pyx_n_s_B __pyx_mstate_global->__pyx_n_s_B #define __pyx_n_s_BASEBOUNCINESS __pyx_mstate_global->__pyx_n_s_BASEBOUNCINESS #define __pyx_n_s_BASEPRECISION __pyx_mstate_global->__pyx_n_s_BASEPRECISION @@ -7805,6 +8158,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Circle___setitem __pyx_mstate_global->__pyx_n_s_Circle___setitem #define __pyx_n_s_Circle___str __pyx_mstate_global->__pyx_n_s_Circle___str #define __pyx_n_s_Circle__collides __pyx_mstate_global->__pyx_n_s_Circle__collides +#define __pyx_n_s_Circle__contains __pyx_mstate_global->__pyx_n_s_Circle__contains +#define __pyx_n_s_Circle__contains_locals_genexpr __pyx_mstate_global->__pyx_n_s_Circle__contains_locals_genexpr #define __pyx_n_s_Circle__where __pyx_mstate_global->__pyx_n_s_Circle__where #define __pyx_n_s_Circle__where_locals_sign __pyx_mstate_global->__pyx_n_s_Circle__where_locals_sign #define __pyx_n_s_Circle_area __pyx_mstate_global->__pyx_n_s_Circle_area @@ -7823,6 +8178,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_ClosedShape___getitem __pyx_mstate_global->__pyx_n_s_ClosedShape___getitem #define __pyx_n_s_ClosedShape___iter __pyx_mstate_global->__pyx_n_s_ClosedShape___iter #define __pyx_n_s_ClosedShape___str __pyx_mstate_global->__pyx_n_s_ClosedShape___str +#define __pyx_n_s_ClosedShape__contains __pyx_mstate_global->__pyx_n_s_ClosedShape__contains +#define __pyx_n_s_ClosedShape__containsPoint __pyx_mstate_global->__pyx_n_s_ClosedShape__containsPoint +#define __pyx_n_s_ClosedShape__contains_locals_gen __pyx_mstate_global->__pyx_n_s_ClosedShape__contains_locals_gen #define __pyx_n_s_ClosedShape__where __pyx_mstate_global->__pyx_n_s_ClosedShape__where #define __pyx_n_s_ClosedShape_closestPointTo __pyx_mstate_global->__pyx_n_s_ClosedShape_closestPointTo #define __pyx_n_s_ClosedShape_closestPointTo_local __pyx_mstate_global->__pyx_n_s_ClosedShape_closestPointTo_local @@ -7843,12 +8201,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #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 -#define __pyx_n_s_Enum __pyx_mstate_global->__pyx_n_s_Enum #define __pyx_n_s_GROUP __pyx_mstate_global->__pyx_n_s_GROUP #define __pyx_n_s_GROUPS __pyx_mstate_global->__pyx_n_s_GROUPS #define __pyx_n_s_GeometryCollection __pyx_mstate_global->__pyx_n_s_GeometryCollection +#define __pyx_n_s_Group __pyx_mstate_global->__pyx_n_s_Group #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError +#define __pyx_n_s_IntEnum __pyx_mstate_global->__pyx_n_s_IntEnum #define __pyx_n_s_Iterable __pyx_mstate_global->__pyx_n_s_Iterable #define __pyx_kp_s_Iterable_Line __pyx_mstate_global->__pyx_kp_s_Iterable_Line #define __pyx_kp_s_Iterable_Line_2 __pyx_mstate_global->__pyx_kp_s_Iterable_Line_2 @@ -7868,6 +8227,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Line___str __pyx_mstate_global->__pyx_n_s_Line___str #define __pyx_n_s_Line__collides __pyx_mstate_global->__pyx_n_s_Line__collides #define __pyx_n_s_Line__collides_locals_direction __pyx_mstate_global->__pyx_n_s_Line__collides_locals_direction +#define __pyx_n_s_Line__contains __pyx_mstate_global->__pyx_n_s_Line__contains #define __pyx_n_s_Line__onSegment __pyx_mstate_global->__pyx_n_s_Line__onSegment #define __pyx_n_s_Line__where __pyx_mstate_global->__pyx_n_s_Line__where #define __pyx_n_s_Line__where_locals_line __pyx_mstate_global->__pyx_n_s_Line__where_locals_line @@ -7897,6 +8257,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_MultiPoint __pyx_mstate_global->__pyx_n_s_MultiPoint #define __pyx_n_s_MultiPolygon __pyx_mstate_global->__pyx_n_s_MultiPolygon #define __pyx_n_s_N __pyx_mstate_global->__pyx_n_s_N +#define __pyx_n_s_NOTSTRAIGHT __pyx_mstate_global->__pyx_n_s_NOTSTRAIGHT #define __pyx_n_s_NoShape __pyx_mstate_global->__pyx_n_s_NoShape #define __pyx_n_u_NoShape __pyx_mstate_global->__pyx_n_u_NoShape #define __pyx_kp_u_NoShape_2 __pyx_mstate_global->__pyx_kp_u_NoShape_2 @@ -7904,6 +8265,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_NoShape___init __pyx_mstate_global->__pyx_n_s_NoShape___init #define __pyx_n_s_NoShape___str __pyx_mstate_global->__pyx_n_s_NoShape___str #define __pyx_n_s_NoShape__collides __pyx_mstate_global->__pyx_n_s_NoShape__collides +#define __pyx_n_s_NoShape__contains __pyx_mstate_global->__pyx_n_s_NoShape__contains #define __pyx_n_s_NoShape__where __pyx_mstate_global->__pyx_n_s_NoShape__where #define __pyx_n_s_NoShape_area __pyx_mstate_global->__pyx_n_s_NoShape_area #define __pyx_n_s_NoShape_copy __pyx_mstate_global->__pyx_n_s_NoShape_copy @@ -7919,6 +8281,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Point___setitem __pyx_mstate_global->__pyx_n_s_Point___setitem #define __pyx_n_s_Point___str __pyx_mstate_global->__pyx_n_s_Point___str #define __pyx_n_s_Point__collides __pyx_mstate_global->__pyx_n_s_Point__collides +#define __pyx_n_s_Point__contains __pyx_mstate_global->__pyx_n_s_Point__contains #define __pyx_n_s_Point__where __pyx_mstate_global->__pyx_n_s_Point__where #define __pyx_n_s_Point_area __pyx_mstate_global->__pyx_n_s_Point_area #define __pyx_n_s_Point_closestPointTo __pyx_mstate_global->__pyx_n_s_Point_closestPointTo @@ -7956,11 +8319,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Rect___str __pyx_mstate_global->__pyx_n_s_Rect___str #define __pyx_n_s_Rect__collides __pyx_mstate_global->__pyx_n_s_Rect__collides #define __pyx_n_s_Rect__collides_locals_genexpr __pyx_mstate_global->__pyx_n_s_Rect__collides_locals_genexpr +#define __pyx_n_s_Rect__containsPoint __pyx_mstate_global->__pyx_n_s_Rect__containsPoint #define __pyx_n_s_Rect_area __pyx_mstate_global->__pyx_n_s_Rect_area #define __pyx_n_s_Rect_copy __pyx_mstate_global->__pyx_n_s_Rect_copy #define __pyx_n_s_Rect_rect __pyx_mstate_global->__pyx_n_s_Rect_rect #define __pyx_n_s_Rect_toLines __pyx_mstate_global->__pyx_n_s_Rect_toLines #define __pyx_n_s_Rect_toPoints __pyx_mstate_global->__pyx_n_s_Rect_toPoints +#define __pyx_n_s_RotRect __pyx_mstate_global->__pyx_n_s_RotRect #define __pyx_n_s_RotatedRect __pyx_mstate_global->__pyx_n_s_RotatedRect #define __pyx_n_u_RotatedRect __pyx_mstate_global->__pyx_n_u_RotatedRect #define __pyx_kp_u_RotatedRect_2 __pyx_mstate_global->__pyx_kp_u_RotatedRect_2 @@ -7971,6 +8336,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_RotatedRect___str __pyx_mstate_global->__pyx_n_s_RotatedRect___str #define __pyx_n_s_RotatedRect__collides __pyx_mstate_global->__pyx_n_s_RotatedRect__collides #define __pyx_n_s_RotatedRect__collides_locals_gen __pyx_mstate_global->__pyx_n_s_RotatedRect__collides_locals_gen +#define __pyx_n_s_RotatedRect__containsPoint __pyx_mstate_global->__pyx_n_s_RotatedRect__containsPoint #define __pyx_n_s_RotatedRect_area __pyx_mstate_global->__pyx_n_s_RotatedRect_area #define __pyx_n_s_RotatedRect_copy __pyx_mstate_global->__pyx_n_s_RotatedRect_copy #define __pyx_n_s_RotatedRect_getCache __pyx_mstate_global->__pyx_n_s_RotatedRect_getCache @@ -8003,6 +8369,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Shape___setitem __pyx_mstate_global->__pyx_n_s_Shape___setitem #define __pyx_n_s_Shape___str __pyx_mstate_global->__pyx_n_s_Shape___str #define __pyx_n_s_Shape__collides __pyx_mstate_global->__pyx_n_s_Shape__collides +#define __pyx_n_s_Shape__contains __pyx_mstate_global->__pyx_n_s_Shape__contains #define __pyx_n_s_Shape__where __pyx_mstate_global->__pyx_n_s_Shape__where #define __pyx_n_s_Shape_area __pyx_mstate_global->__pyx_n_s_Shape_area #define __pyx_n_s_Shape_check_rects __pyx_mstate_global->__pyx_n_s_Shape_check_rects @@ -8012,6 +8379,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Shape_distance_to __pyx_mstate_global->__pyx_n_s_Shape_distance_to #define __pyx_n_s_Shape_handleCollisionsPos __pyx_mstate_global->__pyx_n_s_Shape_handleCollisionsPos #define __pyx_n_s_Shape_handleCollisionsVel __pyx_mstate_global->__pyx_n_s_Shape_handleCollisionsVel +#define __pyx_n_s_Shape_isContaining __pyx_mstate_global->__pyx_n_s_Shape_isContaining #define __pyx_n_s_Shape_isCorner __pyx_mstate_global->__pyx_n_s_Shape_isCorner #define __pyx_n_s_Shape_rect __pyx_mstate_global->__pyx_n_s_Shape_rect #define __pyx_n_s_Shape_tangent __pyx_mstate_global->__pyx_n_s_Shape_tangent @@ -8024,6 +8392,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Shapes___getitem __pyx_mstate_global->__pyx_n_s_Shapes___getitem #define __pyx_n_s_Shapes___init __pyx_mstate_global->__pyx_n_s_Shapes___init #define __pyx_n_s_Shapes___iter __pyx_mstate_global->__pyx_n_s_Shapes___iter +#define __pyx_n_s_Shapes___len __pyx_mstate_global->__pyx_n_s_Shapes___len #define __pyx_n_s_Shapes___repr __pyx_mstate_global->__pyx_n_s_Shapes___repr #define __pyx_n_s_Shapes___setitem __pyx_mstate_global->__pyx_n_s_Shapes___setitem #define __pyx_n_s_Shapes___str __pyx_mstate_global->__pyx_n_s_Shapes___str @@ -8036,6 +8405,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #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 #define __pyx_n_s_Shapes_copy_locals_genexpr __pyx_mstate_global->__pyx_n_s_Shapes_copy_locals_genexpr +#define __pyx_n_s_Shapes_isContaining __pyx_mstate_global->__pyx_n_s_Shapes_isContaining #define __pyx_n_s_Shapes_isCorner __pyx_mstate_global->__pyx_n_s_Shapes_isCorner #define __pyx_n_s_Shapes_rect __pyx_mstate_global->__pyx_n_s_Shapes_rect #define __pyx_n_s_Shapes_rect_locals_genexpr __pyx_mstate_global->__pyx_n_s_Shapes_rect_locals_genexpr @@ -8043,13 +8413,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #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_whereCollides __pyx_mstate_global->__pyx_n_s_Shapes_whereCollides -#define __pyx_kp_u_Shapes_with __pyx_mstate_global->__pyx_kp_u_Shapes_with +#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 #define __pyx_n_u_ShpGroups __pyx_mstate_global->__pyx_n_u_ShpGroups +#define __pyx_n_s_ShpTyps __pyx_mstate_global->__pyx_n_s_ShpTyps +#define __pyx_n_u_ShpTyps __pyx_mstate_global->__pyx_n_u_ShpTyps +#define __pyx_n_s_TYPE __pyx_mstate_global->__pyx_n_s_TYPE +#define __pyx_n_s_TYPE_MATCHES __pyx_mstate_global->__pyx_n_s_TYPE_MATCHES #define __pyx_kp_s_The_base_Shape_class_This_defaul __pyx_mstate_global->__pyx_kp_s_The_base_Shape_class_This_defaul #define __pyx_kp_s_These_are_shapes_like_rects_and __pyx_mstate_global->__pyx_kp_s_These_are_shapes_like_rects_and #define __pyx_n_s_ThisClosestP __pyx_mstate_global->__pyx_n_s_ThisClosestP -#define __pyx_n_s_Type __pyx_mstate_global->__pyx_n_s_Type #define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union #define __pyx_kp_s_Union_Number_pointLike __pyx_mstate_global->__pyx_kp_s_Union_Number_pointLike #define __pyx_kp_s_Union_Point_pointLike __pyx_mstate_global->__pyx_kp_s_Union_Point_pointLike @@ -8060,19 +8433,21 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2 __pyx_mstate_global->__pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2 #define __pyx_kp_s_Union_Shapes_Iterable_Shape __pyx_mstate_global->__pyx_kp_s_Union_Shapes_Iterable_Shape #define __pyx_kp_s_Union_Shapes_Iterable_Shape_2 __pyx_mstate_global->__pyx_kp_s_Union_Shapes_Iterable_Shape_2 -#define __pyx_kp_s_Union_Type_ShpGroups_Iterable_Un __pyx_mstate_global->__pyx_kp_s_Union_Type_ShpGroups_Iterable_Un +#define __pyx_kp_s_Union_ShpTyps_ShpGroups __pyx_mstate_global->__pyx_kp_s_Union_ShpTyps_ShpGroups #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__138 __pyx_mstate_global->__pyx_n_s__138 -#define __pyx_kp_u__16 __pyx_mstate_global->__pyx_kp_u__16 -#define __pyx_kp_u__22 __pyx_mstate_global->__pyx_kp_u__22 -#define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23 -#define __pyx_n_s__299 __pyx_mstate_global->__pyx_n_s__299 +#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__34 __pyx_mstate_global->__pyx_n_s__34 -#define __pyx_kp_u__35 __pyx_mstate_global->__pyx_kp_u__35 +#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_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_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 @@ -8115,6 +8490,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_checked __pyx_mstate_global->__pyx_n_s_checked #define __pyx_n_s_cirO __pyx_mstate_global->__pyx_n_s_cirO #define __pyx_n_s_circle __pyx_mstate_global->__pyx_n_s_circle +#define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close @@ -8135,6 +8511,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_combineRects __pyx_mstate_global->__pyx_n_s_combineRects #define __pyx_n_s_concave_hull __pyx_mstate_global->__pyx_n_s_concave_hull #define __pyx_n_s_constrainAng __pyx_mstate_global->__pyx_n_s_constrainAng +#define __pyx_n_s_contains __pyx_mstate_global->__pyx_n_s_contains +#define __pyx_n_s_containsPoint __pyx_mstate_global->__pyx_n_s_containsPoint #define __pyx_n_s_coords __pyx_mstate_global->__pyx_n_s_coords #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy #define __pyx_n_s_copy_leave_shapes __pyx_mstate_global->__pyx_n_s_copy_leave_shapes @@ -8207,7 +8585,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int #define __pyx_n_s_intermediateObj __pyx_mstate_global->__pyx_n_s_intermediateObj +#define __pyx_n_s_intersection __pyx_mstate_global->__pyx_n_s_intersection #define __pyx_n_s_intersections __pyx_mstate_global->__pyx_n_s_intersections +#define __pyx_n_s_isContaining __pyx_mstate_global->__pyx_n_s_isContaining #define __pyx_n_s_isCorner __pyx_mstate_global->__pyx_n_s_isCorner #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_is_empty __pyx_mstate_global->__pyx_n_s_is_empty @@ -8220,6 +8600,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k #define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key +#define __pyx_n_s_len __pyx_mstate_global->__pyx_n_s_len #define __pyx_n_s_li __pyx_mstate_global->__pyx_n_s_li #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 @@ -8250,6 +8631,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_newPoint __pyx_mstate_global->__pyx_n_s_newPoint #define __pyx_n_s_newShp __pyx_mstate_global->__pyx_n_s_newShp #define __pyx_n_s_newobj __pyx_mstate_global->__pyx_n_s_newobj +#define __pyx_n_s_newp __pyx_mstate_global->__pyx_n_s_newp #define __pyx_n_s_newp1 __pyx_mstate_global->__pyx_n_s_newp1 #define __pyx_n_s_newp2 __pyx_mstate_global->__pyx_n_s_newp2 #define __pyx_n_s_newpts __pyx_mstate_global->__pyx_n_s_newpts @@ -8365,7 +8747,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_shapely_geometry __pyx_mstate_global->__pyx_n_s_shapely_geometry #define __pyx_n_s_shapely_ops __pyx_mstate_global->__pyx_n_s_shapely_ops #define __pyx_n_s_shapes __pyx_mstate_global->__pyx_n_s_shapes -#define __pyx_kp_u_shapes_2 __pyx_mstate_global->__pyx_kp_u_shapes_2 +#define __pyx_n_s_shpTyps __pyx_mstate_global->__pyx_n_s_shpTyps #define __pyx_n_s_sign __pyx_mstate_global->__pyx_n_s_sign #define __pyx_n_s_sin __pyx_mstate_global->__pyx_n_s_sin #define __pyx_n_s_slns __pyx_mstate_global->__pyx_n_s_slns @@ -8411,6 +8793,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_tuple_Shape_pointLike_verboseOut __pyx_mstate_global->__pyx_kp_s_tuple_Shape_pointLike_verboseOut #define __pyx_kp_s_tuple_int_int_int __pyx_mstate_global->__pyx_kp_s_tuple_int_int_int #define __pyx_kp_s_tuple_pointLike_pointLike_verbos __pyx_mstate_global->__pyx_kp_s_tuple_pointLike_pointLike_verbos +#define __pyx_n_s_typ_set __pyx_mstate_global->__pyx_n_s_typ_set #define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing #define __pyx_n_s_typs __pyx_mstate_global->__pyx_n_s_typs #define __pyx_n_s_u __pyx_mstate_global->__pyx_n_s_u @@ -8476,27 +8859,34 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_int_270 __pyx_mstate_global->__pyx_int_270 #define __pyx_int_360 __pyx_mstate_global->__pyx_int_360 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 +#define __pyx_int_neg_2 __pyx_mstate_global->__pyx_int_neg_2 +#define __pyx_int_neg_3 __pyx_mstate_global->__pyx_int_neg_3 +#define __pyx_int_neg_4 __pyx_mstate_global->__pyx_int_neg_4 +#define __pyx_int_neg_5 __pyx_mstate_global->__pyx_int_neg_5 +#define __pyx_int_neg_6 __pyx_mstate_global->__pyx_int_neg_6 +#define __pyx_int_neg_7 __pyx_mstate_global->__pyx_int_neg_7 +#define __pyx_int_neg_8 __pyx_mstate_global->__pyx_int_neg_8 +#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__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 +#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 +#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 +#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 +#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 +#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 -#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 -#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 -#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 +#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__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__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__48 __pyx_mstate_global->__pyx_tuple__48 +#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__54 __pyx_mstate_global->__pyx_tuple__54 @@ -8504,102 +8894,110 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #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__64 __pyx_mstate_global->__pyx_tuple__64 -#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 -#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 +#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 +#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 +#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__74 __pyx_mstate_global->__pyx_tuple__74 -#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 -#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82 -#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 -#define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 -#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 -#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 -#define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101 -#define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105 -#define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 +#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__110 __pyx_mstate_global->__pyx_tuple__110 -#define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112 -#define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114 -#define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116 +#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 +#define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115 #define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118 -#define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123 -#define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 -#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 -#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__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__154 __pyx_mstate_global->__pyx_tuple__154 -#define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158 +#define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153 +#define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155 +#define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159 #define __pyx_tuple__163 __pyx_mstate_global->__pyx_tuple__163 -#define __pyx_tuple__165 __pyx_mstate_global->__pyx_tuple__165 #define __pyx_tuple__167 __pyx_mstate_global->__pyx_tuple__167 -#define __pyx_tuple__169 __pyx_mstate_global->__pyx_tuple__169 -#define __pyx_tuple__171 __pyx_mstate_global->__pyx_tuple__171 #define __pyx_tuple__173 __pyx_mstate_global->__pyx_tuple__173 #define __pyx_tuple__175 __pyx_mstate_global->__pyx_tuple__175 -#define __pyx_tuple__182 __pyx_mstate_global->__pyx_tuple__182 -#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__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__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__204 __pyx_mstate_global->__pyx_tuple__204 -#define __pyx_tuple__206 __pyx_mstate_global->__pyx_tuple__206 -#define __pyx_tuple__209 __pyx_mstate_global->__pyx_tuple__209 -#define __pyx_tuple__211 __pyx_mstate_global->__pyx_tuple__211 -#define __pyx_tuple__213 __pyx_mstate_global->__pyx_tuple__213 -#define __pyx_tuple__215 __pyx_mstate_global->__pyx_tuple__215 -#define __pyx_tuple__217 __pyx_mstate_global->__pyx_tuple__217 -#define __pyx_tuple__219 __pyx_mstate_global->__pyx_tuple__219 +#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__236 __pyx_mstate_global->__pyx_tuple__236 -#define __pyx_tuple__243 __pyx_mstate_global->__pyx_tuple__243 -#define __pyx_tuple__247 __pyx_mstate_global->__pyx_tuple__247 +#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__258 __pyx_mstate_global->__pyx_tuple__258 -#define __pyx_tuple__261 __pyx_mstate_global->__pyx_tuple__261 -#define __pyx_tuple__264 __pyx_mstate_global->__pyx_tuple__264 +#define __pyx_tuple__263 __pyx_mstate_global->__pyx_tuple__263 #define __pyx_tuple__267 __pyx_mstate_global->__pyx_tuple__267 -#define __pyx_tuple__270 __pyx_mstate_global->__pyx_tuple__270 -#define __pyx_tuple__272 __pyx_mstate_global->__pyx_tuple__272 -#define __pyx_tuple__274 __pyx_mstate_global->__pyx_tuple__274 +#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__287 __pyx_mstate_global->__pyx_tuple__287 -#define __pyx_tuple__289 __pyx_mstate_global->__pyx_tuple__289 +#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__291 __pyx_mstate_global->__pyx_tuple__291 -#define __pyx_tuple__293 __pyx_mstate_global->__pyx_tuple__293 -#define __pyx_tuple__295 __pyx_mstate_global->__pyx_tuple__295 -#define __pyx_tuple__297 __pyx_mstate_global->__pyx_tuple__297 -#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 +#define __pyx_tuple__294 __pyx_mstate_global->__pyx_tuple__294 +#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__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_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 -#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 +#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 +#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__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 +#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 -#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 +#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 -#define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 +#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 -#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 +#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__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 -#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 +#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__55 __pyx_mstate_global->__pyx_codeobj__55 @@ -8607,168 +9005,184 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #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__65 __pyx_mstate_global->__pyx_codeobj__65 -#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 -#define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69 +#define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 +#define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 +#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__75 __pyx_mstate_global->__pyx_codeobj__75 -#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 -#define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 +#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__80 __pyx_mstate_global->__pyx_codeobj__80 #define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81 +#define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82 #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__88 __pyx_mstate_global->__pyx_codeobj__88 +#define __pyx_codeobj__87 __pyx_mstate_global->__pyx_codeobj__87 +#define __pyx_codeobj__89 __pyx_mstate_global->__pyx_codeobj__89 #define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 -#define __pyx_codeobj__91 __pyx_mstate_global->__pyx_codeobj__91 #define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 -#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__106 __pyx_mstate_global->__pyx_codeobj__106 +#define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105 #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__113 __pyx_mstate_global->__pyx_codeobj__113 -#define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 +#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 +#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__120 __pyx_mstate_global->__pyx_codeobj__120 #define __pyx_codeobj__121 __pyx_mstate_global->__pyx_codeobj__121 -#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122 -#define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124 +#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123 +#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125 #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__130 __pyx_mstate_global->__pyx_codeobj__130 +#define __pyx_codeobj__129 __pyx_mstate_global->__pyx_codeobj__129 #define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131 -#define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132 #define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133 #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__147 __pyx_mstate_global->__pyx_codeobj__147 -#define __pyx_codeobj__148 __pyx_mstate_global->__pyx_codeobj__148 +#define __pyx_codeobj__146 __pyx_mstate_global->__pyx_codeobj__146 #define __pyx_codeobj__149 __pyx_mstate_global->__pyx_codeobj__149 #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__155 __pyx_mstate_global->__pyx_codeobj__155 +#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__159 __pyx_mstate_global->__pyx_codeobj__159 +#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__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__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__174 __pyx_mstate_global->__pyx_codeobj__174 #define __pyx_codeobj__176 __pyx_mstate_global->__pyx_codeobj__176 -#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__181 __pyx_mstate_global->__pyx_codeobj__181 -#define __pyx_codeobj__183 __pyx_mstate_global->__pyx_codeobj__183 +#define __pyx_codeobj__182 __pyx_mstate_global->__pyx_codeobj__182 #define __pyx_codeobj__184 __pyx_mstate_global->__pyx_codeobj__184 -#define __pyx_codeobj__185 __pyx_mstate_global->__pyx_codeobj__185 +#define __pyx_codeobj__186 __pyx_mstate_global->__pyx_codeobj__186 #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__200 __pyx_mstate_global->__pyx_codeobj__200 #define __pyx_codeobj__201 __pyx_mstate_global->__pyx_codeobj__201 #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__214 __pyx_mstate_global->__pyx_codeobj__214 -#define __pyx_codeobj__216 __pyx_mstate_global->__pyx_codeobj__216 -#define __pyx_codeobj__218 __pyx_mstate_global->__pyx_codeobj__218 +#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__233 __pyx_mstate_global->__pyx_codeobj__233 #define __pyx_codeobj__235 __pyx_mstate_global->__pyx_codeobj__235 +#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__242 __pyx_mstate_global->__pyx_codeobj__242 -#define __pyx_codeobj__244 __pyx_mstate_global->__pyx_codeobj__244 +#define __pyx_codeobj__243 __pyx_mstate_global->__pyx_codeobj__243 #define __pyx_codeobj__245 __pyx_mstate_global->__pyx_codeobj__245 -#define __pyx_codeobj__246 __pyx_mstate_global->__pyx_codeobj__246 -#define __pyx_codeobj__248 __pyx_mstate_global->__pyx_codeobj__248 +#define __pyx_codeobj__247 __pyx_mstate_global->__pyx_codeobj__247 #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__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__263 __pyx_mstate_global->__pyx_codeobj__263 +#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__269 __pyx_mstate_global->__pyx_codeobj__269 +#define __pyx_codeobj__270 __pyx_mstate_global->__pyx_codeobj__270 #define __pyx_codeobj__271 __pyx_mstate_global->__pyx_codeobj__271 +#define __pyx_codeobj__272 __pyx_mstate_global->__pyx_codeobj__272 #define __pyx_codeobj__273 __pyx_mstate_global->__pyx_codeobj__273 +#define __pyx_codeobj__274 __pyx_mstate_global->__pyx_codeobj__274 #define __pyx_codeobj__275 __pyx_mstate_global->__pyx_codeobj__275 -#define __pyx_codeobj__276 __pyx_mstate_global->__pyx_codeobj__276 #define __pyx_codeobj__277 __pyx_mstate_global->__pyx_codeobj__277 #define __pyx_codeobj__279 __pyx_mstate_global->__pyx_codeobj__279 -#define __pyx_codeobj__280 __pyx_mstate_global->__pyx_codeobj__280 #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__288 __pyx_mstate_global->__pyx_codeobj__288 +#define __pyx_codeobj__287 __pyx_mstate_global->__pyx_codeobj__287 +#define __pyx_codeobj__289 __pyx_mstate_global->__pyx_codeobj__289 #define __pyx_codeobj__290 __pyx_mstate_global->__pyx_codeobj__290 #define __pyx_codeobj__292 __pyx_mstate_global->__pyx_codeobj__292 -#define __pyx_codeobj__294 __pyx_mstate_global->__pyx_codeobj__294 -#define __pyx_codeobj__296 __pyx_mstate_global->__pyx_codeobj__296 -#define __pyx_codeobj__298 __pyx_mstate_global->__pyx_codeobj__298 +#define __pyx_codeobj__293 __pyx_mstate_global->__pyx_codeobj__293 +#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__303 __pyx_mstate_global->__pyx_codeobj__303 +#define __pyx_codeobj__304 __pyx_mstate_global->__pyx_codeobj__304 +#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__313 __pyx_mstate_global->__pyx_codeobj__313 +#define __pyx_codeobj__315 __pyx_mstate_global->__pyx_codeobj__315 +#define __pyx_codeobj__317 __pyx_mstate_global->__pyx_codeobj__317 +#define __pyx_codeobj__319 __pyx_mstate_global->__pyx_codeobj__319 +#define __pyx_codeobj__321 __pyx_mstate_global->__pyx_codeobj__321 +#define __pyx_codeobj__323 __pyx_mstate_global->__pyx_codeobj__323 /* #### Code section: module_code ### */ -/* "collisions.py":48 +/* "collisions.py":49 * ] * * def checkForPygame(): # <<<<<<<<<<<<<< @@ -8802,33 +9216,33 @@ static PyObject *__pyx_pf_10collisions_checkForPygame(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("checkForPygame", 1); - /* "collisions.py":49 + /* "collisions.py":50 * * def checkForPygame(): * if pygame is None: # <<<<<<<<<<<<<< * raise ImportError( * 'Pygame is not installed, so you cannot use this function without it!' */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pygame); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pygame); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { - /* "collisions.py":50 + /* "collisions.py":51 * def checkForPygame(): * if pygame is None: * raise ImportError( # <<<<<<<<<<<<<< * 'Pygame is not installed, so you cannot use this function without it!' * ) */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 50, __pyx_L1_error) + __PYX_ERR(0, 51, __pyx_L1_error) - /* "collisions.py":49 + /* "collisions.py":50 * * def checkForPygame(): * if pygame is None: # <<<<<<<<<<<<<< @@ -8837,7 +9251,7 @@ static PyObject *__pyx_pf_10collisions_checkForPygame(CYTHON_UNUSED PyObject *__ */ } - /* "collisions.py":48 + /* "collisions.py":49 * ] * * def checkForPygame(): # <<<<<<<<<<<<<< @@ -8858,7 +9272,7 @@ static PyObject *__pyx_pf_10collisions_checkForPygame(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":54 +/* "collisions.py":55 * ) * * def rotate(origin: pointLike, point: pointLike, angle: Number) -> pointLike: # <<<<<<<<<<<<<< @@ -8926,7 +9340,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -8934,9 +9348,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("rotate", 1, 3, 3, 1); __PYX_ERR(0, 54, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotate", 1, 3, 3, 1); __PYX_ERR(0, 55, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -8944,14 +9358,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("rotate", 1, 3, 3, 2); __PYX_ERR(0, 54, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotate", 1, 3, 3, 2); __PYX_ERR(0, 55, __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, "rotate") < 0)) __PYX_ERR(0, 54, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rotate") < 0)) __PYX_ERR(0, 55, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -8966,7 +9380,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rotate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 55, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9012,16 +9426,16 @@ static PyObject *__pyx_pf_10collisions_2rotate(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_RefNannySetupContext("rotate", 0); __Pyx_INCREF(__pyx_v_angle); - /* "collisions.py":67 + /* "collisions.py":68 * pointLike: The rotated point * """ * angle = math.radians(angle) # <<<<<<<<<<<<<< * cos = math.cos(angle) * sin = math.sin(angle) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __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, 67, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -9042,23 +9456,23 @@ static PyObject *__pyx_pf_10collisions_2rotate(CYTHON_UNUSED PyObject *__pyx_sel 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, 67, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_angle, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":68 + /* "collisions.py":69 * """ * angle = math.radians(angle) * cos = math.cos(angle) # <<<<<<<<<<<<<< * sin = math.sin(angle) * ydiff = (point[1] - origin[1]) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __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, 68, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -9079,23 +9493,23 @@ static PyObject *__pyx_pf_10collisions_2rotate(CYTHON_UNUSED PyObject *__pyx_sel PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_angle}; __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, 68, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_cos = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":69 + /* "collisions.py":70 * angle = math.radians(angle) * cos = math.cos(angle) * sin = math.sin(angle) # <<<<<<<<<<<<<< * ydiff = (point[1] - origin[1]) * xdiff = (point[0] - origin[0]) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __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, 69, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -9116,98 +9530,98 @@ static PyObject *__pyx_pf_10collisions_2rotate(CYTHON_UNUSED PyObject *__pyx_sel 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, 69, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_sin = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":70 + /* "collisions.py":71 * cos = math.cos(angle) * sin = math.sin(angle) * ydiff = (point[1] - origin[1]) # <<<<<<<<<<<<<< * xdiff = (point[0] - origin[0]) * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_origin, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_origin, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __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, 70, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __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_v_ydiff = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":71 + /* "collisions.py":72 * sin = math.sin(angle) * ydiff = (point[1] - origin[1]) * xdiff = (point[0] - origin[0]) # <<<<<<<<<<<<<< * * qx = origin[0] + cos * xdiff - sin * ydiff */ - __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, 71, __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, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_origin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_origin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __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, 71, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __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_xdiff = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":73 + /* "collisions.py":74 * xdiff = (point[0] - origin[0]) * * qx = origin[0] + cos * xdiff - sin * ydiff # <<<<<<<<<<<<<< * qy = origin[1] + sin * xdiff + cos * ydiff * return qx, qy */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_origin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_origin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_cos, __pyx_v_xdiff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_cos, __pyx_v_xdiff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __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 = PyNumber_Multiply(__pyx_v_sin, __pyx_v_ydiff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_sin, __pyx_v_ydiff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __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, 73, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __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_qx = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":74 + /* "collisions.py":75 * * qx = origin[0] + cos * xdiff - sin * ydiff * qy = origin[1] + sin * xdiff + cos * ydiff # <<<<<<<<<<<<<< * return qx, qy * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_origin, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_origin, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_sin, __pyx_v_xdiff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_sin, __pyx_v_xdiff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __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 = PyNumber_Multiply(__pyx_v_cos, __pyx_v_ydiff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_cos, __pyx_v_ydiff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __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, 74, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __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_qy = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":75 + /* "collisions.py":76 * qx = origin[0] + cos * xdiff - sin * ydiff * qy = origin[1] + sin * xdiff + cos * ydiff * return qx, qy # <<<<<<<<<<<<<< @@ -9215,19 +9629,19 @@ static PyObject *__pyx_pf_10collisions_2rotate(CYTHON_UNUSED PyObject *__pyx_sel * def rotateBy0(point: pointLike, angle: Number) -> pointLike: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_qx); __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_qx)) __PYX_ERR(0, 75, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_qx)) __PYX_ERR(0, 76, __pyx_L1_error); __Pyx_INCREF(__pyx_v_qy); __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_qy)) __PYX_ERR(0, 75, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_qy)) __PYX_ERR(0, 76, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":54 + /* "collisions.py":55 * ) * * def rotate(origin: pointLike, point: pointLike, angle: Number) -> pointLike: # <<<<<<<<<<<<<< @@ -9255,7 +9669,7 @@ static PyObject *__pyx_pf_10collisions_2rotate(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":77 +/* "collisions.py":78 * return qx, qy * * def rotateBy0(point: pointLike, angle: Number) -> pointLike: # <<<<<<<<<<<<<< @@ -9320,7 +9734,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -9328,14 +9742,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("rotateBy0", 1, 2, 2, 1); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotateBy0", 1, 2, 2, 1); __PYX_ERR(0, 78, __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, "rotateBy0") < 0)) __PYX_ERR(0, 77, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rotateBy0") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -9348,7 +9762,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rotateBy0", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotateBy0", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 78, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9392,16 +9806,16 @@ static PyObject *__pyx_pf_10collisions_4rotateBy0(CYTHON_UNUSED PyObject *__pyx_ __Pyx_RefNannySetupContext("rotateBy0", 0); __Pyx_INCREF(__pyx_v_angle); - /* "collisions.py":89 + /* "collisions.py":90 * pointLike: The rotated point * """ * angle = math.radians(angle) # <<<<<<<<<<<<<< * cos = math.cos(angle) * sin = math.sin(angle) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __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, 89, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -9422,23 +9836,23 @@ static PyObject *__pyx_pf_10collisions_4rotateBy0(CYTHON_UNUSED PyObject *__pyx_ 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, 89, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_angle, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":90 + /* "collisions.py":91 * """ * angle = math.radians(angle) * cos = math.cos(angle) # <<<<<<<<<<<<<< * sin = math.sin(angle) * qx = cos * point[0] - sin * point[1] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __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, 90, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -9459,23 +9873,23 @@ static PyObject *__pyx_pf_10collisions_4rotateBy0(CYTHON_UNUSED PyObject *__pyx_ PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_angle}; __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, 90, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_cos = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":91 + /* "collisions.py":92 * angle = math.radians(angle) * cos = math.cos(angle) * sin = math.sin(angle) # <<<<<<<<<<<<<< * qx = cos * point[0] - sin * point[1] * qy = sin * point[0] + cos * point[1] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __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, 91, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -9496,62 +9910,62 @@ static PyObject *__pyx_pf_10collisions_4rotateBy0(CYTHON_UNUSED PyObject *__pyx_ 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, 91, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_sin = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":92 + /* "collisions.py":93 * cos = math.cos(angle) * sin = math.sin(angle) * qx = cos * point[0] - sin * point[1] # <<<<<<<<<<<<<< * qy = sin * point[0] + cos * point[1] * return qx, qy */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_cos, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_cos, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Multiply(__pyx_v_sin, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_sin, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __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, 92, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __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_qx = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":93 + /* "collisions.py":94 * sin = math.sin(angle) * qx = cos * point[0] - sin * point[1] * qy = sin * point[0] + cos * point[1] # <<<<<<<<<<<<<< * return qx, qy * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Multiply(__pyx_v_sin, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_sin, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_cos, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_cos, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __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_qy = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":94 + /* "collisions.py":95 * qx = cos * point[0] - sin * point[1] * qy = sin * point[0] + cos * point[1] * return qx, qy # <<<<<<<<<<<<<< @@ -9559,19 +9973,19 @@ static PyObject *__pyx_pf_10collisions_4rotateBy0(CYTHON_UNUSED PyObject *__pyx_ * def direction(fromPoint: pointLike, toPoint: pointLike) -> Number: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_qx); __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_qx)) __PYX_ERR(0, 94, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_qx)) __PYX_ERR(0, 95, __pyx_L1_error); __Pyx_INCREF(__pyx_v_qy); __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_qy)) __PYX_ERR(0, 94, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_qy)) __PYX_ERR(0, 95, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":77 + /* "collisions.py":78 * return qx, qy * * def rotateBy0(point: pointLike, angle: Number) -> pointLike: # <<<<<<<<<<<<<< @@ -9597,7 +10011,7 @@ static PyObject *__pyx_pf_10collisions_4rotateBy0(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "collisions.py":96 +/* "collisions.py":97 * return qx, qy * * def direction(fromPoint: pointLike, toPoint: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -9662,7 +10076,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -9670,14 +10084,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 2, 2, 1); __PYX_ERR(0, 96, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direction", 1, 2, 2, 1); __PYX_ERR(0, 97, __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, 96, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "direction") < 0)) __PYX_ERR(0, 97, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -9690,7 +10104,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direction", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 96, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direction", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 97, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9732,7 +10146,7 @@ static PyObject *__pyx_pf_10collisions_6direction(CYTHON_UNUSED PyObject *__pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("direction", 1); - /* "collisions.py":107 + /* "collisions.py":108 * Number: The direction in radians OF `toPoint` FROM `fromPoint` * """ * return math.atan2(toPoint[1]-fromPoint[1], toPoint[0]-fromPoint[0]) # <<<<<<<<<<<<<< @@ -9740,24 +10154,24 @@ static PyObject *__pyx_pf_10collisions_6direction(CYTHON_UNUSED PyObject *__pyx_ * def pointOnCircle(angle: Number, strength: Number=1) -> pointLike: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __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, 107, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_toPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_toPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fromPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fromPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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_toPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_toPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fromPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fromPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 108, __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; @@ -9781,7 +10195,7 @@ static PyObject *__pyx_pf_10collisions_6direction(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_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -9789,7 +10203,7 @@ static PyObject *__pyx_pf_10collisions_6direction(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":96 + /* "collisions.py":97 * return qx, qy * * def direction(fromPoint: pointLike, toPoint: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -9813,7 +10227,7 @@ static PyObject *__pyx_pf_10collisions_6direction(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "collisions.py":109 +/* "collisions.py":110 * return math.atan2(toPoint[1]-fromPoint[1], toPoint[0]-fromPoint[0]) * * def pointOnCircle(angle: Number, strength: Number=1) -> pointLike: # <<<<<<<<<<<<<< @@ -9879,19 +10293,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __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_strength); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __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, "pointOnCircle") < 0)) __PYX_ERR(0, 109, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pointOnCircle") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -9907,7 +10321,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pointOnCircle", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 109, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pointOnCircle", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9947,17 +10361,17 @@ static PyObject *__pyx_pf_10collisions_8pointOnCircle(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointOnCircle", 1); - /* "collisions.py":120 + /* "collisions.py":121 * pointLike: The point on the unit circle at angle `angle` * strength * """ * return math.cos(angle)*strength, math.sin(angle)*strength # <<<<<<<<<<<<<< * - * class ShpGroups(Enum): + * class ShpGroups(IntEnum): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -9978,16 +10392,16 @@ static PyObject *__pyx_pf_10collisions_8pointOnCircle(CYTHON_UNUSED PyObject *__ 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, 120, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_strength); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_strength); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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, 120, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -10008,26 +10422,26 @@ static PyObject *__pyx_pf_10collisions_8pointOnCircle(CYTHON_UNUSED PyObject *__ PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_angle}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __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, 120, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_v_strength); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_v_strength); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __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, 120, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":109 + /* "collisions.py":110 * return math.atan2(toPoint[1]-fromPoint[1], toPoint[0]-fromPoint[0]) * * def pointOnCircle(angle: Number, strength: Number=1) -> pointLike: # <<<<<<<<<<<<<< @@ -10049,10 +10463,10 @@ static PyObject *__pyx_pf_10collisions_8pointOnCircle(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":133 - * """A group of other shapes""" +/* "collisions.py":150 + * Polygon = -9 * - * def checkShpType(shape: Union['Shape', 'Shapes'], typs: Union[Type, ShpGroups, Iterable[Union[Type, ShpGroups]]]) -> bool: # <<<<<<<<<<<<<< + * def checkShpType(shape: Union['Shape', 'Shapes'], *typs: Union[ShpTyps, ShpGroups]) -> bool: # <<<<<<<<<<<<<< * """ * Checks to see if a shape is of a certain type or group. */ @@ -10065,7 +10479,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_10checkShpType, "\n Checks to see if a shape is of a certain type or group.\n\n Args:\n shape (Shape or Shapes]): The input shape or shapes to check the type of.\n typs (ShpTypes, ShpGroups, or an Iterable[ShpTypes or ShpGroups]): The shape type(s) &/or group(s) to check for.\n\n Returns:\n bool: Whether the shape is of the specified type(s) or group(s).\n "); +PyDoc_STRVAR(__pyx_doc_10collisions_10checkShpType, "\n Checks to see if a shape is of a certain type or group.\n\n This checks if it is of ANY of the specified types or groups.\n\n Args:\n shape (Shape or Shapes]): The input shape or shapes to check the type of.\n *typs (Iterable[ShpTypes | ShpGroups]): The shape type(s) &/or group(s) to check for.\n\n Returns:\n bool: Whether the shape is of the specified type(s) or group(s).\n "); static PyMethodDef __pyx_mdef_10collisions_11checkShpType = {"checkShpType", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11checkShpType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_10checkShpType}; static PyObject *__pyx_pw_10collisions_11checkShpType(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -10080,7 +10494,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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; @@ -10095,17 +10509,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + __pyx_v_typs = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs); + if (unlikely(!__pyx_v_typs)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_typs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_typs,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; + default: 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) { @@ -10114,35 +10532,24 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __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_typs)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("checkShpType", 1, 2, 2, 1); __PYX_ERR(0, 133, __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, "checkShpType") < 0)) __PYX_ERR(0, 133, __pyx_L3_error) + 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) } - } 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_shape = values[0]; - __pyx_v_typs = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("checkShpType", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 133, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkShpType", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 150, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10152,6 +10559,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } + __Pyx_DECREF(__pyx_v_typs); __pyx_v_typs = 0; __Pyx_AddTraceback("collisions.checkShpType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; @@ -10159,6 +10567,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10collisions_10checkShpType(__pyx_self, __pyx_v_shape, __pyx_v_typs); /* function exit code */ + __Pyx_DECREF(__pyx_v_typs); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -10170,212 +10579,81 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_10checkShpType(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_typs) { - PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_typ_set = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); - PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("checkShpType", 0); - __Pyx_INCREF(__pyx_v_typs); + __Pyx_RefNannySetupContext("checkShpType", 1); - /* "collisions.py":144 + /* "collisions.py":163 * bool: Whether the shape is of the specified type(s) or group(s). * """ - * if not isinstance(typs, Iterable): # <<<<<<<<<<<<<< - * typs = [typs] - * if not isinstance(shape, Shape): + * typ_set = set(typs) # <<<<<<<<<<<<<< + * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: + * return True */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Iterable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = PySet_New(__pyx_v_typs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_typs, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (!__pyx_t_2); - if (__pyx_t_3) { - - /* "collisions.py":145 - * """ - * if not isinstance(typs, Iterable): - * typs = [typs] # <<<<<<<<<<<<<< - * if not isinstance(shape, Shape): - * return False - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_typs); - __Pyx_GIVEREF(__pyx_v_typs); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_typs)) __PYX_ERR(0, 145, __pyx_L1_error); - __Pyx_DECREF_SET(__pyx_v_typs, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_typ_set = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "collisions.py":144 - * bool: Whether the shape is of the specified type(s) or group(s). + /* "collisions.py":164 * """ - * if not isinstance(typs, Iterable): # <<<<<<<<<<<<<< - * typs = [typs] - * if not isinstance(shape, Shape): - */ - } - - /* "collisions.py":146 - * if not isinstance(typs, Iterable): - * typs = [typs] - * if not isinstance(shape, Shape): # <<<<<<<<<<<<<< - * return False - * for i in typs: + * typ_set = set(typs) + * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: # <<<<<<<<<<<<<< + * return True + * return False */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_IsInstance(__pyx_v_shape, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 146, __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, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = (!__pyx_t_3); - if (__pyx_t_2) { - - /* "collisions.py":147 - * typs = [typs] - * if not isinstance(shape, Shape): - * return False # <<<<<<<<<<<<<< - * for i in typs: - * if i in shape.GROUPS or type(shape) is i: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "collisions.py":146 - * if not isinstance(typs, Iterable): - * typs = [typs] - * if not isinstance(shape, Shape): # <<<<<<<<<<<<<< - * return False - * for i in typs: - */ - } - - /* "collisions.py":148 - * if not isinstance(shape, Shape): - * return False - * for i in typs: # <<<<<<<<<<<<<< - * if i in shape.GROUPS or type(shape) is i: - * return True - */ - if (likely(PyList_CheckExact(__pyx_v_typs)) || PyTuple_CheckExact(__pyx_v_typs)) { - __pyx_t_1 = __pyx_v_typs; __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = 0; - __pyx_t_5 = NULL; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_4) { } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_typs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; } - for (;;) { - if (likely(!__pyx_t_5)) { - 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, 148, __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_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 148, __pyx_L1_error) - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #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, 148, __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_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 148, __pyx_L1_error) - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } - } else { - __pyx_t_6 = __pyx_t_5(__pyx_t_1); - 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, 148, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_6); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); - __pyx_t_6 = 0; - - /* "collisions.py":149 - * return False - * for i in typs: - * if i in shape.GROUPS or type(shape) is i: # <<<<<<<<<<<<<< - * return True - * return False - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_GROUPS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_i, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L8_bool_binop_done; - } - __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_shape)) == __pyx_v_i); - __pyx_t_2 = __pyx_t_3; - __pyx_L8_bool_binop_done:; - if (__pyx_t_2) { + __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_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_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":150 - * for i in typs: - * if i in shape.GROUPS or type(shape) is i: - * return True # <<<<<<<<<<<<<< + /* "collisions.py":165 + * typ_set = set(typs) + * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: + * return True # <<<<<<<<<<<<<< * return False * */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; - /* "collisions.py":149 - * return False - * for i in typs: - * if i in shape.GROUPS or type(shape) is i: # <<<<<<<<<<<<<< - * return True + /* "collisions.py":164 + * """ + * typ_set = set(typs) + * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: # <<<<<<<<<<<<<< + * return True * return False - */ - } - - /* "collisions.py":148 - * if not isinstance(shape, Shape): - * return False - * for i in typs: # <<<<<<<<<<<<<< - * if i in shape.GROUPS or type(shape) is i: - * return True */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":151 - * if i in shape.GROUPS or type(shape) is i: - * return True + /* "collisions.py":166 + * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: + * return True * return False # <<<<<<<<<<<<<< * * def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: @@ -10385,10 +10663,10 @@ static PyObject *__pyx_pf_10collisions_10checkShpType(CYTHON_UNUSED PyObject *__ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":133 - * """A group of other shapes""" + /* "collisions.py":150 + * Polygon = -9 * - * def checkShpType(shape: Union['Shape', 'Shapes'], typs: Union[Type, ShpGroups, Iterable[Union[Type, ShpGroups]]]) -> bool: # <<<<<<<<<<<<<< + * def checkShpType(shape: Union['Shape', 'Shapes'], *typs: Union[ShpTyps, ShpGroups]) -> bool: # <<<<<<<<<<<<<< * """ * Checks to see if a shape is of a certain type or group. */ @@ -10396,18 +10674,17 @@ static PyObject *__pyx_pf_10collisions_10checkShpType(CYTHON_UNUSED PyObject *__ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("collisions.checkShpType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_typs); + __Pyx_XDECREF(__pyx_v_typ_set); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":153 +/* "collisions.py":168 * return False * * def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: # <<<<<<<<<<<<<< @@ -10469,12 +10746,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 168, __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, 153, __pyx_L3_error) + 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) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10485,7 +10762,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, 153, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("shapelyToColl", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 168, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10535,16 +10812,16 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shapelyToColl", 1); - /* "collisions.py":163 + /* "collisions.py":178 * 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, 163, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapely); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __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, 163, __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, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -10565,15 +10842,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, 163, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __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, 163, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":164 + /* "collisions.py":179 * """ * if shapely.is_empty(shapelyShape): * return NoShape() # <<<<<<<<<<<<<< @@ -10581,7 +10858,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, 164, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -10601,7 +10878,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, 164, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -10609,7 +10886,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":163 + /* "collisions.py":178 * Shape | Shapes: The converted shape. * """ * if shapely.is_empty(shapelyShape): # <<<<<<<<<<<<<< @@ -10618,23 +10895,23 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":165 + /* "collisions.py":180 * 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, 165, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __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, 165, __pyx_L1_error) + __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_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, 165, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "collisions.py":166 + /* "collisions.py":181 * return NoShape() * if isinstance(shapelyShape, shapelyGeom.Point): * return Point(shapelyShape.x, shapelyShape.y) # <<<<<<<<<<<<<< @@ -10642,11 +10919,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, 166, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __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, 166, __pyx_L1_error) + __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_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, 166, __pyx_L1_error) + __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_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; @@ -10668,7 +10945,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, 166, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -10676,7 +10953,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":165 + /* "collisions.py":180 * if shapely.is_empty(shapelyShape): * return NoShape() * if isinstance(shapelyShape, shapelyGeom.Point): # <<<<<<<<<<<<<< @@ -10685,23 +10962,23 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":167 + /* "collisions.py":182 * 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, 167, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __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, 167, __pyx_L1_error) + __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_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, 167, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":168 + /* "collisions.py":183 * return Point(shapelyShape.x, shapelyShape.y) * if isinstance(shapelyShape, shapelyGeom.LineString): * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.coords.xy]))) # <<<<<<<<<<<<<< @@ -10709,17 +10986,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, 168, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShapeCombiner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __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, 168, __pyx_L1_error) + __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_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, 168, __pyx_L8_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __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, 168, __pyx_L8_error) + __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_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, 168, __pyx_L8_error) + __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_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)) { @@ -10727,9 +11004,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, 168, __pyx_L8_error) + __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_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L8_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 183, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -10738,28 +11015,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, 168, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 183, __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, 168, __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, 183, __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, 168, __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, 183, __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, 168, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 183, __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, 168, __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, 183, __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, 168, __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, 183, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -10769,7 +11046,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, 168, __pyx_L8_error) + else __PYX_ERR(0, 183, __pyx_L8_error) } break; } @@ -10777,9 +11054,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, 168, __pyx_L8_error) + __pyx_t_2 = PySequence_List(__pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 168, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 183, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -10790,19 +11067,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, 168, __pyx_L1_error) + __pyx_t_6 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __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, 168, __pyx_L1_error) + __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_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, 168, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __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, 168, __pyx_L1_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __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, 168, __pyx_L1_error) + __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_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10810,7 +11087,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_6 = 0; goto __pyx_L0; - /* "collisions.py":167 + /* "collisions.py":182 * if isinstance(shapelyShape, shapelyGeom.Point): * return Point(shapelyShape.x, shapelyShape.y) * if isinstance(shapelyShape, shapelyGeom.LineString): # <<<<<<<<<<<<<< @@ -10819,23 +11096,23 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":169 + /* "collisions.py":184 * 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, 169, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __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, 169, __pyx_L1_error) + __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_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, 169, __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":170 + /* "collisions.py":185 * 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]))) # <<<<<<<<<<<<<< @@ -10843,20 +11120,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, 170, __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pointsToShape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error) + __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_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, 170, __pyx_L16_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __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, 170, __pyx_L16_error) + __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_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, 170, __pyx_L16_error) + __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_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, 170, __pyx_L16_error) + __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_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)) { @@ -10864,9 +11141,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, 170, __pyx_L16_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 170, __pyx_L16_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 185, __pyx_L16_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -10875,28 +11152,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, 170, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __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, 170, __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, 185, __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, 170, __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, 185, __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, 170, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __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, 170, __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, 185, __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, 170, __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, 185, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -10906,7 +11183,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, 170, __pyx_L16_error) + else __PYX_ERR(0, 185, __pyx_L16_error) } break; } @@ -10914,9 +11191,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, 170, __pyx_L16_error) + __pyx_t_3 = PySequence_List(__pyx_8genexpr1__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 170, __pyx_L16_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 185, __pyx_L16_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -10927,19 +11204,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, 170, __pyx_L1_error) + __pyx_t_2 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __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, 170, __pyx_L1_error) + __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_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, 170, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __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, 170, __pyx_L1_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __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, 170, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10947,7 +11224,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":169 + /* "collisions.py":184 * if isinstance(shapelyShape, shapelyGeom.LineString): * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.coords.xy]))) * if isinstance(shapelyShape, shapelyGeom.Polygon): # <<<<<<<<<<<<<< @@ -10956,31 +11233,31 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":171 + /* "collisions.py":186 * 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') */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __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, 171, __pyx_L1_error) + __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_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, 171, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __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, 171, __pyx_L1_error) + __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_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, 171, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __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, 171, __pyx_L1_error) + __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_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, 171, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __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, 171, __pyx_L1_error) + __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_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = PyObject_IsInstance(__pyx_v_shapelyShape, __pyx_t_1); @@ -11010,7 +11287,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":172 + /* "collisions.py":187 * 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]) # <<<<<<<<<<<<<< @@ -11018,21 +11295,21 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __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, 172, __pyx_L28_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __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, 172, __pyx_L28_error) + __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_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, 172, __pyx_L28_error) + __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_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L28_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 187, __pyx_L28_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -11041,28 +11318,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, 172, __pyx_L28_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 187, __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, 172, __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, 187, __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, 172, __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, 187, __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, 172, __pyx_L28_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 187, __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, 172, __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, 187, __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, 172, __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, 187, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -11072,7 +11349,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, 172, __pyx_L28_error) + else __PYX_ERR(0, 187, __pyx_L28_error) } break; } @@ -11080,7 +11357,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, 172, __pyx_L28_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -11100,11 +11377,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, 172, __pyx_L28_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __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, 172, __pyx_L28_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 187, __pyx_L28_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -11115,10 +11392,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, 172, __pyx_L1_error) + __pyx_t_7 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __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, 172, __pyx_L1_error) + __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_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -11126,7 +11403,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_6 = 0; goto __pyx_L0; - /* "collisions.py":171 + /* "collisions.py":186 * 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)): # <<<<<<<<<<<<<< @@ -11135,14 +11412,14 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":173 + /* "collisions.py":188 * 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') # <<<<<<<<<<<<<< * * def collToShapely(collShape: 'Shape') -> shapelyGeom.base.BaseGeometry: */ - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error) + __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; @@ -11150,7 +11427,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __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, 173, __pyx_L1_error) + __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); @@ -11161,17 +11438,17 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __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, 173, __pyx_L1_error) + __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_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, 173, __pyx_L1_error) + __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, 173, __pyx_L1_error) + __PYX_ERR(0, 188, __pyx_L1_error) - /* "collisions.py":153 + /* "collisions.py":168 * return False * * def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: # <<<<<<<<<<<<<< @@ -11198,7 +11475,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":175 +/* "collisions.py":190 * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') * * def collToShapely(collShape: 'Shape') -> shapelyGeom.base.BaseGeometry: # <<<<<<<<<<<<<< @@ -11260,12 +11537,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 190, __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, 175, __pyx_L3_error) + 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) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -11276,7 +11553,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, 175, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collToShapely", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 190, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11325,25 +11602,28 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collToShapely", 1); - /* "collisions.py":185 + /* "collisions.py":200 * shapely.geometry.base.BaseGeometry: The converted shape. * """ - * if checkShpType(collShape, Point): # <<<<<<<<<<<<<< + * if checkShpType(collShape, ShpTyps.Point): # <<<<<<<<<<<<<< * return shapelyGeom.Point(collShape.x, collShape.y) - * if checkShpType(collShape, Line): + * if checkShpType(collShape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __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, 185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __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_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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -11351,170 +11631,491 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_collShape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_collShape, __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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __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) __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, 185, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":186 + /* "collisions.py":201 * """ - * if checkShpType(collShape, Point): + * if checkShpType(collShape, ShpTyps.Point): * return shapelyGeom.Point(collShape.x, collShape.y) # <<<<<<<<<<<<<< - * if checkShpType(collShape, Line): + * if checkShpType(collShape, ShpTyps.Line): * 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, 186, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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_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, 186, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + 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_3); + 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[3] = {__pyx_t_7, __pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_2, __pyx_t_3}; + __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; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __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":185 + /* "collisions.py":200 * shapely.geometry.base.BaseGeometry: The converted shape. * """ - * if checkShpType(collShape, Point): # <<<<<<<<<<<<<< + * if checkShpType(collShape, ShpTyps.Point): # <<<<<<<<<<<<<< * return shapelyGeom.Point(collShape.x, collShape.y) - * if checkShpType(collShape, Line): + * if checkShpType(collShape, ShpTyps.Line): */ } - /* "collisions.py":187 - * if checkShpType(collShape, Point): + /* "collisions.py":202 + * if checkShpType(collShape, ShpTyps.Point): * return shapelyGeom.Point(collShape.x, collShape.y) - * if checkShpType(collShape, Line): # <<<<<<<<<<<<<< + * if checkShpType(collShape, ShpTyps.Line): # <<<<<<<<<<<<<< * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) - * if checkShpType(collShape, Circle): + * if checkShpType(collShape, ShpTyps.Circle): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __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_GOTREF(__pyx_t_2); + __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_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_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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_collShape, __pyx_t_4}; - __pyx_t_1 = __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_collShape, __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, 202, __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":188 + /* "collisions.py":203 * return shapelyGeom.Point(collShape.x, collShape.y) - * if checkShpType(collShape, Line): + * if checkShpType(collShape, ShpTyps.Line): * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) # <<<<<<<<<<<<<< - * if checkShpType(collShape, Circle): + * if checkShpType(collShape, ShpTyps.Circle): * return shapelyGeom.Point(collShape.x, collShape.y).buffer(collShape.r) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_LineString); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shapelyGeom); 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 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __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, 188, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) + __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_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_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, 188, __pyx_L1_error) + __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_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_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __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, 188, __pyx_L1_error); + __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_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); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error); - __pyx_t_2 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7)) __PYX_ERR(0, 203, __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, 188, __pyx_L1_error) + __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_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, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __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_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, 188, __pyx_L1_error) + __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_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, 188, __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, 203, __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, 188, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __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, 188, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 188, __pyx_L1_error); - __pyx_t_2 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 203, __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, 188, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __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, 188, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error); - __pyx_t_3 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error); + __pyx_t_4 = 0; __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_8}; + __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) + __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":202 + * 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): + */ + } + + /* "collisions.py":204 + * 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_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_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_GOTREF(__pyx_t_7); + __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_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[3] = {__pyx_t_8, __pyx_v_collShape, __pyx_t_7}; + __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) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "collisions.py":205 + * 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): + * 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_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_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_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_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(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[3] = {__pyx_t_3, __pyx_t_7, __pyx_t_4}; + __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_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) + __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_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_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; + __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) + __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":204 + * 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): + */ + } + + /* "collisions.py":206 + * 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_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_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_GOTREF(__pyx_t_4); + __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_8))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_collShape, __pyx_t_4}; + __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) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "collisions.py":207 + * 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): + * 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_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_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_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_GOTREF(__pyx_t_7); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_5 = 1; + } + } + #endif + { + 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) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + 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_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_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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { + { + 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) + #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) + #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_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) + #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) + #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_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_10(__pyx_t_7); + 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, 207, __pyx_L9_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __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_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_GOTREF(__pyx_t_3); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __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); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3)) __PYX_ERR(0, 207, __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) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i); __pyx_8genexpr3__pyx_v_i = 0; + goto __pyx_L13_exit_scope; + __pyx_L9_error:; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i); __pyx_8genexpr3__pyx_v_i = 0; + goto __pyx_L1_error; + __pyx_L13_exit_scope:; + } /* exit inner scope */ + __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)) { @@ -11531,7 +12132,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, 188, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -11539,323 +12140,8 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":187 - * if checkShpType(collShape, Point): - * return shapelyGeom.Point(collShape.x, collShape.y) - * if checkShpType(collShape, Line): # <<<<<<<<<<<<<< - * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) - * if checkShpType(collShape, Circle): - */ - } - - /* "collisions.py":189 - * if checkShpType(collShape, Line): - * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) - * if checkShpType(collShape, Circle): # <<<<<<<<<<<<<< - * return shapelyGeom.Point(collShape.x, collShape.y).buffer(collShape.r) - * if checkShpType(collShape, ShpGroups.CLOSED): - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __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_collShape, __pyx_t_8}; - __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_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __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, 189, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - - /* "collisions.py":190 - * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) - * if checkShpType(collShape, 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()]) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __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_collShape, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = 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)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_8, __pyx_t_3}; - __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; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __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_buffer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __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_collShape, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __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_7))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "collisions.py":189 - * if checkShpType(collShape, Line): - * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) - * if checkShpType(collShape, Circle): # <<<<<<<<<<<<<< - * return shapelyGeom.Point(collShape.x, collShape.y).buffer(collShape.r) - * if checkShpType(collShape, ShpGroups.CLOSED): - */ - } - - /* "collisions.py":191 - * if checkShpType(collShape, 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_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __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_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_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_collShape, __pyx_t_3}; - __pyx_t_1 = __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_1)) __PYX_ERR(0, 191, __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, 191, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - - /* "collisions.py":192 - * 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): - * return shapelyGeom.GeometryCollection([collToShapely(i) for i in collShape.shapes]) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - { /* enter inner scope */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_4 = __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_4)) __PYX_ERR(0, 192, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); - __pyx_t_9 = 0; - __pyx_t_10 = NULL; - } else { - __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L9_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_10)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { - { - 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, 192, __pyx_L9_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_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 192, __pyx_L9_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_4); - #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, 192, __pyx_L9_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_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 192, __pyx_L9_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_10(__pyx_t_8); - 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, 192, __pyx_L9_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_i, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_8genexpr3__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_8genexpr3__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L9_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, 192, __pyx_L9_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2)) __PYX_ERR(0, 192, __pyx_L9_error); - __pyx_t_4 = 0; - __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 192, __pyx_L9_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i); __pyx_8genexpr3__pyx_v_i = 0; - goto __pyx_L13_exit_scope; - __pyx_L9_error:; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i); __pyx_8genexpr3__pyx_v_i = 0; - goto __pyx_L1_error; - __pyx_L13_exit_scope:; - } /* exit inner scope */ - __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[2] = {__pyx_t_8, __pyx_t_7}; - __pyx_t_1 = __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_1)) __PYX_ERR(0, 192, __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":191 - * if checkShpType(collShape, Circle): + /* "collisions.py":206 + * 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()]) @@ -11863,48 +12149,48 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":193 + /* "collisions.py":208 * 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') */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __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, 193, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __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_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; + __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_GOTREF(__pyx_t_7); + __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_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); + if (unlikely(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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_collShape, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__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, 193, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_collShape, __pyx_t_7}; + __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) __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":194 + /* "collisions.py":209 * 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]) # <<<<<<<<<<<<<< @@ -11912,97 +12198,97 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_GeometryCollection); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __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_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_shapes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_7); - if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { - __pyx_t_11 = __pyx_t_7; __Pyx_INCREF(__pyx_t_11); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __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_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_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 194, __pyx_L17_error) + __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_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 194, __pyx_L17_error) + __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 209, __pyx_L17_error) } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_11))) { { 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, 194, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 209, __pyx_L17_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 194, __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, 209, __pyx_L17_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_7); + __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_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, 194, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 209, __pyx_L17_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 194, __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, 209, __pyx_L17_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_7); + __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_GOTREF(__pyx_t_8); #endif } } else { - __pyx_t_7 = __pyx_t_10(__pyx_t_11); - if (unlikely(!__pyx_t_7)) { + __pyx_t_8 = __pyx_t_10(__pyx_t_11); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 194, __pyx_L17_error) + else __PYX_ERR(0, 209, __pyx_L17_error) } break; } - __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_i, __pyx_t_7); - __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collToShapely); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; + __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_GOTREF(__pyx_t_3); + __pyx_t_2 = 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); + 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_2, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_8genexpr4__pyx_v_i}; - __pyx_t_7 = __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_7)) __PYX_ERR(0, 194, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 194, __pyx_L17_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 209, __pyx_L17_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_i); __pyx_8genexpr4__pyx_v_i = 0; @@ -12015,31 +12301,31 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __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 (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_4}; + __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + 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_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":193 + /* "collisions.py":208 * if checkShpType(collShape, ShpGroups.CLOSED): * return shapelyGeom.Polygon([(i[0], i[1]) for i in collShape.toPoints()]) * if checkShpType(collShape, ShpGroups.GROUP): # <<<<<<<<<<<<<< @@ -12048,14 +12334,14 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":195 + /* "collisions.py":210 * 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') # <<<<<<<<<<<<<< * * 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, 195, __pyx_L1_error) + __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; @@ -12063,28 +12349,28 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __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_8 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_collShape)), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_12; - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); - __pyx_t_8 = 0; + __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_8 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __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_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) + __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_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 195, __pyx_L1_error) + __PYX_ERR(0, 210, __pyx_L1_error) - /* "collisions.py":175 + /* "collisions.py":190 * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') * * def collToShapely(collShape: 'Shape') -> shapelyGeom.base.BaseGeometry: # <<<<<<<<<<<<<< @@ -12111,7 +12397,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":197 +/* "collisions.py":212 * 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): # <<<<<<<<<<<<<< @@ -12129,18 +12415,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, 197, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __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, 197, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __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, 212, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __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, 197, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 212, __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, 197, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 212, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -12223,7 +12509,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -12231,9 +12517,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, 1); __PYX_ERR(0, 197, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, 1); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -12241,21 +12527,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, 2); __PYX_ERR(0, 197, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, 2); __PYX_ERR(0, 212, __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, 197, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __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, 197, __pyx_L3_error) + 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) } } else { switch (__pyx_nargs) { @@ -12275,7 +12561,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, 197, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12289,8 +12575,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, 197, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), (&PyInt_Type), 0, "width", 1))) __PYX_ERR(0, 197, __pyx_L1_error) + 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) __pyx_r = __pyx_pf_10collisions_16drawShape(__pyx_self, __pyx_v_surface, __pyx_v_shape, __pyx_v_colour, __pyx_v_width); /* function exit code */ @@ -12334,14 +12620,14 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("drawShape", 1); - /* "collisions.py":207 + /* "collisions.py":222 * width (int, optional): The width of the lines to draw. Defaults to 0. * """ * checkForPygame() # <<<<<<<<<<<<<< - * if checkShpType(shape, Point): + * 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, 207, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkForPygame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -12361,31 +12647,34 @@ 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, 207, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __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":208 + /* "collisions.py":223 * """ * checkForPygame() - * if checkShpType(shape, Point): # <<<<<<<<<<<<<< + * if checkShpType(shape, ShpTyps.Point): # <<<<<<<<<<<<<< * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) - * elif checkShpType(shape, Line): + * elif checkShpType(shape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __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, 208, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; + __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_GOTREF(__pyx_t_5); + __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_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { + __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_5); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -12393,50 +12682,50 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_shape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_shape, __pyx_t_5}; __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __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) __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, 208, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":209 + /* "collisions.py":224 * checkForPygame() - * if checkShpType(shape, Point): + * if checkShpType(shape, ShpTyps.Point): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) # <<<<<<<<<<<<<< - * elif checkShpType(shape, Line): + * 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, 209, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_draw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) + __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_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_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __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_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error) + __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_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_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __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, 209, __pyx_L1_error); + __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_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); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error); - __pyx_t_5 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error); + __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_4 = 0; @@ -12453,45 +12742,48 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_surface, __pyx_v_colour, __pyx_t_3, __pyx_v_width}; + PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_surface, __pyx_v_colour, __pyx_t_5, __pyx_v_width}; __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __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":208 + /* "collisions.py":223 * """ * checkForPygame() - * if checkShpType(shape, Point): # <<<<<<<<<<<<<< + * if checkShpType(shape, ShpTyps.Point): # <<<<<<<<<<<<<< * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) - * elif checkShpType(shape, Line): + * elif checkShpType(shape, ShpTyps.Line): */ goto __pyx_L3; } - /* "collisions.py":210 - * if checkShpType(shape, Point): + /* "collisions.py":225 + * if checkShpType(shape, ShpTyps.Point): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) - * elif checkShpType(shape, Line): # <<<<<<<<<<<<<< + * 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, 210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __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_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; __pyx_t_4 = 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)) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -12499,373 +12791,376 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_shape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_shape, __pyx_t_7}; __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __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) __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, 210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":211 + /* "collisions.py":226 * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) - * elif checkShpType(shape, Line): + * 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, 211, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __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, 211, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 226, __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_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __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, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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, 211, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":212 - * elif checkShpType(shape, Line): + /* "collisions.py":227 + * 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_3, __pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 227, __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_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_circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __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_2, __pyx_n_s_circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 227, __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, 212, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) + __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_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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_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, 212, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_3); 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 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 227, __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); __pyx_t_2 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_int_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + __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_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_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; __pyx_t_4 = 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); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_surface, __pyx_v_colour, __pyx_t_5, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __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; + PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_surface, __pyx_v_colour, __pyx_t_3, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); + __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, 212, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":211 + /* "collisions.py":226 * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) - * elif checkShpType(shape, Line): + * 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])), */ } - /* "collisions.py":213 + /* "collisions.py":228 * 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, Arc): + * elif checkShpType(shape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __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_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_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __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_2, __pyx_n_s_line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __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, 213, __pyx_L1_error) + __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_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, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __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_GOTREF(__pyx_t_3); __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, 213, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); 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_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) + __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_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_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, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __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_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __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, 213, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 228, __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); __pyx_t_2 = 0; - __pyx_t_5 = 0; + __pyx_t_3 = 0; - /* "collisions.py":214 + /* "collisions.py":229 * 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, Arc): + * elif checkShpType(shape, ShpTyps.Arc): * pygame.draw.arc(surface, colour, */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) + __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_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_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __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_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __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, 214, __pyx_L1_error) + __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_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, 214, __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, 229, __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, 214, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __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, 214, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error); - __pyx_t_5 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error); + __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_surface, __pyx_v_colour, __pyx_t_7, __pyx_t_8, __pyx_v_width}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); + PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_surface, __pyx_v_colour, __pyx_t_5, __pyx_t_8, __pyx_v_width}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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, 213, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":210 - * if checkShpType(shape, Point): + /* "collisions.py":225 + * if checkShpType(shape, ShpTyps.Point): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) - * elif checkShpType(shape, Line): # <<<<<<<<<<<<<< + * 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)) */ goto __pyx_L3; } - /* "collisions.py":215 + /* "collisions.py":230 * 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, Arc): # <<<<<<<<<<<<<< + * 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_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Arc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __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_GOTREF(__pyx_t_8); - __pyx_t_7 = NULL; + __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_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; __pyx_t_4 = 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); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_shape, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __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, 215, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_shape, __pyx_t_5}; + __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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 215, __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":216 + /* "collisions.py":231 * (int(shape.p2[0]), int(shape.p2[1])), width) - * elif checkShpType(shape, Arc): + * 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_3, __pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __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_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":217 - * elif checkShpType(shape, Arc): + /* "collisions.py":232 + * 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, Circle): + * elif checkShpType(shape, ShpTyps.Circle): */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __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_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) + __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_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_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __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_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_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_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Subtract(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __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_v_shape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __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, 217, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); 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 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_8, __pyx_t_3); 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_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, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyInt_MultiplyObjC(__pyx_t_5, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_t_7, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __pyx_L1_error) + __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_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_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_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_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_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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_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, 217, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 232, __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, 217, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_2 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(0, 232, __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); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3)) __PYX_ERR(0, 232, __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); __pyx_t_5 = 0; - __pyx_t_7 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_8 = 0; - /* "collisions.py":218 + /* "collisions.py":233 * 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, Circle): + * elif checkShpType(shape, ShpTyps.Circle): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), int(shape.r), width) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __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_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_endAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) + __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_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_GOTREF(__pyx_t_5); - __pyx_t_8 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; + __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_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { + __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_5); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -12873,272 +13168,275 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8}; - __pyx_t_7 = __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_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; + __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) + __Pyx_GOTREF(__pyx_t_8); __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, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_radians); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_startAng); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = PyNumber_Negative(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L1_error) + __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_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_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_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_10}; + __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, 218, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_5 = NULL; + __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_surface, __pyx_v_colour, __pyx_t_9, __pyx_t_7, __pyx_t_2, __pyx_v_width}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 6+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_surface, __pyx_v_colour, __pyx_t_9, __pyx_t_8, __pyx_t_2, __pyx_v_width}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 6+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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, 216, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":215 + /* "collisions.py":230 * 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, Arc): # <<<<<<<<<<<<<< + * 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)), */ goto __pyx_L3; } - /* "collisions.py":219 + /* "collisions.py":234 * (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, Circle): # <<<<<<<<<<<<<< + * 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_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __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_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = NULL; + __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_GOTREF(__pyx_t_8); + __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_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); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __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_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_shape, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __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_1)) __PYX_ERR(0, 219, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_shape, __pyx_t_8}; + __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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 219, __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":220 + /* "collisions.py":235 * math.radians(-shape.endAng), math.radians(-shape.startAng), width) - * elif checkShpType(shape, Circle): + * 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_3, __pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __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_circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __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_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __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_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, 220, __pyx_L1_error) + __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_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_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_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_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 220, __pyx_L1_error) + __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_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_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, 220, __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, 220, __pyx_L1_error); + __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_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); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9)) __PYX_ERR(0, 220, __pyx_L1_error); - __pyx_t_7 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 235, __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, 220, __pyx_L1_error) + __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_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __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(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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[6] = {__pyx_t_9, __pyx_v_surface, __pyx_v_colour, __pyx_t_2, __pyx_t_7, __pyx_v_width}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); + PyObject *__pyx_callargs[6] = {__pyx_t_9, __pyx_v_surface, __pyx_v_colour, __pyx_t_8, __pyx_t_2, __pyx_v_width}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); __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; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":219 + /* "collisions.py":234 * (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, Circle): # <<<<<<<<<<<<<< + * 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): */ goto __pyx_L3; } - /* "collisions.py":221 - * elif checkShpType(shape, Circle): + /* "collisions.py":236 + * 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_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; + __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_GOTREF(__pyx_t_8); + __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_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); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __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_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_shape, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __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_1)) __PYX_ERR(0, 221, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_shape, __pyx_t_8}; + __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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 221, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":222 + /* "collisions.py":237 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = NULL; + __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_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; __pyx_t_4 = 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 (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - 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, 222, __pyx_L1_error) + 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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_ps = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":223 + /* "collisions.py":238 * elif checkShpType(shape, ShpGroups.CLOSED): * ps = shape.toPoints() * psset = {tuple(i) for i in ps} # <<<<<<<<<<<<<< @@ -13146,68 +13444,68 @@ 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, 223, __pyx_L7_error) + __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L7_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_7 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 223, __pyx_L7_error) + __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_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) } for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 223, __pyx_L7_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 238, __pyx_L7_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_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 223, __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, 238, __pyx_L7_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); + __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_GOTREF(__pyx_t_8); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 223, __pyx_L7_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 238, __pyx_L7_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_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 223, __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, 238, __pyx_L7_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); + __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_GOTREF(__pyx_t_8); #endif } } else { - __pyx_t_2 = __pyx_t_12(__pyx_t_3); - if (unlikely(!__pyx_t_2)) { + __pyx_t_8 = __pyx_t_12(__pyx_t_7); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 223, __pyx_L7_error) + else __PYX_ERR(0, 238, __pyx_L7_error) } break; } - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_i, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_8genexpr5__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 223, __pyx_L7_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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_GOTREF(__pyx_t_8); + if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 238, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_i); __pyx_8genexpr5__pyx_v_i = 0; goto __pyx_L11_exit_scope; __pyx_L7_error:; @@ -13218,18 +13516,18 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_v_psset = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":224 + /* "collisions.py":239 * 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, 224, __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, 239, __pyx_L1_error) __pyx_t_6 = (__pyx_t_11 == 0); if (__pyx_t_6) { - /* "collisions.py":225 + /* "collisions.py":240 * psset = {tuple(i) for i in ps} * if len(psset) == 0: * return # <<<<<<<<<<<<<< @@ -13240,7 +13538,7 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "collisions.py":224 + /* "collisions.py":239 * ps = shape.toPoints() * psset = {tuple(i) for i in ps} * if len(psset) == 0: # <<<<<<<<<<<<<< @@ -13249,94 +13547,94 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx */ } - /* "collisions.py":226 + /* "collisions.py":241 * 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, 226, __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, 241, __pyx_L1_error) __pyx_t_6 = (__pyx_t_11 == 1); if (__pyx_t_6) { - /* "collisions.py":227 + /* "collisions.py":242 * 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, 227, __pyx_L1_error) + __pyx_t_1 = PySet_Pop(__pyx_v_psset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fst = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":228 + /* "collisions.py":243 * 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_3, __pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __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_circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_2); 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, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __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, 228, __pyx_L1_error) + __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_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_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_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_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 228, __pyx_L1_error) + __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_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_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, 228, __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, 228, __pyx_L1_error); + __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_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); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9)) __PYX_ERR(0, 228, __pyx_L1_error); - __pyx_t_7 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 243, __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, 228, __pyx_L1_error) + __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_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __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(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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_v_surface, __pyx_v_colour, __pyx_t_2, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); + PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_v_surface, __pyx_v_colour, __pyx_t_8, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __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; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":226 + /* "collisions.py":241 * if len(psset) == 0: * return * elif len(psset) == 1: # <<<<<<<<<<<<<< @@ -13346,144 +13644,144 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L12; } - /* "collisions.py":229 + /* "collisions.py":244 * 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, 229, __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, 244, __pyx_L1_error) __pyx_t_6 = (__pyx_t_11 == 2); if (__pyx_t_6) { - /* "collisions.py":230 + /* "collisions.py":245 * 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, 230, __pyx_L1_error) + __pyx_t_1 = PySet_Pop(__pyx_v_psset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fst = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":231 + /* "collisions.py":246 * 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, 231, __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_snd = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":232 + /* "collisions.py":247 * 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_3, __pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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_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_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":233 + /* "collisions.py":248 * 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_7 = __Pyx_GetItemInt(__pyx_v_fst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __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, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_fst, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 248, __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_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_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __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, 233, __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, 248, __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); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error); - __pyx_t_2 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9)) __PYX_ERR(0, 248, __pyx_L1_error); + __pyx_t_8 = 0; __pyx_t_9 = 0; - /* "collisions.py":234 + /* "collisions.py":249 * 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, 234, __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, 249, __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, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __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, 234, __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, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __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, 234, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 249, __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, 234, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_int_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_5, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(0, 249, __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); + __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_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_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_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; __pyx_t_4 = 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 (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_surface, __pyx_v_colour, __pyx_t_7, __pyx_t_9, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_callargs[6] = {__pyx_t_8, __pyx_v_surface, __pyx_v_colour, __pyx_t_2, __pyx_t_9, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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":229 + /* "collisions.py":244 * fst = psset.pop() * pygame.draw.circle(surface, colour, (int(fst[0]), int(fst[1])), int(width/2)) * elif len(psset) == 2: # <<<<<<<<<<<<<< @@ -13493,47 +13791,47 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx } __pyx_L12:; - /* "collisions.py":235 + /* "collisions.py":250 * (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_3, __pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __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_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __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_3, __pyx_n_s_polygon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __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_5, __pyx_n_s_polygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; + __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_surface, __pyx_v_colour, __pyx_v_ps, __pyx_v_width}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + 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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":221 - * elif checkShpType(shape, Circle): + /* "collisions.py":236 + * 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() @@ -13542,104 +13840,104 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":236 + /* "collisions.py":251 * (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_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __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_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_GROUP); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L1_error) + __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_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; + __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_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_shape, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_shape, __pyx_t_9}; + __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, 236, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __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_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, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_6)) { - /* "collisions.py":237 + /* "collisions.py":252 * pygame.draw.polygon(surface, colour, ps, width) * elif checkShpType(shape, ShpGroups.GROUP): * for i in shape.shapes: # <<<<<<<<<<<<<< * drawShape(surface, i, colour, width) * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __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_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_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 237, __pyx_L1_error) + __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_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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 237, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __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_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 237, __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, 252, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __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, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 237, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __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_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 237, __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, 252, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __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, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_1 = __pyx_t_12(__pyx_t_3); + __pyx_t_1 = __pyx_t_12(__pyx_t_7); 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, 237, __pyx_L1_error) + else __PYX_ERR(0, 252, __pyx_L1_error) } break; } @@ -13648,23 +13946,23 @@ 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":238 + /* "collisions.py":253 * elif checkShpType(shape, ShpGroups.GROUP): * for i in shape.shapes: * drawShape(surface, i, colour, width) # <<<<<<<<<<<<<< * else: * raise ValueError(f'Cannot draw BlazeSudio shape of type {type(shape)}') */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_drawShape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_drawShape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = NULL; + __pyx_t_3 = NULL; __pyx_t_4 = 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)) { + __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_5); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_4 = 1; @@ -13672,16 +13970,16 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_surface, __pyx_v_i, __pyx_v_colour, __pyx_v_width}; + 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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __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":237 + /* "collisions.py":252 * pygame.draw.polygon(surface, colour, ps, width) * elif checkShpType(shape, ShpGroups.GROUP): * for i in shape.shapes: # <<<<<<<<<<<<<< @@ -13689,9 +13987,9 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx * else: */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":236 + /* "collisions.py":251 * (int(snd[0]), int(snd[1])), int(width/4*3)) * pygame.draw.polygon(surface, colour, ps, width) * elif checkShpType(shape, ShpGroups.GROUP): # <<<<<<<<<<<<<< @@ -13701,7 +13999,7 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":240 + /* "collisions.py":255 * drawShape(surface, i, colour, width) * else: * raise ValueError(f'Cannot draw BlazeSudio shape of type {type(shape)}') # <<<<<<<<<<<<<< @@ -13709,21 +14007,21 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx * class Shape: */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_shape)), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_draw_BlazeSudio_shape_of, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __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, 255, __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, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 255, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":197 + /* "collisions.py":212 * 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): # <<<<<<<<<<<<<< @@ -13757,7 +14055,7 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":248 +/* "collisions.py":264 * x: Number = 0 * y: Number = 0 * def __init__(self, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -13775,20 +14073,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, 248, __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, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __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, 248, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __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, 248, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 264, __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, 248, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 264, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -13864,19 +14162,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __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, 248, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __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, 248, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 264, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -13889,14 +14187,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, 248, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __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, 248, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 264, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13932,19 +14230,19 @@ static PyObject *__pyx_pf_10collisions_5Shape___init__(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":253 + /* "collisions.py":269 * 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, 253, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __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, 253, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bounciness, __pyx_t_1) < 0) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":248 + /* "collisions.py":264 * x: Number = 0 * y: Number = 0 * def __init__(self, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -13965,7 +14263,7 @@ static PyObject *__pyx_pf_10collisions_5Shape___init__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":255 +/* "collisions.py":271 * self.bounciness: Number = bounciness * * def collides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< @@ -14030,7 +14328,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -14038,14 +14336,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, 1); __PYX_ERR(0, 255, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, 1); __PYX_ERR(0, 271, __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, 255, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collides") < 0)) __PYX_ERR(0, 271, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -14058,7 +14356,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, 255, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 271, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14102,20 +14400,20 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collides", 1); - /* "collisions.py":265 + /* "collisions.py":281 * 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, 265, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __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, 265, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_v_othershape, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":266 + /* "collisions.py":282 * """ * if isinstance(othershape, Shape): * return self._collides(othershape) # <<<<<<<<<<<<<< @@ -14123,7 +14421,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, 266, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -14143,7 +14441,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, 266, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -14151,7 +14449,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":265 + /* "collisions.py":281 * bool: whether or not this shape collides with any of the input shape(s) * """ * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< @@ -14160,7 +14458,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":267 + /* "collisions.py":283 * if isinstance(othershape, Shape): * return self._collides(othershape) * for s in othershape: # <<<<<<<<<<<<<< @@ -14172,9 +14470,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, 267, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_othershape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __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, 267, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -14182,28 +14480,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, 267, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 283, __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, 267, __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, 283, __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, 267, __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, 283, __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, 267, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 283, __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, 267, __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, 283, __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, 267, __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, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -14213,7 +14511,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, 267, __pyx_L1_error) + else __PYX_ERR(0, 283, __pyx_L1_error) } break; } @@ -14222,14 +14520,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":268 + /* "collisions.py":284 * 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, 268, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_collides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -14249,15 +14547,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, 268, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __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, 268, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "collisions.py":269 + /* "collisions.py":285 * for s in othershape: * if s._collides(self): * return True # <<<<<<<<<<<<<< @@ -14270,7 +14568,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":268 + /* "collisions.py":284 * return self._collides(othershape) * for s in othershape: * if s._collides(self): # <<<<<<<<<<<<<< @@ -14279,7 +14577,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":267 + /* "collisions.py":283 * if isinstance(othershape, Shape): * return self._collides(othershape) * for s in othershape: # <<<<<<<<<<<<<< @@ -14289,7 +14587,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":270 + /* "collisions.py":286 * if s._collides(self): * return True * return False # <<<<<<<<<<<<<< @@ -14301,7 +14599,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":255 + /* "collisions.py":271 * self.bounciness: Number = bounciness * * def collides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< @@ -14324,7 +14622,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":272 +/* "collisions.py":288 * return False * * def whereCollides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -14340,7 +14638,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_5Shape_4whereCollides, "\n Finds where this shape collides with another shape(s)\n\n Args:\n othershape (Shape / Shapes / Iterable[Shape]): The shape(s) to check for collision with\n\n Returns:\n Iterable[pointLike]: Points that lie both on this shape and the input shape(s)\n "); +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_4whereCollides, "\n Finds where this shape collides with another shape(s)\n\n Args:\n othershape (Shape / Shapes / Iterable[Shape]): The shape(s) to check for collision with.\n\n Returns:\n Iterable[pointLike]: Points that lie both on this shape and the input shape(s)\n "); static PyMethodDef __pyx_mdef_10collisions_5Shape_5whereCollides = {"whereCollides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_5whereCollides, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_4whereCollides}; static PyObject *__pyx_pw_10collisions_5Shape_5whereCollides(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -14389,7 +14687,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -14397,14 +14695,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, 1); __PYX_ERR(0, 272, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, 1); __PYX_ERR(0, 288, __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, 272, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "whereCollides") < 0)) __PYX_ERR(0, 288, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -14417,7 +14715,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, 272, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 288, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14463,20 +14761,20 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("whereCollides", 1); - /* "collisions.py":282 + /* "collisions.py":298 * 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, 282, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __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, 282, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_v_othershape, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":283 + /* "collisions.py":299 * """ * if isinstance(othershape, Shape): * return self._where(othershape) # <<<<<<<<<<<<<< @@ -14484,7 +14782,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, 283, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -14504,7 +14802,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, 283, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -14512,7 +14810,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":282 + /* "collisions.py":298 * Iterable[pointLike]: Points that lie both on this shape and the input shape(s) * """ * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< @@ -14521,19 +14819,19 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj */ } - /* "collisions.py":284 + /* "collisions.py":300 * 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, 284, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_points = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":285 + /* "collisions.py":301 * return self._where(othershape) * points = [] * for s in othershape: # <<<<<<<<<<<<<< @@ -14545,9 +14843,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, 285, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_othershape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __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, 301, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -14555,28 +14853,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, 285, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -14586,7 +14884,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, 285, __pyx_L1_error) + else __PYX_ERR(0, 301, __pyx_L1_error) } break; } @@ -14595,14 +14893,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":286 + /* "collisions.py":302 * 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, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -14622,14 +14920,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, 286, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __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, 286, __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, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":285 + /* "collisions.py":301 * return self._where(othershape) * points = [] * for s in othershape: # <<<<<<<<<<<<<< @@ -14639,19 +14937,19 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":287 + /* "collisions.py":303 * for s in othershape: * points.extend(s._where(self)) * return points # <<<<<<<<<<<<<< * - * def distance_to(self, othershape: 'Shape') -> Number: + * 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":272 + /* "collisions.py":288 * return False * * def whereCollides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -14675,25 +14973,25 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":289 +/* "collisions.py":305 * return points * - * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< + * def isContaining(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< * """ - * Finds the distance between this shape and another shape. + * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But (most of the time) more optimised than that. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_7distance_to(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_7isContaining(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_5Shape_6distance_to, "\n Finds the distance between this shape and another shape.\n\n Args:\n othershape (Shape): The other shape to find the distance to\n\n Returns:\n Number: The distance between this shape and the other shape\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_7distance_to = {"distance_to", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_7distance_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_6distance_to}; -static PyObject *__pyx_pw_10collisions_5Shape_7distance_to(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_6isContaining, "\n Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But (most of the time) 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_5Shape_7isContaining = {"isContaining", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_7isContaining, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_6isContaining}; +static PyObject *__pyx_pw_10collisions_5Shape_7isContaining(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14712,7 +15010,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("distance_to (wrapper)", 0); + __Pyx_RefNannySetupContext("isContaining (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -14740,7 +15038,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 305, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -14748,14 +15046,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 305, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("distance_to", 1, 2, 2, 1); __PYX_ERR(0, 289, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, 1); __PYX_ERR(0, 305, __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, 289, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isContaining") < 0)) __PYX_ERR(0, 305, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -14768,7 +15066,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, 289, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 305, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14778,11 +15076,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shape.distance_to", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shape.isContaining", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_6distance_to(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_5Shape_6isContaining(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -14795,193 +15093,552 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_6distance_to(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - PyObject *__pyx_v_thisP = NULL; - PyObject *__pyx_v_otherP = NULL; +static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { + PyObject *__pyx_v_s = NULL; 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; - unsigned int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("distance_to", 1); + __Pyx_RefNannySetupContext("isContaining", 1); - /* "collisions.py":299 - * Number: The distance between this shape and the other shape + /* "collisions.py":315 + * bool: Whether the shape is fully enclosed within this shape. * """ - * thisP = self.closestPointTo(othershape) # <<<<<<<<<<<<<< - * otherP = othershape.closestPointTo(self) - * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) + * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< + * return self._contains(othershape) + * for s in othershape: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __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, 315, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "collisions.py":316 + * """ + * if isinstance(othershape, Shape): + * return self._contains(othershape) # <<<<<<<<<<<<<< + * for s in othershape: + * 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, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_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, 316, __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":315 + * bool: Whether the shape is fully enclosed within this shape. + * """ + * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< + * return self._contains(othershape) + * for s in othershape: + */ } - #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_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + + /* "collisions.py":317 + * if isinstance(othershape, Shape): + * return self._contains(othershape) + * for s in othershape: # <<<<<<<<<<<<<< + * if self._contains(s): + * return True + */ + if (likely(PyList_CheckExact(__pyx_v_othershape)) || PyTuple_CheckExact(__pyx_v_othershape)) { + __pyx_t_1 = __pyx_v_othershape; __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_othershape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) } - __pyx_v_thisP = __pyx_t_1; - __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + 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, 317, __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, 317, __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, 317, __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, 317, __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, 317, __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, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_7(__pyx_t_1); + 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, 317, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":300 - * """ - * thisP = self.closestPointTo(othershape) - * otherP = othershape.closestPointTo(self) # <<<<<<<<<<<<<< - * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) + /* "collisions.py":318 + * 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, 318, __pyx_L1_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, __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, 318, __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, 318, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "collisions.py":319 + * for s in othershape: + * if self._contains(s): + * return True # <<<<<<<<<<<<<< + * return False * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __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_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":318 + * return self._contains(othershape) + * for s in othershape: + * if self._contains(s): # <<<<<<<<<<<<<< + * return True + * return False + */ } + + /* "collisions.py":317 + * if isinstance(othershape, Shape): + * return self._contains(othershape) + * for s in othershape: # <<<<<<<<<<<<<< + * if self._contains(s): + * return True + */ } - #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_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __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; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":301 - * thisP = self.closestPointTo(othershape) - * otherP = othershape.closestPointTo(self) - * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) # <<<<<<<<<<<<<< + /* "collisions.py":320 + * if self._contains(s): + * return True + * return False # <<<<<<<<<<<<<< * - * def check_rects(self, othershape: 'Shape') -> bool: + * def distance_to(self, othershape: 'Shape') -> Number: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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; - __pyx_t_2 = NULL; - __pyx_t_4 = 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_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_6, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __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, 301, __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; + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":289 + /* "collisions.py":305 * return points * - * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< + * def isContaining(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< * """ - * Finds the distance between this shape and another shape. + * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But (most of the time) more optimised than that. */ /* 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_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("collisions.Shape.distance_to", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("collisions.Shape.isContaining", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_thisP); - __Pyx_XDECREF(__pyx_v_otherP); + __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":303 - * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) +/* "collisions.py":322 + * return False * - * def check_rects(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< + * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< * """ - * Check whether this shape's bounding box collides with the other shape's. + * Finds the distance between this shape and another shape. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_9check_rects(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_9distance_to(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_5Shape_8check_rects, "\n Check whether this shape's bounding box collides with the other shape's.\n This can be used for a very fast way to know if shapes *aren't* colliding, but to find if they **are** then use `collides`.\n In fact, the `collides` method already uses this in it, so there isn't much need for you to use it.\n\n Args:\n othershape (Shape): _description_\n\n Returns:\n bool: Whether the bounding boxes of this object an the othershape collide\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_9check_rects = {"check_rects", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_9check_rects, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_8check_rects}; -static PyObject *__pyx_pw_10collisions_5Shape_9check_rects(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_8distance_to, "\n Finds the distance between this shape and another shape.\n\n Args:\n othershape (Shape): The other shape to find the distance to\n\n Returns:\n Number: The distance between this shape and the other shape\n "); +static PyMethodDef __pyx_mdef_10collisions_5Shape_9distance_to = {"distance_to", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_9distance_to, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_8distance_to}; +static PyObject *__pyx_pw_10collisions_5Shape_9distance_to(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("distance_to (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, 322, __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, 322, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("distance_to", 1, 2, 2, 1); __PYX_ERR(0, 322, __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, 322, __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("distance_to", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 322, __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.Shape.distance_to", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_5Shape_8distance_to(__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; +} + +static PyObject *__pyx_pf_10collisions_5Shape_8distance_to(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { + PyObject *__pyx_v_thisP = NULL; + PyObject *__pyx_v_otherP = NULL; + 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; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("distance_to", 1); + + /* "collisions.py":332 + * 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, 332, __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; + } + } + #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_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __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":333 + * """ + * 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, 333, __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; + } + } + #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_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __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":334 + * thisP = self.closestPointTo(othershape) + * otherP = othershape.closestPointTo(self) + * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) # <<<<<<<<<<<<<< + * + * 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, 334, __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, 334, __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, 334, __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, 334, __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, 334, __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, 334, __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, 334, __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, 334, __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; + __pyx_t_2 = NULL; + __pyx_t_4 = 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_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_6, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __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, 334, __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":322 + * return False + * + * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< + * """ + * Finds the distance between this shape and another 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_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("collisions.Shape.distance_to", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_thisP); + __Pyx_XDECREF(__pyx_v_otherP); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":336 + * 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. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_5Shape_11check_rects(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_5Shape_10check_rects, "\n Check whether this shape's bounding box collides with the other shape's.\n This can be used for a very fast way to know if shapes *aren't* colliding, but to find if they **are** then use `collides`.\n In fact, the `collides` method already uses this in it, so there isn't much need for you to use it.\n\n Args:\n othershape (Shape): _description_\n\n Returns:\n bool: Whether the bounding boxes of this object an the othershape collide\n "); +static PyMethodDef __pyx_mdef_10collisions_5Shape_11check_rects = {"check_rects", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_11check_rects, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_10check_rects}; +static PyObject *__pyx_pw_10collisions_5Shape_11check_rects(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15028,7 +15685,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -15036,14 +15693,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("check_rects", 1, 2, 2, 1); __PYX_ERR(0, 303, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check_rects", 1, 2, 2, 1); __PYX_ERR(0, 336, __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, 303, __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, 336, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -15056,7 +15713,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, 303, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check_rects", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 336, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15070,7 +15727,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_8check_rects(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_5Shape_10check_rects(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -15083,7 +15740,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { +static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { PyObject *__pyx_v_thisr = NULL; PyObject *__pyx_v_otherr = NULL; PyObject *__pyx_r = NULL; @@ -15099,14 +15756,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_rects", 1); - /* "collisions.py":315 + /* "collisions.py":348 * 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, 315, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -15126,11 +15783,11 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(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, 315, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __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, 315, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; @@ -15150,7 +15807,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec 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, 315, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -15159,7 +15816,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec __pyx_v_otherr = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":316 + /* "collisions.py":349 * """ * 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] # <<<<<<<<<<<<<< @@ -15167,14 +15824,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec * 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, 316, __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, 349, __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, 316, __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, 349, __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, 316, __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, 349, __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, 316, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { @@ -15183,14 +15840,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec __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, 316, __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, 349, __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, 316, __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, 349, __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, 316, __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, 349, __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, 316, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -15199,14 +15856,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec __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, 316, __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, 349, __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, 316, __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, 349, __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, 316, __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, 349, __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, 316, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { @@ -15215,11 +15872,11 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec __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, 316, __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, 349, __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, 316, __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, 349, __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, 316, __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, 349, __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); @@ -15230,7 +15887,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":303 + /* "collisions.py":336 * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) * * def check_rects(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -15254,7 +15911,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":318 +/* "collisions.py":351 * 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) # <<<<<<<<<<<<<< @@ -15263,15 +15920,15 @@ static PyObject *__pyx_pf_10collisions_5Shape_8check_rects(CYTHON_UNUSED PyObjec */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_11__repr__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_13__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*/ -static PyMethodDef __pyx_mdef_10collisions_5Shape_11__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_11__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Shape_11__repr__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Shape_13__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_13__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Shape_13__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15315,12 +15972,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 351, __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, 318, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 351, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -15331,7 +15988,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, 318, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 351, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15345,7 +16002,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_10__repr__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Shape_12__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -15358,7 +16015,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Shape_12__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -15367,7 +16024,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_10__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, 318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15384,7 +16041,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_10__repr__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":321 +/* "collisions.py":354 * * # Replace these * def _collides(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -15393,15 +16050,15 @@ static PyObject *__pyx_pf_10collisions_5Shape_10__repr__(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_13_collides(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_15_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_5Shape_13_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_13_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Shape_13_collides(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Shape_15_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_15_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Shape_15_collides(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15448,7 +16105,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 354, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -15456,14 +16113,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 354, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 354, __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, 321, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 354, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -15476,7 +16133,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, 321, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 354, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15490,7 +16147,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_12_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_5Shape_14_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -15503,12 +16160,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_12_collides(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape) { +static PyObject *__pyx_pf_10collisions_5Shape_14_collides(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("_collides", 1); - /* "collisions.py":322 + /* "collisions.py":355 * # Replace these * def _collides(self, othershape: 'Shape') -> bool: * return True # <<<<<<<<<<<<<< @@ -15520,7 +16177,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_12_collides(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":321 + /* "collisions.py":354 * * # Replace these * def _collides(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -15535,7 +16192,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_12_collides(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":324 +/* "collisions.py":357 * return True * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -15544,15 +16201,15 @@ static PyObject *__pyx_pf_10collisions_5Shape_12_collides(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_15_where(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_17_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_5Shape_15_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_15_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Shape_15_where(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Shape_17_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_17_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Shape_17_where(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15599,7 +16256,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, 357, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -15607,14 +16264,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, 357, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 324, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 357, __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, 324, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 357, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -15627,7 +16284,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, 324, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 357, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15641,7 +16298,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_14_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_5Shape_16_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -15654,7 +16311,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_14_where(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape) { +static PyObject *__pyx_pf_10collisions_5Shape_16_where(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -15663,21 +16320,21 @@ static PyObject *__pyx_pf_10collisions_5Shape_14_where(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":325 + /* "collisions.py":358 * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: * return [] # <<<<<<<<<<<<<< * - * def closestPointTo(self, othershape: 'Shape', returnAll: bool = False) -> pointLike|Iterable[pointLike]: + * def _contains(self, othershape: 'Shape') -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":324 + /* "collisions.py":357 * return True * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -15696,25 +16353,176 @@ static PyObject *__pyx_pf_10collisions_5Shape_14_where(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":327 +/* "collisions.py":360 + * return [] + * + * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< + * return True + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_5Shape_19_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_5Shape_19_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_19_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Shape_19_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_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, 360, __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, 360, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_contains", 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, "_contains") < 0)) __PYX_ERR(0, 360, __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("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 360, __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.Shape._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_5Shape_18_contains(__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; +} + +static PyObject *__pyx_pf_10collisions_5Shape_18_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":361 + * + * def _contains(self, othershape: 'Shape') -> bool: + * return True # <<<<<<<<<<<<<< + * + * def closestPointTo(self, othershape: 'Shape', returnAll: bool = False) -> pointLike|Iterable[pointLike]: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "collisions.py":360 * return [] * + * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< + * return True + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":363 + * return True + * * def closestPointTo(self, othershape: 'Shape', returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds the closest point ON THIS OBJECT **TO** the other object */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_17closestPointTo(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_21closestPointTo(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_5Shape_16closestPointTo, "\n Finds the closest point ON THIS OBJECT **TO** the other object\n\n Args:\n othershape (Shape): The other shape to find the closest point to\n returnAll (bool, optional): Whether to return *all* the potential closest points sorted in order of closeness or just **the** closest. Defaults to False (only the closest).\n\n Returns:\n 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.\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_17closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_17closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_16closestPointTo}; -static PyObject *__pyx_pw_10collisions_5Shape_17closestPointTo(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_20closestPointTo, "\n Finds the closest point ON THIS OBJECT **TO** the other object\n\n Args:\n othershape (Shape): The other shape to find the closest point to\n returnAll (bool, optional): Whether to return *all* the potential closest points sorted in order of closeness or just **the** closest. Defaults to False (only the closest).\n\n Returns:\n 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.\n "); +static PyMethodDef __pyx_mdef_10collisions_5Shape_21closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_21closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_20closestPointTo}; +static PyObject *__pyx_pw_10collisions_5Shape_21closestPointTo(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15765,7 +16573,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 327, __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: @@ -15773,21 +16581,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 327, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 363, __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, 327, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __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, "closestPointTo") < 0)) __PYX_ERR(0, 327, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 363, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -15805,7 +16613,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, 327, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 363, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15819,7 +16627,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_16closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); + __pyx_r = __pyx_pf_10collisions_5Shape_20closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); /* function exit code */ { @@ -15832,7 +16640,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_16closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { +static PyObject *__pyx_pf_10collisions_5Shape_20closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -15842,17 +16650,17 @@ static PyObject *__pyx_pf_10collisions_5Shape_16closestPointTo(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("closestPointTo", 1); - /* "collisions.py":338 + /* "collisions.py":374 * 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, 338, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 374, __pyx_L1_error) if (__pyx_t_1) { - /* "collisions.py":339 + /* "collisions.py":375 * """ * if returnAll: * return [(0, 0)] # <<<<<<<<<<<<<< @@ -15860,16 +16668,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_16closestPointTo(CYTHON_UNUSED PyO * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __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, 339, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__2)) __PYX_ERR(0, 375, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":338 + /* "collisions.py":374 * 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: # <<<<<<<<<<<<<< @@ -15878,7 +16686,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_16closestPointTo(CYTHON_UNUSED PyO */ } - /* "collisions.py":340 + /* "collisions.py":376 * if returnAll: * return [(0, 0)] * return (0, 0) # <<<<<<<<<<<<<< @@ -15890,8 +16698,8 @@ static PyObject *__pyx_pf_10collisions_5Shape_16closestPointTo(CYTHON_UNUSED PyO __pyx_r = __pyx_tuple__2; goto __pyx_L0; - /* "collisions.py":327 - * return [] + /* "collisions.py":363 + * return True * * def closestPointTo(self, othershape: 'Shape', returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ @@ -15909,7 +16717,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_16closestPointTo(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":342 +/* "collisions.py":378 * return (0, 0) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -15927,18 +16735,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, 342, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __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, 342, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __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, 378, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __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, 342, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 378, __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, 342, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 378, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -15957,16 +16765,16 @@ static PyObject *__pyx_pf_10collisions_22__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_19isCorner(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_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_5Shape_18isCorner, "\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_5Shape_19isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_19isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_18isCorner}; -static PyObject *__pyx_pw_10collisions_5Shape_19isCorner(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_22isCorner, "\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_5Shape_23isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_23isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_22isCorner}; +static PyObject *__pyx_pw_10collisions_5Shape_23isCorner(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16018,7 +16826,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -16026,21 +16834,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 342, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 378, __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, 342, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 378, __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, 342, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 378, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -16058,7 +16866,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, 342, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 378, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16072,7 +16880,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_18isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); + __pyx_r = __pyx_pf_10collisions_5Shape_22isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); /* function exit code */ { @@ -16085,12 +16893,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_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_5Shape_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":353 + /* "collisions.py":389 * bool: Whether the point is on a corner of this shape * """ * return True # <<<<<<<<<<<<<< @@ -16102,7 +16910,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_18isCorner(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":342 + /* "collisions.py":378 * return (0, 0) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -16117,7 +16925,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_18isCorner(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":355 +/* "collisions.py":391 * return True * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -16126,16 +16934,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_18isCorner(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_21tangent(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_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_5Shape_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 (useful for example with lines for finding which side of the line the tangent should be of)\n\n Returns:\n Number: The tangent of this object at the point. You can -90 to get the normal.\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_21tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_21tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_20tangent}; -static PyObject *__pyx_pw_10collisions_5Shape_21tangent(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_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 (useful for example with lines for finding which side of the line the tangent should be of)\n\n Returns:\n Number: The tangent of this object at the point. You can -90 to get the normal.\n "); +static PyMethodDef __pyx_mdef_10collisions_5Shape_25tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_25tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_24tangent}; +static PyObject *__pyx_pw_10collisions_5Shape_25tangent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16185,7 +16993,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -16193,9 +17001,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 355, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 391, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -16203,14 +17011,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 355, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 391, __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, 355, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 391, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -16225,7 +17033,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, 355, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 391, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16239,7 +17047,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_20tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); + __pyx_r = __pyx_pf_10collisions_5Shape_24tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); /* function exit code */ { @@ -16252,7 +17060,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_20tangent(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_point, PyObject *__pyx_v_vel) { +static PyObject *__pyx_pf_10collisions_5Shape_24tangent(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_point, PyObject *__pyx_v_vel) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -16268,7 +17076,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_20tangent(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tangent", 1); - /* "collisions.py":366 + /* "collisions.py":402 * 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 # <<<<<<<<<<<<<< @@ -16276,19 +17084,19 @@ static PyObject *__pyx_pf_10collisions_5Shape_20tangent(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, 366, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __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, 366, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __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, 366, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __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, 366, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __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, 366, __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, 402, __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, 366, __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, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -16310,7 +17118,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_20tangent(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, 366, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -16333,18 +17141,18 @@ static PyObject *__pyx_pf_10collisions_5Shape_20tangent(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, 366, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __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, 366, __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, 402, __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":355 + /* "collisions.py":391 * return True * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -16369,7 +17177,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_20tangent(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":368 +/* "collisions.py":404 * return math.degrees(math.atan2(vel[1], vel[0])) % 360 * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< @@ -16378,16 +17186,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_20tangent(CYTHON_UNUSED PyObject * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_23toLines(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_27toLines(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_5Shape_22toLines, "\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_5Shape_23toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_23toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_22toLines}; -static PyObject *__pyx_pw_10collisions_5Shape_23toLines(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_26toLines, "\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_5Shape_27toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_27toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_26toLines}; +static PyObject *__pyx_pw_10collisions_5Shape_27toLines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16431,12 +17239,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 404, __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, 368, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 404, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -16447,7 +17255,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, 368, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 404, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16461,7 +17269,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_22toLines(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Shape_26toLines(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -16474,7 +17282,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_22toLines(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Shape_26toLines(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -16483,7 +17291,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_22toLines(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":373 + /* "collisions.py":409 * 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 [] # <<<<<<<<<<<<<< @@ -16491,13 +17299,13 @@ static PyObject *__pyx_pf_10collisions_5Shape_22toLines(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, 373, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":368 + /* "collisions.py":404 * return math.degrees(math.atan2(vel[1], vel[0])) % 360 * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< @@ -16516,7 +17324,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_22toLines(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":375 +/* "collisions.py":411 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -16525,16 +17333,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_22toLines(CYTHON_UNUSED PyObject * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_25toPoints(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_29toPoints(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_5Shape_24toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object. For Circles, Arcs and Shape's, this will be empty.\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_25toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_25toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_24toPoints}; -static PyObject *__pyx_pw_10collisions_5Shape_25toPoints(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_28toPoints, "\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_5Shape_29toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_29toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_28toPoints}; +static PyObject *__pyx_pw_10collisions_5Shape_29toPoints(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16578,12 +17386,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 375, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 411, __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, 375, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 411, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -16594,7 +17402,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, 375, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 411, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16608,7 +17416,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_24toPoints(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Shape_28toPoints(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -16621,7 +17429,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_24toPoints(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Shape_28toPoints(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -16630,21 +17438,21 @@ static PyObject *__pyx_pf_10collisions_5Shape_24toPoints(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":380 - * Iterable[pointLike]: Get a list of all the Points that make up this object. For Circles, Arcs and Shape's, this will be empty. + /* "collisions.py":416 + * 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 [] # <<<<<<<<<<<<<< * * def area(self) -> Number: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":375 + /* "collisions.py":411 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -16663,7 +17471,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_24toPoints(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":382 +/* "collisions.py":418 * return [] * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -16672,16 +17480,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_24toPoints(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_27area(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_31area(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_5Shape_26area, "\n Gets the area of the shape.\n\n Returns:\n Number: The area of the shape\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_27area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_27area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_26area}; -static PyObject *__pyx_pw_10collisions_5Shape_27area(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_30area, "\n Gets the area of the shape.\n\n Returns:\n Number: The area of the shape\n "); +static PyMethodDef __pyx_mdef_10collisions_5Shape_31area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_31area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_30area}; +static PyObject *__pyx_pw_10collisions_5Shape_31area(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16725,12 +17533,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 418, __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, 382, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 418, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -16741,7 +17549,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, 382, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 418, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16755,7 +17563,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_26area(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Shape_30area(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -16768,7 +17576,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_26area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Shape_30area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; @@ -16778,7 +17586,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_26area(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":389 + /* "collisions.py":425 * Number: The area of the shape * """ * return float('inf') # <<<<<<<<<<<<<< @@ -16786,14 +17594,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_26area(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, 389, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __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, 425, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":382 + /* "collisions.py":418 * return [] * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -16812,7 +17620,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_26area(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":391 +/* "collisions.py":427 * return float('inf') * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -16821,16 +17629,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_26area(CYTHON_UNUSED PyObject *__p */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_29rect(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_33rect(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_5Shape_28rect, "\n Returns the rectangle bounding box surrounding this object.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_29rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_29rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_28rect}; -static PyObject *__pyx_pw_10collisions_5Shape_29rect(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_32rect, "\n Returns the rectangle bounding box surrounding this object.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); +static PyMethodDef __pyx_mdef_10collisions_5Shape_33rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_33rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_32rect}; +static PyObject *__pyx_pw_10collisions_5Shape_33rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16874,12 +17682,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 427, __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, 391, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 427, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -16890,7 +17698,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, 391, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 427, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16904,7 +17712,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_28rect(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Shape_32rect(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -16917,7 +17725,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_28rect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Shape_32rect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; @@ -16931,7 +17739,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_28rect(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":398 + /* "collisions.py":434 * Iterable[Number]: (min x, min y, max x, max y) * """ * return -float('inf'), -float('inf'), float('inf'), float('inf') # <<<<<<<<<<<<<< @@ -16939,28 +17747,28 @@ static PyObject *__pyx_pf_10collisions_5Shape_28rect(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, 398, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble((-__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __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, 434, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((-__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __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, 398, __pyx_L1_error) - __pyx_t_3 = PyFloat_FromDouble((-__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __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, 434, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble((-__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __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, 398, __pyx_L1_error) - __pyx_t_4 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __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, 434, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __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, 398, __pyx_L1_error) - __pyx_t_5 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __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, 434, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __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, 398, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; @@ -16969,7 +17777,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_28rect(CYTHON_UNUSED PyObject *__p __pyx_t_6 = 0; goto __pyx_L0; - /* "collisions.py":391 + /* "collisions.py":427 * return float('inf') * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -16992,7 +17800,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_28rect(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":400 +/* "collisions.py":436 * 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]: # <<<<<<<<<<<<<< @@ -17010,21 +17818,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, 400, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __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, 400, __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, 436, __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, 400, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_False))) __PYX_ERR(0, 436, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __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, 400, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 436, __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, 400, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 436, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -17043,16 +17851,16 @@ static PyObject *__pyx_pf_10collisions_24__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_31handleCollisionsPos(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_35handleCollisionsPos(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_5Shape_30handleCollisionsPos, "\n This is called to modify objects' positions to bounce off objects.\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_31handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_31handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_30handleCollisionsPos}; -static PyObject *__pyx_pw_10collisions_5Shape_31handleCollisionsPos(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_34handleCollisionsPos, "\n This is called to modify objects' positions to bounce off objects.\n "); +static PyMethodDef __pyx_mdef_10collisions_5Shape_35handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_35handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_34handleCollisionsPos}; +static PyObject *__pyx_pw_10collisions_5Shape_35handleCollisionsPos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17114,7 +17922,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -17122,9 +17930,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 1); __PYX_ERR(0, 400, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 1); __PYX_ERR(0, 436, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -17132,9 +17940,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 2); __PYX_ERR(0, 400, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 2); __PYX_ERR(0, 436, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -17142,28 +17950,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 3); __PYX_ERR(0, 400, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 3); __PYX_ERR(0, 436, __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, 400, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __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, 400, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __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, 400, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 436, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -17188,7 +17996,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, 400, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 436, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17202,7 +18010,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_30handleCollisionsPos(__pyx_self, __pyx_v_self, __pyx_v_oldP, __pyx_v_newP, __pyx_v_objs, __pyx_v_vel, __pyx_v_verbose); + __pyx_r = __pyx_pf_10collisions_5Shape_34handleCollisionsPos(__pyx_self, __pyx_v_self, __pyx_v_oldP, __pyx_v_newP, __pyx_v_objs, __pyx_v_vel, __pyx_v_verbose); /* function exit code */ { @@ -17215,7 +18023,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_30handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_oldP, PyObject *__pyx_v_newP, CYTHON_UNUSED PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_verbose) { +static PyObject *__pyx_pf_10collisions_5Shape_34handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_oldP, PyObject *__pyx_v_newP, CYTHON_UNUSED PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_verbose) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -17226,17 +18034,17 @@ static PyObject *__pyx_pf_10collisions_5Shape_30handleCollisionsPos(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsPos", 1); - /* "collisions.py":404 + /* "collisions.py":440 * 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, 404, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 440, __pyx_L1_error) if (__pyx_t_1) { - /* "collisions.py":405 + /* "collisions.py":441 * """ * if verbose: * return newP, vel, [] # <<<<<<<<<<<<<< @@ -17244,24 +18052,24 @@ static PyObject *__pyx_pf_10collisions_5Shape_30handleCollisionsPos(CYTHON_UNUSE * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __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, 405, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newP)) __PYX_ERR(0, 441, __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, 405, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 441, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":404 + /* "collisions.py":440 * This is called to modify objects' positions to bounce off objects. * """ * if verbose: # <<<<<<<<<<<<<< @@ -17270,7 +18078,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_30handleCollisionsPos(CYTHON_UNUSE */ } - /* "collisions.py":406 + /* "collisions.py":442 * if verbose: * return newP, vel, [] * return newP, vel # <<<<<<<<<<<<<< @@ -17278,19 +18086,19 @@ static PyObject *__pyx_pf_10collisions_5Shape_30handleCollisionsPos(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, 406, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __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, 406, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newP)) __PYX_ERR(0, 442, __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, 406, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 442, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":400 + /* "collisions.py":436 * 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]: # <<<<<<<<<<<<<< @@ -17310,7 +18118,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_30handleCollisionsPos(CYTHON_UNUSE return __pyx_r; } -/* "collisions.py":408 +/* "collisions.py":444 * return newP, vel * * def handleCollisionsVel(self, vel: pointLike, objs: Union['Shapes',Iterable['Shape']], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< @@ -17319,16 +18127,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_30handleCollisionsPos(CYTHON_UNUSE */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_33handleCollisionsVel(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_37handleCollisionsVel(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_5Shape_32handleCollisionsVel, "\n This is a wrapper for `handleCollisionsPos` to handle velocity instead of position.\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_33handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_33handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_32handleCollisionsVel}; -static PyObject *__pyx_pw_10collisions_5Shape_33handleCollisionsVel(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_36handleCollisionsVel, "\n This is a wrapper for `handleCollisionsPos` to handle velocity instead of position.\n "); +static PyMethodDef __pyx_mdef_10collisions_5Shape_37handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_37handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_36handleCollisionsVel}; +static PyObject *__pyx_pw_10collisions_5Shape_37handleCollisionsVel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17382,7 +18190,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -17390,9 +18198,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, 1); __PYX_ERR(0, 408, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, 1); __PYX_ERR(0, 444, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -17400,21 +18208,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, 2); __PYX_ERR(0, 408, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, 2); __PYX_ERR(0, 444, __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, 408, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __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, 408, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 444, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -17434,7 +18242,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, 408, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 444, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17448,7 +18256,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_32handleCollisionsVel(__pyx_self, __pyx_v_self, __pyx_v_vel, __pyx_v_objs, __pyx_v_verbose); + __pyx_r = __pyx_pf_10collisions_5Shape_36handleCollisionsVel(__pyx_self, __pyx_v_self, __pyx_v_vel, __pyx_v_objs, __pyx_v_verbose); /* function exit code */ { @@ -17461,7 +18269,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_32handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, CYTHON_UNUSED PyObject *__pyx_v_objs, PyObject *__pyx_v_verbose) { +static PyObject *__pyx_pf_10collisions_5Shape_36handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, CYTHON_UNUSED PyObject *__pyx_v_objs, PyObject *__pyx_v_verbose) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -17472,17 +18280,17 @@ static PyObject *__pyx_pf_10collisions_5Shape_32handleCollisionsVel(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - /* "collisions.py":412 + /* "collisions.py":448 * 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, 412, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 448, __pyx_L1_error) if (__pyx_t_1) { - /* "collisions.py":413 + /* "collisions.py":449 * """ * if verbose: * return self, vel, [] # <<<<<<<<<<<<<< @@ -17490,24 +18298,24 @@ static PyObject *__pyx_pf_10collisions_5Shape_32handleCollisionsVel(CYTHON_UNUSE * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __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, 413, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self)) __PYX_ERR(0, 449, __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, 413, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 449, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":412 + /* "collisions.py":448 * This is a wrapper for `handleCollisionsPos` to handle velocity instead of position. * """ * if verbose: # <<<<<<<<<<<<<< @@ -17516,7 +18324,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_32handleCollisionsVel(CYTHON_UNUSE */ } - /* "collisions.py":414 + /* "collisions.py":450 * if verbose: * return self, vel, [] * return self, vel # <<<<<<<<<<<<<< @@ -17524,19 +18332,19 @@ static PyObject *__pyx_pf_10collisions_5Shape_32handleCollisionsVel(CYTHON_UNUSE * def copy(self) -> 'Shape': */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __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, 414, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self)) __PYX_ERR(0, 450, __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, 414, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 450, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":408 + /* "collisions.py":444 * return newP, vel * * def handleCollisionsVel(self, vel: pointLike, objs: Union['Shapes',Iterable['Shape']], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< @@ -17556,7 +18364,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_32handleCollisionsVel(CYTHON_UNUSE return __pyx_r; } -/* "collisions.py":416 +/* "collisions.py":452 * return self, vel * * def copy(self) -> 'Shape': # <<<<<<<<<<<<<< @@ -17565,16 +18373,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_32handleCollisionsVel(CYTHON_UNUSE */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_35copy(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_39copy(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_5Shape_34copy, "\n Copy this shape to return another with the same properties\n "); -static PyMethodDef __pyx_mdef_10collisions_5Shape_35copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_35copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_34copy}; -static PyObject *__pyx_pw_10collisions_5Shape_35copy(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Shape_38copy, "\n Copy this shape to return another with the same properties\n "); +static PyMethodDef __pyx_mdef_10collisions_5Shape_39copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_39copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Shape_38copy}; +static PyObject *__pyx_pw_10collisions_5Shape_39copy(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17618,12 +18426,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 452, __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, 416, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 452, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -17634,7 +18442,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, 416, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 452, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17648,7 +18456,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_34copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Shape_38copy(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -17661,7 +18469,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_34copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Shape_38copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -17674,7 +18482,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_34copy(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":420 + /* "collisions.py":456 * Copy this shape to return another with the same properties * """ * return Shape(self.bounciness) # <<<<<<<<<<<<<< @@ -17682,9 +18490,9 @@ static PyObject *__pyx_pf_10collisions_5Shape_34copy(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, 420, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __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, 420, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -17705,7 +18513,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_34copy(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, 420, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -17713,7 +18521,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_34copy(CYTHON_UNUSED PyObject *__p __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":416 + /* "collisions.py":452 * return self, vel * * def copy(self) -> 'Shape': # <<<<<<<<<<<<<< @@ -17735,7 +18543,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_34copy(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":422 +/* "collisions.py":458 * return Shape(self.bounciness) * * def __getitem__(self, it: int) -> None: # <<<<<<<<<<<<<< @@ -17744,15 +18552,15 @@ static PyObject *__pyx_pf_10collisions_5Shape_34copy(CYTHON_UNUSED PyObject *__p */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_37__getitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_41__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_5Shape_37__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_37__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Shape_37__getitem__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Shape_41__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_41__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Shape_41__getitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17799,7 +18607,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 422, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -17807,14 +18615,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 422, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 422, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 458, __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, 422, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -17827,7 +18635,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, 422, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17841,8 +18649,8 @@ 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, 422, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_5Shape_36__getitem__(__pyx_self, __pyx_v_self, __pyx_v_it); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_it), (&PyInt_Type), 0, "it", 1))) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_5Shape_40__getitem__(__pyx_self, __pyx_v_self, __pyx_v_it); /* function exit code */ goto __pyx_L0; @@ -17859,12 +18667,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_36__getitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_it) { +static PyObject *__pyx_pf_10collisions_5Shape_40__getitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_it) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":423 + /* "collisions.py":459 * * def __getitem__(self, it: int) -> None: * return 0 # <<<<<<<<<<<<<< @@ -17876,7 +18684,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_36__getitem__(CYTHON_UNUSED PyObje __pyx_r = __pyx_int_0; goto __pyx_L0; - /* "collisions.py":422 + /* "collisions.py":458 * return Shape(self.bounciness) * * def __getitem__(self, it: int) -> None: # <<<<<<<<<<<<<< @@ -17891,7 +18699,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_36__getitem__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":425 +/* "collisions.py":461 * return 0 * * def __setitem__(self, it: int, new: Number) -> None: # <<<<<<<<<<<<<< @@ -17900,15 +18708,15 @@ static PyObject *__pyx_pf_10collisions_5Shape_36__getitem__(CYTHON_UNUSED PyObje */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_39__setitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_43__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_5Shape_39__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_39__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Shape_39__setitem__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Shape_43__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_43__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Shape_43__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17958,7 +18766,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -17966,9 +18774,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 425, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 461, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -17976,14 +18784,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 425, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 461, __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, 425, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 461, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -17998,7 +18806,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, 425, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 461, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18012,8 +18820,8 @@ 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, 425, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_5Shape_38__setitem__(__pyx_self, __pyx_v_self, __pyx_v_it, __pyx_v_new); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_it), (&PyInt_Type), 0, "it", 1))) __PYX_ERR(0, 461, __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 */ goto __pyx_L0; @@ -18030,7 +18838,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_38__setitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_it, CYTHON_UNUSED PyObject *__pyx_v_new) { +static PyObject *__pyx_pf_10collisions_5Shape_42__setitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_it, CYTHON_UNUSED PyObject *__pyx_v_new) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__", 1); @@ -18042,7 +18850,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_38__setitem__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":428 +/* "collisions.py":464 * pass * * def __iter__(self): # <<<<<<<<<<<<<< @@ -18051,15 +18859,15 @@ static PyObject *__pyx_pf_10collisions_5Shape_38__setitem__(CYTHON_UNUSED PyObje */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_41__iter__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_45__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_5Shape_41__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_41__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Shape_41__iter__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Shape_45__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_45__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Shape_45__iter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18103,12 +18911,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 464, __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, 428, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 464, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18119,7 +18927,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, 428, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 464, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18133,7 +18941,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_40__iter__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Shape_44__iter__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -18146,7 +18954,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_40__iter__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Shape_44__iter__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -18156,7 +18964,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_40__iter__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":429 + /* "collisions.py":465 * * def __iter__(self): * return iter([]) # <<<<<<<<<<<<<< @@ -18164,16 +18972,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_40__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, 429, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __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":428 + /* "collisions.py":464 * pass * * def __iter__(self): # <<<<<<<<<<<<<< @@ -18193,7 +19001,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_40__iter__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":431 +/* "collisions.py":467 * return iter([]) * * def __str__(self): # <<<<<<<<<<<<<< @@ -18202,15 +19010,15 @@ static PyObject *__pyx_pf_10collisions_5Shape_40__iter__(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Shape_43__str__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Shape_47__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_5Shape_43__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_43__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Shape_43__str__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Shape_47__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Shape_47__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Shape_47__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18254,12 +19062,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __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, 431, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 467, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18270,7 +19078,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, 431, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 467, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18284,7 +19092,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Shape_42__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Shape_46__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -18297,12 +19105,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Shape_42__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Shape_46__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":432 + /* "collisions.py":468 * * def __str__(self): * return '' # <<<<<<<<<<<<<< @@ -18314,7 +19122,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_42__str__(CYTHON_UNUSED PyObject * __pyx_r = __pyx_kp_u_Shape_2; goto __pyx_L0; - /* "collisions.py":431 + /* "collisions.py":467 * return iter([]) * * def __str__(self): # <<<<<<<<<<<<<< @@ -18329,7 +19137,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_42__str__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":436 +/* "collisions.py":472 * 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): # <<<<<<<<<<<<<< @@ -18390,12 +19198,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 472, __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, 436, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 472, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18406,7 +19214,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, 436, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 472, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18445,7 +19253,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape___init__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":437 + /* "collisions.py":473 * """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) # <<<<<<<<<<<<<< @@ -18453,20 +19261,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, 437, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 473, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __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, 437, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 473, __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, 437, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 473, __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, 437, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __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, 437, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -18487,13 +19295,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, 437, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __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":436 + /* "collisions.py":472 * 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): # <<<<<<<<<<<<<< @@ -18516,7 +19324,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape___init__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":439 +/* "collisions.py":475 * super().__init__(0) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -18580,7 +19388,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -18588,14 +19396,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 439, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 475, __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, 439, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 475, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -18608,7 +19416,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, 439, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 475, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18640,7 +19448,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_2_collides(CYTHON_UNUSED PyObjec __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_collides", 1); - /* "collisions.py":440 + /* "collisions.py":476 * * def _collides(self, othershape: Shape) -> bool: * return False # <<<<<<<<<<<<<< @@ -18652,7 +19460,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_2_collides(CYTHON_UNUSED PyObjec __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":439 + /* "collisions.py":475 * super().__init__(0) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -18667,7 +19475,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_2_collides(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":442 +/* "collisions.py":478 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -18731,7 +19539,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -18739,14 +19547,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 442, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 478, __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, 442, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 478, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -18759,7 +19567,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, 442, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 478, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18795,21 +19603,21 @@ static PyObject *__pyx_pf_10collisions_7NoShape_4_where(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":443 + /* "collisions.py":479 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: * return [] # <<<<<<<<<<<<<< * - * def area(self) -> Number: + * def _contains(self, othershape: 'Shape') -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":442 + /* "collisions.py":478 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -18828,25 +19636,24 @@ static PyObject *__pyx_pf_10collisions_7NoShape_4_where(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":445 +/* "collisions.py":481 * return [] * - * def area(self) -> Number: # <<<<<<<<<<<<<< - * """ - * Gets the area of the shape; 0. + * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< + * return False + * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_7NoShape_7area(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_7NoShape_7_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*/ -PyDoc_STRVAR(__pyx_doc_10collisions_7NoShape_6area, "\n Gets the area of the shape; 0.\n\n Returns:\n Number: The area of the shape\n "); -static PyMethodDef __pyx_mdef_10collisions_7NoShape_7area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_7NoShape_7area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_7NoShape_6area}; -static PyObject *__pyx_pw_10collisions_7NoShape_7area(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_7NoShape_7_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_7NoShape_7_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_7NoShape_7_contains(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18854,17 +19661,18 @@ 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[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("area (wrapper)", 0); + __Pyx_RefNannySetupContext("_contains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -18874,10 +19682,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_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; @@ -18890,23 +19700,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 445, __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: + 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, 481, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_contains", 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, "area") < 0)) __PYX_ERR(0, 445, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 481, __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_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 445, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18916,11 +19738,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.NoShape.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.NoShape._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_7NoShape_6area(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_7NoShape_6_contains(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -18933,29 +19755,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_7NoShape_6area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_7NoShape_6_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("area", 1); + __Pyx_RefNannySetupContext("_contains", 1); - /* "collisions.py":452 - * Number: The area of the shape - * """ - * return 0 # <<<<<<<<<<<<<< + /* "collisions.py":482 * - * def copy(self) -> 'NoShape': + * def _contains(self, othershape: 'Shape') -> bool: + * return False # <<<<<<<<<<<<<< + * + * def area(self) -> Number: */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_int_0); - __pyx_r = __pyx_int_0; + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":445 + /* "collisions.py":481 * return [] * - * def area(self) -> Number: # <<<<<<<<<<<<<< - * """ - * Gets the area of the shape; 0. + * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< + * return False + * */ /* function exit code */ @@ -18965,25 +19787,25 @@ static PyObject *__pyx_pf_10collisions_7NoShape_6area(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":454 - * return 0 +/* "collisions.py":484 + * return False * - * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< - * """Make a copy of this non-existant shape""" - * return NoShape() + * def area(self) -> Number: # <<<<<<<<<<<<<< + * """ + * Gets the area of the shape; 0. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_7NoShape_9copy(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_7NoShape_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_7NoShape_8copy, "Make a copy of this non-existant shape"); -static PyMethodDef __pyx_mdef_10collisions_7NoShape_9copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_7NoShape_9copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_7NoShape_8copy}; -static PyObject *__pyx_pw_10collisions_7NoShape_9copy(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_7NoShape_8area, "\n Gets the area of the shape; 0.\n\n Returns:\n Number: The area of the shape\n "); +static PyMethodDef __pyx_mdef_10collisions_7NoShape_9area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_7NoShape_9area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_7NoShape_8area}; +static PyObject *__pyx_pw_10collisions_7NoShape_9area(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19001,7 +19823,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __Pyx_RefNannySetupContext("area (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -19027,12 +19849,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, 484, __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, "area") < 0)) __PYX_ERR(0, 484, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19043,7 +19865,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("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 484, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19053,11 +19875,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.NoShape.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.NoShape.area", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_7NoShape_8copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_7NoShape_8area(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -19070,93 +19892,230 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_7NoShape_8copy(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_7NoShape_8area(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); + __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":456 - * def copy(self) -> 'NoShape': - * """Make a copy of this non-existant shape""" - * return NoShape() # <<<<<<<<<<<<<< + /* "collisions.py":491 + * Number: The area of the shape + * """ + * return 0 # <<<<<<<<<<<<<< * - * def __str__(self): + * def copy(self) -> 'NoShape': */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __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, 456, __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(__pyx_int_0); + __pyx_r = __pyx_int_0; goto __pyx_L0; - /* "collisions.py":454 - * return 0 + /* "collisions.py":484 + * return False * - * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< - * """Make a copy of this non-existant shape""" - * return NoShape() + * def area(self) -> Number: # <<<<<<<<<<<<<< + * """ + * 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.NoShape.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":458 - * return NoShape() - * - * def __str__(self): # <<<<<<<<<<<<<< - * return '' +/* "collisions.py":493 + * return 0 * + * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< + * """Make a copy of this non-existant shape""" + * return NoShape() */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_7NoShape_11__str__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_7NoShape_11copy(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_11__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_7NoShape_11__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_7NoShape_11__str__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_7NoShape_10copy, "Make a copy of this non-existant shape"); +static PyMethodDef __pyx_mdef_10collisions_7NoShape_11copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_7NoShape_11copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_7NoShape_10copy}; +static PyObject *__pyx_pw_10collisions_7NoShape_11copy(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("copy (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, 493, __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, 493, __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, 493, __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":495 + * 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, 495, __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, 495, __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":493 + * 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":497 + * 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 @@ -19200,12 +20159,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 497, __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, 458, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 497, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19216,7 +20175,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, 458, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 497, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19230,7 +20189,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_7NoShape_10__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_7NoShape_12__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -19243,12 +20202,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_7NoShape_10__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_7NoShape_12__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":459 + /* "collisions.py":498 * * def __str__(self): * return '' # <<<<<<<<<<<<<< @@ -19260,7 +20219,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_10__str__(CYTHON_UNUSED PyObject __pyx_r = __pyx_kp_u_NoShape_2; goto __pyx_L0; - /* "collisions.py":458 + /* "collisions.py":497 * return NoShape() * * def __str__(self): # <<<<<<<<<<<<<< @@ -19275,9 +20234,9 @@ static PyObject *__pyx_pf_10collisions_7NoShape_10__str__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":464 - * """A class which holds multiple shapes and can be used to do things with all of them at once.""" - * GROUPS = [ShpGroups.GROUP] +/* "collisions.py":504 + * GROUPS = {ShpGroups.GROUP} + * TYPE = ShpTyps.Group * def __init__(self, *shapes: Shape): # <<<<<<<<<<<<<< * """ * Args: @@ -19344,13 +20303,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 504, __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, "__init__") < 0)) __PYX_ERR(0, 464, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 504, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; @@ -19361,7 +20320,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 464, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 504, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19399,21 +20358,21 @@ static PyObject *__pyx_pf_10collisions_6Shapes___init__(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":472 + /* "collisions.py":512 * `Shapes(Shape1, Shape2)` OR `Shapes(*[Shape1, Shape2])` * """ * 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, 472, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_v_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __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, 472, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shapes, __pyx_t_1) < 0) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":464 - * """A class which holds multiple shapes and can be used to do things with all of them at once.""" - * GROUPS = [ShpGroups.GROUP] + /* "collisions.py":504 + * GROUPS = {ShpGroups.GROUP} + * TYPE = ShpTyps.Group * def __init__(self, *shapes: Shape): # <<<<<<<<<<<<<< * """ * Args: @@ -19432,7 +20391,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes___init__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":474 +/* "collisions.py":514 * self.shapes = list(shapes) * * def add_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< @@ -19497,7 +20456,7 @@ 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, 514, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -19505,14 +20464,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("add_shape", 1, 2, 2, 1); __PYX_ERR(0, 474, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_shape", 1, 2, 2, 1); __PYX_ERR(0, 514, __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, 474, __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, 514, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -19525,7 +20484,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, 474, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_shape", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 514, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19562,19 +20521,19 @@ static PyObject *__pyx_pf_10collisions_6Shapes_2add_shape(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_shape", 1); - /* "collisions.py":481 + /* "collisions.py":521 * 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, 481, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __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, 481, __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, 521, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":474 + /* "collisions.py":514 * self.shapes = list(shapes) * * def add_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< @@ -19595,7 +20554,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_2add_shape(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":483 +/* "collisions.py":523 * self.shapes.append(shape) * * def add_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< @@ -19664,13 +20623,13 @@ 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, 523, __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, 483, __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, 523, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; @@ -19681,7 +20640,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, 483, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_shapes", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 523, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19723,19 +20682,19 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4add_shapes(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_shapes", 1); - /* "collisions.py":493 + /* "collisions.py":533 * `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, 493, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __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, 493, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __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, 493, __pyx_L1_error) + __pyx_t_2 = PySequence_List(__pyx_v_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -19756,13 +20715,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, 493, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __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":483 + /* "collisions.py":523 * self.shapes.append(shape) * * def add_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< @@ -19786,7 +20745,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4add_shapes(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":495 +/* "collisions.py":535 * self.shapes.extend(list(shapes)) * * def remove_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< @@ -19851,7 +20810,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -19859,14 +20818,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("remove_shape", 1, 2, 2, 1); __PYX_ERR(0, 495, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remove_shape", 1, 2, 2, 1); __PYX_ERR(0, 535, __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, 495, __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, 535, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -19879,7 +20838,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, 495, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remove_shape", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 535, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19918,16 +20877,16 @@ static PyObject *__pyx_pf_10collisions_6Shapes_6remove_shape(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_shape", 1); - /* "collisions.py":502 + /* "collisions.py":542 * 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, 502, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __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, 502, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -19948,13 +20907,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, 502, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __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":495 + /* "collisions.py":535 * self.shapes.extend(list(shapes)) * * def remove_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< @@ -19977,7 +20936,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_6remove_shape(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":504 +/* "collisions.py":544 * self.shapes.remove(shape) * * def remove_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< @@ -20046,13 +21005,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 544, __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, 504, __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, 544, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; @@ -20063,7 +21022,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, 504, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remove_shapes", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 544, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20107,7 +21066,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_shapes", 1); - /* "collisions.py":514 + /* "collisions.py":554 * `shapes.remove_shapes(Shape1, Shape2)` OR `shapes.remove_shapes(*[Shape1, Shape2])` * """ * for s in shapes: # <<<<<<<<<<<<<< @@ -20120,29 +21079,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, 514, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 554, __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, 514, __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, 554, __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, 514, __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, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":515 + /* "collisions.py":555 * """ * for s in shapes: * self.shapes.remove(s) # <<<<<<<<<<<<<< * - * def collides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> bool: + * 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, 515, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __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, 515, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -20163,13 +21122,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, 515, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __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":514 + /* "collisions.py":554 * `shapes.remove_shapes(Shape1, Shape2)` OR `shapes.remove_shapes(*[Shape1, Shape2])` * """ * for s in shapes: # <<<<<<<<<<<<<< @@ -20179,7 +21138,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyOb } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":504 + /* "collisions.py":544 * self.shapes.remove(shape) * * def remove_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< @@ -20204,10 +21163,10 @@ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyOb return __pyx_r; } -/* "collisions.py":517 +/* "collisions.py":557 * self.shapes.remove(s) * - * def collides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< + * 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). */ @@ -20269,7 +21228,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 557, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -20277,14 +21236,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 557, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, 1); __PYX_ERR(0, 517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, 1); __PYX_ERR(0, 557, __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, 517, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collides") < 0)) __PYX_ERR(0, 557, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -20297,7 +21256,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, 517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 557, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20341,23 +21300,23 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collides", 1); - /* "collisions.py":527 + /* "collisions.py":567 * 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, 527, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __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, 527, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __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, 527, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20366,28 +21325,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, 527, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 567, __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, 527, __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, 567, __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, 527, __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, 567, __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, 527, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 567, __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, 527, __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, 567, __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, 527, __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, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -20397,7 +21356,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, 527, __pyx_L1_error) + else __PYX_ERR(0, 567, __pyx_L1_error) } break; } @@ -20406,14 +21365,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":528 + /* "collisions.py":568 * """ * 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, 528, __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, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -20433,15 +21392,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, 528, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __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, 528, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { - /* "collisions.py":529 + /* "collisions.py":569 * for s in self.shapes: * if s.collides(shapes): * return True # <<<<<<<<<<<<<< @@ -20454,7 +21413,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":528 + /* "collisions.py":568 * """ * for s in self.shapes: * if s.collides(shapes): # <<<<<<<<<<<<<< @@ -20463,7 +21422,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject */ } - /* "collisions.py":527 + /* "collisions.py":567 * bool: True if *any* of the shapes in this object collide with *any* of the input shapes * """ * for s in self.shapes: # <<<<<<<<<<<<<< @@ -20473,22 +21432,22 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":530 + /* "collisions.py":570 * if s.collides(shapes): * return True * return False # <<<<<<<<<<<<<< * - * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> Iterable[pointLike]: + * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> Iterable[pointLike]: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":517 + /* "collisions.py":557 * self.shapes.remove(s) * - * def collides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< + * 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). */ @@ -20508,10 +21467,10 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":532 +/* "collisions.py":572 * return False * - * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Find the points where this object collides with the input shape(s). */ @@ -20573,7 +21532,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -20581,14 +21540,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, 1); __PYX_ERR(0, 532, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, 1); __PYX_ERR(0, 572, __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, 532, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "whereCollides") < 0)) __PYX_ERR(0, 572, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -20601,7 +21560,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, 532, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 572, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20646,35 +21605,35 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("whereCollides", 1); - /* "collisions.py":542 + /* "collisions.py":582 * 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, 542, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_points = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":543 + /* "collisions.py":583 * """ * 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, 543, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __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, 543, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __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, 543, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20683,28 +21642,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, 543, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 583, __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, 543, __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, 583, __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, 543, __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, 583, __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, 543, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 583, __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, 543, __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, 583, __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, 543, __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, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -20714,7 +21673,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, 543, __pyx_L1_error) + else __PYX_ERR(0, 583, __pyx_L1_error) } break; } @@ -20723,14 +21682,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":544 + /* "collisions.py":584 * 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, 544, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -20750,14 +21709,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, 544, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __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, 544, __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, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":543 + /* "collisions.py":583 * """ * points = [] * for s in self.shapes: # <<<<<<<<<<<<<< @@ -20767,7 +21726,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":545 + /* "collisions.py":585 * for s in self.shapes: * points.extend(s.whereCollides(shapes)) * return points # <<<<<<<<<<<<<< @@ -20779,10 +21738,10 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO __pyx_r = __pyx_v_points; goto __pyx_L0; - /* "collisions.py":532 + /* "collisions.py":572 * return False * - * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Find the points where this object collides with the input shape(s). */ @@ -20803,7 +21762,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":547 +/* "collisions.py":587 * return points * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -20872,7 +21831,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -20880,21 +21839,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 547, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 587, __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, 547, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 587, __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, 547, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 587, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -20912,7 +21871,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, 547, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 587, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20958,35 +21917,35 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("closestPointTo", 1); - /* "collisions.py":559 + /* "collisions.py":599 * 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, 559, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_points = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":560 + /* "collisions.py":600 * """ * 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, 560, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __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, 560, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __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, 560, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20995,28 +21954,28 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(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, 560, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 600, __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, 560, __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, 600, __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, 560, __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, 600, __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, 560, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 600, __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, 560, __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, 600, __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, 560, __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, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -21026,7 +21985,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(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, 560, __pyx_L1_error) + else __PYX_ERR(0, 600, __pyx_L1_error) } break; } @@ -21035,24 +21994,24 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED Py __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":561 + /* "collisions.py":601 * 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, 561, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 601, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":562 + /* "collisions.py":602 * 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, 562, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -21072,14 +22031,14 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED Py 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, 562, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __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, 562, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":561 + /* "collisions.py":601 * points = [] * for s in self.shapes: * if returnAll: # <<<<<<<<<<<<<< @@ -21089,7 +22048,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED Py goto __pyx_L5; } - /* "collisions.py":564 + /* "collisions.py":604 * points.extend(s.closestPointTo(othershape, True)) * else: * points.append(s.closestPointTo(othershape, False)) # <<<<<<<<<<<<<< @@ -21097,7 +22056,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED Py * */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 564, __pyx_L1_error) + __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; @@ -21117,16 +22076,16 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED Py 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, 564, __pyx_L1_error) + 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_Append(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__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; } __pyx_L5:; - /* "collisions.py":560 + /* "collisions.py":600 * """ * points = [] * for s in self.shapes: # <<<<<<<<<<<<<< @@ -21136,19 +22095,19 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED Py } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":565 + /* "collisions.py":605 * else: * points.append(s.closestPointTo(othershape, False)) * return points # <<<<<<<<<<<<<< * - * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) + * 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":547 + /* "collisions.py":587 * return points * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -21172,64 +22131,25 @@ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED Py return __pyx_r; } -/* "collisions.py":569 - * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) +/* "collisions.py":607 + * return points * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> Dict[Union[Shape,'Shapes'], bool]: # <<<<<<<<<<<<<< + * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< * """ - * Takes each object and finds whether the input point is on the corner of that object. + * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that. */ -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, 569, __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, 569, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __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, 569, __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, 569, __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_17isCorner(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_16isCorner, "\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_17isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_17isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_16isCorner}; -static PyObject *__pyx_pw_10collisions_6Shapes_17isCorner(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 @@ -21237,19 +22157,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_point = 0; - PyObject *__pyx_v_precision = 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("isCorner (wrapper)", 0); + __Pyx_RefNannySetupContext("isContaining (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -21259,14 +22178,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_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); + 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); @@ -21281,47 +22196,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 607, __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, 569, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 607, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 569, __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, 569, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, 1); __PYX_ERR(0, 607, __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, 569, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isContaining") < 0)) __PYX_ERR(0, 607, __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_point = values[1]; - __pyx_v_precision = values[2]; + __pyx_v_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 569, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 607, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21331,11 +22234,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shapes.isCorner", __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_16isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); + __pyx_r = __pyx_pf_10collisions_6Shapes_16isContaining(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -21348,8 +22251,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(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_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 @@ -21360,40 +22262,29 @@ static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(CYTHON_UNUSED 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("isCorner", 1); + __Pyx_RefNannySetupContext("isContaining", 1); - /* "collisions.py":580 - * dict[Shape / Shapes: bool]: A dictionary of each object in this and whether the point is a corner on it or not. + /* "collisions.py":617 + * bool: Whether the shape is fully enclosed within this shape. * """ - * cs = {} # <<<<<<<<<<<<<< - * for s in self.shapes: - * cs[s] = s.isCorner(point, precision) - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_cs = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":581 - * """ - * cs = {} * for s in self.shapes: # <<<<<<<<<<<<<< - * cs[s] = s.isCorner(point, precision) - * return cs + * 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, 581, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __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, 581, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __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, 581, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -21402,28 +22293,28 @@ static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(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, 581, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 617, __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, 581, __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, 617, __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, 581, __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, 617, __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, 581, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 617, __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, 581, __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, 617, __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, 581, __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, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -21433,7 +22324,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(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, 581, __pyx_L1_error) + else __PYX_ERR(0, 617, __pyx_L1_error) } break; } @@ -21442,14 +22333,386 @@ static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":582 + /* "collisions.py":618 + * """ + * 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, 618, __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, 618, __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, 618, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_8) { + + /* "collisions.py":619 + * 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":618 + * """ + * for s in self.shapes: + * if s.isContaining(othershape): # <<<<<<<<<<<<<< + * return True + * return False + */ + } + + /* "collisions.py":617 + * bool: Whether the shape is fully enclosed within this shape. + * """ + * for s in self.shapes: # <<<<<<<<<<<<<< + * if s.isContaining(othershape): + * return True + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":620 + * if s.isContaining(othershape): + * return True + * return False # <<<<<<<<<<<<<< + * + * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "collisions.py":607 + * 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. + */ + + /* 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.isContaining", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":624 + * # 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. + */ + +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, 624, __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, 624, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __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, 624, __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, 624, __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, 624, __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, 624, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 624, __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, 624, __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, 624, __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, 624, __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; + 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isCorner", 1); + + /* "collisions.py":635 + * dict[Shape / Shapes: bool]: A dictionary of each object in this and whether the point is a corner on it or not. + * """ + * cs = {} # <<<<<<<<<<<<<< + * for s in self.shapes: + * cs[s] = s.isCorner(point, precision) + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":636 + * """ + * cs = {} + * for s in self.shapes: # <<<<<<<<<<<<<< + * cs[s] = s.isCorner(point, precision) + * return cs + */ + __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, 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, 636, __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, 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, 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, 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, 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, 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, 636, __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, 636, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":637 * cs = {} * for s in self.shapes: * cs[s] = s.isCorner(point, precision) # <<<<<<<<<<<<<< * return cs * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_isCorner); 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; @@ -21469,14 +22732,14 @@ static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(CYTHON_UNUSED PyObject 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, 582, __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; } - if (unlikely((PyDict_SetItem(__pyx_v_cs, __pyx_v_s, __pyx_t_1) < 0))) __PYX_ERR(0, 582, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_cs, __pyx_v_s, __pyx_t_1) < 0))) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":581 + /* "collisions.py":636 * """ * cs = {} * for s in self.shapes: # <<<<<<<<<<<<<< @@ -21486,7 +22749,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(CYTHON_UNUSED PyObject } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":583 + /* "collisions.py":638 * for s in self.shapes: * cs[s] = s.isCorner(point, precision) * return cs # <<<<<<<<<<<<<< @@ -21498,7 +22761,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_cs; goto __pyx_L0; - /* "collisions.py":569 + /* "collisions.py":624 * # 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]: # <<<<<<<<<<<<<< @@ -21522,7 +22785,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":585 +/* "collisions.py":640 * return cs * * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -21531,16 +22794,16 @@ static PyObject *__pyx_pf_10collisions_6Shapes_16isCorner(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_19tangent(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_18tangent, "\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_19tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_19tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_18tangent}; -static PyObject *__pyx_pw_10collisions_6Shapes_19tangent(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 @@ -21590,7 +22853,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -21598,9 +22861,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 585, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 640, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -21608,14 +22871,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 585, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 640, __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, 585, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 640, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -21630,7 +22893,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, 585, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 640, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21644,7 +22907,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_18tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); + __pyx_r = __pyx_pf_10collisions_6Shapes_20tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); /* function exit code */ { @@ -21657,7 +22920,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel) { +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; @@ -21675,35 +22938,35 @@ static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tangent", 1); - /* "collisions.py":596 + /* "collisions.py":651 * 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, 596, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_points = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":597 + /* "collisions.py":652 * """ * 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, 597, __pyx_L1_error) + __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_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __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, 597, __pyx_L1_error) + __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 (;;) { @@ -21712,28 +22975,28 @@ static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(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, 597, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 652, __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, 597, __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_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __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, 652, __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, 597, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 652, __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, 597, __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_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __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, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -21743,7 +23006,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(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, 597, __pyx_L1_error) + else __PYX_ERR(0, 652, __pyx_L1_error) } break; } @@ -21752,14 +23015,14 @@ static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":598 + /* "collisions.py":653 * 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, 598, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_tangent); 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; @@ -21779,14 +23042,14 @@ static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(CYTHON_UNUSED PyObject 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, 598, __pyx_L1_error) + 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_t_8 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":597 + /* "collisions.py":652 * """ * points = [] * for s in self.shapes: # <<<<<<<<<<<<<< @@ -21796,7 +23059,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(CYTHON_UNUSED PyObject } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":599 + /* "collisions.py":654 * for s in self.shapes: * points.append(s.tangent(point, vel)) * return points # <<<<<<<<<<<<<< @@ -21808,7 +23071,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(CYTHON_UNUSED PyObject __pyx_r = __pyx_v_points; goto __pyx_L0; - /* "collisions.py":585 + /* "collisions.py":640 * return cs * * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -21832,7 +23095,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":605 +/* "collisions.py":660 * # TODO: to_points and to_lines * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -21841,16 +23104,16 @@ static PyObject *__pyx_pf_10collisions_6Shapes_18tangent(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_21area(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_23area(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_20area, "\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_21area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_21area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_20area}; -static PyObject *__pyx_pw_10collisions_6Shapes_21area(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21894,12 +23157,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 660, __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, 605, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 660, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -21910,7 +23173,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, 605, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 660, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21924,7 +23187,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_20area(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_22area(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -21938,7 +23201,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":612 +/* "collisions.py":667 * Number: The sum of all the areas of the shapes. * """ * return sum(s.area() for s in self.shapes) # <<<<<<<<<<<<<< @@ -21958,7 +23221,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4area_genexpr(CYTHON_UNUSED PyObj 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, 612, __pyx_L1_error) + __PYX_ERR(0, 667, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -21966,7 +23229,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4area_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_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, 612, __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, 667, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -22006,16 +23269,16 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineO return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 612, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 612, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 667, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 667, __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, 612, __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, 667, __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, 612, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -22023,28 +23286,28 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineO { 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, 612, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 667, __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, 612, __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, 667, __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, 612, __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, 667, __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, 612, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 667, __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, 612, __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, 667, __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, 612, __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, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -22054,7 +23317,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineO PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 612, __pyx_L1_error) + else __PYX_ERR(0, 667, __pyx_L1_error) } break; } @@ -22064,7 +23327,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineO __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, 612, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_area); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -22084,7 +23347,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineO 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, 612, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -22106,7 +23369,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineO __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, 612, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 667, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -22132,7 +23395,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineO return __pyx_r; } -/* "collisions.py":605 +/* "collisions.py":660 * # TODO: to_points and to_lines * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -22140,7 +23403,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineO * Gets the combined area of all the shapes. */ -static PyObject *__pyx_pf_10collisions_6Shapes_20area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +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 @@ -22151,7 +23414,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20area(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":612 + /* "collisions.py":667 * Number: The sum of all the areas of the shapes. * """ * return sum(s.area() for s in self.shapes) # <<<<<<<<<<<<<< @@ -22159,19 +23422,19 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20area(CYTHON_UNUSED PyObject *__ * def rect(self) -> Iterable[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, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __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, 612, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_6Shapes_4area_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __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, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __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":605 + /* "collisions.py":660 * # TODO: to_points and to_lines * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -22192,7 +23455,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20area(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":614 +/* "collisions.py":669 * return sum(s.area() for s in self.shapes) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -22201,16 +23464,16 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20area(CYTHON_UNUSED PyObject *__ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_23rect(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_25rect(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_22rect, "\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_23rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_23rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_22rect}; -static PyObject *__pyx_pw_10collisions_6Shapes_23rect(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -22254,12 +23517,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 669, __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, 614, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 669, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -22270,7 +23533,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, 614, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 669, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22284,7 +23547,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_22rect(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_24rect(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -22298,7 +23561,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_6Shapes_4rect_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":622 +/* "collisions.py":677 * """ * 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) # <<<<<<<<<<<<<< @@ -22318,7 +23581,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_genexpr(CYTHON_UNUSED PyObj 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, 622, __pyx_L1_error) + __PYX_ERR(0, 677, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -22326,7 +23589,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_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_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, 622, __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, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -22362,29 +23625,29 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_2generator1(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 622, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 622, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 677, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 677, __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, 622, __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, 677, __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, 622, __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, 677, __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, 622, __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, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -22402,7 +23665,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_2generator1(__pyx_Coroutine __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, 622, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 677, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -22439,7 +23702,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_3genexpr(CYTHON_UNUSED PyOb 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, 622, __pyx_L1_error) + __PYX_ERR(0, 677, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -22447,7 +23710,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_3genexpr(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_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, 622, __pyx_L1_error) + __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, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -22483,29 +23746,29 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_5generator2(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 622, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 622, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 677, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 677, __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, 622, __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, 677, __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, 622, __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, 677, __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, 622, __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, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -22523,7 +23786,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_5generator2(__pyx_Coroutine __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, 622, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 677, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -22560,7 +23823,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_6genexpr(CYTHON_UNUSED PyOb 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, 622, __pyx_L1_error) + __PYX_ERR(0, 677, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -22568,7 +23831,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, 622, __pyx_L1_error) + __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, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -22604,29 +23867,29 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_8generator3(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 622, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 622, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 677, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 677, __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, 622, __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, 677, __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, 622, __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, 677, __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, 622, __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, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -22644,7 +23907,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_8generator3(__pyx_Coroutine __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, 622, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 677, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -22681,7 +23944,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_9genexpr(CYTHON_UNUSED PyOb 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, 622, __pyx_L1_error) + __PYX_ERR(0, 677, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -22689,7 +23952,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_9genexpr(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_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, 622, __pyx_L1_error) + __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, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -22725,29 +23988,29 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_Coroutin return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 622, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 622, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 677, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 677, __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, 622, __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, 677, __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, 622, __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, 677, __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, 622, __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, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -22765,7 +24028,7 @@ 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, 622, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 677, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -22789,7 +24052,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_Coroutin return __pyx_r; } -/* "collisions.py":614 +/* "collisions.py":669 * return sum(s.area() for s in self.shapes) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -22797,7 +24060,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_Coroutin * Returns the rectangle bounding box surrounding every one of these objects. */ -static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +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; @@ -22819,7 +24082,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":621 + /* "collisions.py":676 * Iterable[Number]: (min x, min y, max x, max y) * """ * rs = [s.rect() for s in self.shapes] # <<<<<<<<<<<<<< @@ -22827,18 +24090,18 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__ * */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __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, 621, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __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, 621, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __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, 621, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -22847,28 +24110,28 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(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, 621, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 676, __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, 621, __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, 676, __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, 621, __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, 676, __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, 621, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 676, __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, 621, __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, 676, __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, 621, __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, 676, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -22878,7 +24141,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(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, 621, __pyx_L5_error) + else __PYX_ERR(0, 676, __pyx_L5_error) } break; } @@ -22886,7 +24149,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__ } __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, 621, __pyx_L5_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_s, __pyx_n_s_rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -22906,11 +24169,11 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__ 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, 621, __pyx_L5_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __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, 621, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 676, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22924,7 +24187,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__ __pyx_v_rs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":622 + /* "collisions.py":677 * """ * 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) # <<<<<<<<<<<<<< @@ -22932,36 +24195,36 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__ * def copy(self) -> 'Shapes': */ __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, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_3genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_6genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_9genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 677, __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, 622, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __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, 622, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(0, 622, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(0, 677, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7)) __PYX_ERR(0, 622, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7)) __PYX_ERR(0, 677, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_6 = 0; @@ -22970,7 +24233,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":614 + /* "collisions.py":669 * return sum(s.area() for s in self.shapes) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -22999,7 +24262,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":624 +/* "collisions.py":679 * 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': # <<<<<<<<<<<<<< @@ -23008,16 +24271,16 @@ static PyObject *__pyx_pf_10collisions_6Shapes_22rect(CYTHON_UNUSED PyObject *__ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_25copy(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_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_6Shapes_24copy, "\n Make a copy of this class with a copy of each shape in it.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Shapes_25copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_25copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_24copy}; -static PyObject *__pyx_pw_10collisions_6Shapes_25copy(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -23061,12 +24324,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 679, __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, 624, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 679, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -23077,7 +24340,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, 624, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 679, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23091,7 +24354,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_24copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_26copy(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -23105,7 +24368,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":628 +/* "collisions.py":683 * Make a copy of this class with a copy of each shape in it. * """ * return Shapes(s.copy() for s in self.shapes) # <<<<<<<<<<<<<< @@ -23125,7 +24388,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4copy_genexpr(CYTHON_UNUSED PyObj 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, 628, __pyx_L1_error) + __PYX_ERR(0, 683, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -23133,7 +24396,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, 628, __pyx_L1_error) + __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, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -23173,16 +24436,16 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 628, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 628, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 683, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 683, __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, 628, __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, 683, __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, 628, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -23190,28 +24453,28 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine { 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, 628, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 683, __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, 628, __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, 683, __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, 628, __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, 683, __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, 628, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 683, __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, 628, __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, 683, __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, 628, __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, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -23221,7 +24484,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 628, __pyx_L1_error) + else __PYX_ERR(0, 683, __pyx_L1_error) } break; } @@ -23231,7 +24494,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine __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, 628, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -23251,7 +24514,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine 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, 628, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -23273,7 +24536,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine __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, 628, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 683, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -23299,7 +24562,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine return __pyx_r; } -/* "collisions.py":624 +/* "collisions.py":679 * 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': # <<<<<<<<<<<<<< @@ -23307,7 +24570,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine * Make a copy of this class with a copy of each shape in it. */ -static PyObject *__pyx_pf_10collisions_6Shapes_24copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_26copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -23321,7 +24584,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_24copy(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":628 + /* "collisions.py":683 * Make a copy of this class with a copy of each shape in it. * """ * return Shapes(s.copy() for s in self.shapes) # <<<<<<<<<<<<<< @@ -23329,11 +24592,11 @@ static PyObject *__pyx_pf_10collisions_6Shapes_24copy(CYTHON_UNUSED PyObject *__ * 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, 628, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __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, 628, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __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, 628, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10collisions_6Shapes_4copy_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -23355,7 +24618,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_24copy(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_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -23363,7 +24626,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_24copy(CYTHON_UNUSED PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":624 + /* "collisions.py":679 * 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': # <<<<<<<<<<<<<< @@ -23386,7 +24649,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_24copy(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":630 +/* "collisions.py":685 * return Shapes(s.copy() for s in self.shapes) * * def copy_leave_shapes(self) -> 'Shapes': # <<<<<<<<<<<<<< @@ -23395,16 +24658,16 @@ static PyObject *__pyx_pf_10collisions_6Shapes_24copy(CYTHON_UNUSED PyObject *__ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_27copy_leave_shapes(PyObject *__pyx_self, +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_26copy_leave_shapes, "\n Makes a copy of this class but keeps the same shapes.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Shapes_27copy_leave_shapes = {"copy_leave_shapes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_27copy_leave_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_26copy_leave_shapes}; -static PyObject *__pyx_pw_10collisions_6Shapes_27copy_leave_shapes(PyObject *__pyx_self, +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 @@ -23448,12 +24711,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L3_error) + 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, "copy_leave_shapes") < 0)) __PYX_ERR(0, 630, __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, 685, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -23464,7 +24727,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy_leave_shapes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 630, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy_leave_shapes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 685, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23478,7 +24741,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_26copy_leave_shapes(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_28copy_leave_shapes(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -23491,7 +24754,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_26copy_leave_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_28copy_leave_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -23502,7 +24765,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_26copy_leave_shapes(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_leave_shapes", 1); - /* "collisions.py":634 + /* "collisions.py":689 * Makes a copy of this class but keeps the same shapes. * """ * return Shapes(*self.shapes) # <<<<<<<<<<<<<< @@ -23510,14 +24773,14 @@ static PyObject *__pyx_pf_10collisions_6Shapes_26copy_leave_shapes(CYTHON_UNUSED * def __iter__(self): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __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, 634, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __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, 634, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __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, 634, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __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; @@ -23525,7 +24788,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_26copy_leave_shapes(CYTHON_UNUSED __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":630 + /* "collisions.py":685 * return Shapes(s.copy() for s in self.shapes) * * def copy_leave_shapes(self) -> 'Shapes': # <<<<<<<<<<<<<< @@ -23546,7 +24809,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_26copy_leave_shapes(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":636 +/* "collisions.py":691 * return Shapes(*self.shapes) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -23555,15 +24818,15 @@ static PyObject *__pyx_pf_10collisions_6Shapes_26copy_leave_shapes(CYTHON_UNUSED */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_29__iter__(PyObject *__pyx_self, +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_29__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_29__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_29__iter__(PyObject *__pyx_self, +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 @@ -23607,12 +24870,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 691, __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, 636, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 691, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -23623,7 +24886,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, 636, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 691, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23637,7 +24900,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_28__iter__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_30__iter__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -23650,7 +24913,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_28__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_30__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -23660,24 +24923,24 @@ static PyObject *__pyx_pf_10collisions_6Shapes_28__iter__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":637 + /* "collisions.py":692 * * def __iter__(self): * return iter(self.shapes) # <<<<<<<<<<<<<< * - * def __getitem__(self, index: int) -> Union[Shape,'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, 637, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __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":636 + /* "collisions.py":691 * return Shapes(*self.shapes) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -23697,24 +24960,175 @@ static PyObject *__pyx_pf_10collisions_6Shapes_28__iter__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":639 +/* "collisions.py":694 + * 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}; + 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, 694, __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, 694, __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("__len__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 694, __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.__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); + + /* 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_32__len__(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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__len__", 1); + + /* "collisions.py":695 + * + * def __len__(self): + * return len(self.shapes) # <<<<<<<<<<<<<< + * + * def __getitem__(self, index: int) -> Union[Shape,'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, 695, __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, 695, __pyx_L1_error) + __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, 695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":694 * return iter(self.shapes) * + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self.shapes) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("collisions.Shapes.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":697 + * return len(self.shapes) + * * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< * return self.shapes[index] * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_31__getitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_35__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_6Shapes_31__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_31__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_31__getitem__(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -23761,7 +25175,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -23769,14 +25183,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 639, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 697, __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, 639, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 697, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -23789,7 +25203,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, 639, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 697, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23803,8 +25217,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 639, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_6Shapes_30__getitem__(__pyx_self, __pyx_v_self, __pyx_v_index); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), (&PyInt_Type), 0, "index", 1))) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Shapes_34__getitem__(__pyx_self, __pyx_v_self, __pyx_v_index); /* function exit code */ goto __pyx_L0; @@ -23821,7 +25235,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_30__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index) { +static PyObject *__pyx_pf_10collisions_6Shapes_34__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; @@ -23831,7 +25245,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_30__getitem__(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":640 + /* "collisions.py":698 * * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: * return self.shapes[index] # <<<<<<<<<<<<<< @@ -23839,17 +25253,17 @@ static PyObject *__pyx_pf_10collisions_6Shapes_30__getitem__(CYTHON_UNUSED PyObj * 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, 640, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __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, 640, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __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":639 - * return iter(self.shapes) + /* "collisions.py":697 + * return len(self.shapes) * * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< * return self.shapes[index] @@ -23868,7 +25282,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_30__getitem__(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":642 +/* "collisions.py":700 * return self.shapes[index] * * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< @@ -23877,15 +25291,15 @@ static PyObject *__pyx_pf_10collisions_6Shapes_30__getitem__(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_33__setitem__(PyObject *__pyx_self, +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_33__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_33__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_33__setitem__(PyObject *__pyx_self, +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 @@ -23935,7 +25349,7 @@ 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, 700, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -23943,9 +25357,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 642, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 700, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -23953,14 +25367,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (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, 700, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 642, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 700, __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, 642, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 700, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -23975,7 +25389,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, 642, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 700, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23989,8 +25403,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 642, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_6Shapes_32__setitem__(__pyx_self, __pyx_v_self, __pyx_v_index, __pyx_v_new); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), (&PyInt_Type), 0, "index", 1))) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Shapes_36__setitem__(__pyx_self, __pyx_v_self, __pyx_v_index, __pyx_v_new); /* function exit code */ goto __pyx_L0; @@ -24007,7 +25421,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_32__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_new) { +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) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24016,19 +25430,19 @@ static PyObject *__pyx_pf_10collisions_6Shapes_32__setitem__(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":643 + /* "collisions.py":701 * * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: * self.shapes[index] = new # <<<<<<<<<<<<<< * * def __repr__(self): return str(self) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __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, 643, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_index, __pyx_v_new) < 0))) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":642 + /* "collisions.py":700 * return self.shapes[index] * * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< @@ -24049,7 +25463,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_32__setitem__(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":645 +/* "collisions.py":703 * self.shapes[index] = new * * def __repr__(self): return str(self) # <<<<<<<<<<<<<< @@ -24058,15 +25472,15 @@ static PyObject *__pyx_pf_10collisions_6Shapes_32__setitem__(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_35__repr__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_39__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*/ -static PyMethodDef __pyx_mdef_10collisions_6Shapes_35__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_35__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_35__repr__(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -24110,12 +25524,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __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, 645, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 703, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -24126,7 +25540,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, 645, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 703, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24140,7 +25554,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_34__repr__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_38__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -24153,7 +25567,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_34__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_38__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24162,7 +25576,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_34__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, 645, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -24179,24 +25593,24 @@ static PyObject *__pyx_pf_10collisions_6Shapes_34__repr__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":647 +/* "collisions.py":705 * def __repr__(self): return str(self) * * def __str__(self): # <<<<<<<<<<<<<< - * return f'' - * + * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") + * return f'' */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_37__str__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_41__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_6Shapes_37__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_37__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_37__str__(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -24240,12 +25654,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 647, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 705, __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, 647, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 705, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -24256,7 +25670,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, 647, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 705, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24270,7 +25684,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_36__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_40__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -24283,78 +25697,175 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_36__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +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; 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; - Py_ssize_t __pyx_t_5; + 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); - /* "collisions.py":648 + /* "collisions.py":706 * * def __str__(self): - * return f'' # <<<<<<<<<<<<<< + * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") # <<<<<<<<<<<<<< + * return f'' + * + */ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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":707 + * def __str__(self): + * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") + * return f'' # <<<<<<<<<<<<<< * * # The below are in order of collision: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_Shapes_with); - __pyx_t_2 += 13; - __Pyx_GIVEREF(__pyx_kp_u_Shapes_with); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Shapes_with); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 648, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u_shapes_2); - __pyx_t_2 += 8; - __Pyx_GIVEREF(__pyx_kp_u_shapes_2); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_shapes_2); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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, 707, __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, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":647 + /* "collisions.py":705 * def __repr__(self): return str(self) * * def __str__(self): # <<<<<<<<<<<<<< - * return f'' - * + * 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_4); + __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_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":656 - * class Point(Shape): +/* "collisions.py":716 + * 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): # <<<<<<<<<<<<<< * """ @@ -24371,20 +25882,20 @@ static PyObject *__pyx_pf_10collisions_28__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_defaults5, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __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, 656, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __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, 656, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 716, __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, 656, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 716, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -24466,7 +25977,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 716, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -24474,9 +25985,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 716, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 656, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 716, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -24484,21 +25995,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 716, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 656, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 716, __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, 656, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 716, __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, 656, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 716, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -24515,14 +26026,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 656, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 716, __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, 656, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 716, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24562,7 +26073,7 @@ static PyObject *__pyx_pf_10collisions_5Point___init__(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":663 + /* "collisions.py":723 * 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) # <<<<<<<<<<<<<< @@ -24570,23 +26081,23 @@ static PyObject *__pyx_pf_10collisions_5Point___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, 663, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 723, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __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, 663, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 723, __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, 663, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 723, __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, 663, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __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, 663, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __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, 663, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -24607,13 +26118,13 @@ static PyObject *__pyx_pf_10collisions_5Point___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, 663, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __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":664 + /* "collisions.py":724 * """ * super().__init__(bounciness) * self.x, self.y = x, y # <<<<<<<<<<<<<< @@ -24624,13 +26135,13 @@ static PyObject *__pyx_pf_10collisions_5Point___init__(CYTHON_UNUSED PyObject *_ __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, 664, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 724, __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, 664, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":656 - * class Point(Shape): + /* "collisions.py":716 + * 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): # <<<<<<<<<<<<<< * """ @@ -24653,7 +26164,7 @@ static PyObject *__pyx_pf_10collisions_5Point___init__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":666 +/* "collisions.py":726 * self.x, self.y = x, y * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -24715,12 +26226,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 666, __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, "rect") < 0)) __PYX_ERR(0, 666, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 726, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -24731,7 +26242,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, 666, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 726, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24771,7 +26282,7 @@ static PyObject *__pyx_pf_10collisions_5Point_2rect(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":673 + /* "collisions.py":733 * Iterable[Number]: (min x, min y, max x, max y) * """ * return self.x, self.y, self.x, self.y # <<<<<<<<<<<<<< @@ -24779,24 +26290,24 @@ static PyObject *__pyx_pf_10collisions_5Point_2rect(CYTHON_UNUSED PyObject *__py * 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, 673, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); 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, 673, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); 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, 673, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 733, __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, 673, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 733, __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, 673, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 733, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; @@ -24805,7 +26316,7 @@ static PyObject *__pyx_pf_10collisions_5Point_2rect(CYTHON_UNUSED PyObject *__py __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":666 + /* "collisions.py":726 * self.x, self.y = x, y * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -24828,7 +26339,7 @@ static PyObject *__pyx_pf_10collisions_5Point_2rect(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "collisions.py":675 +/* "collisions.py":735 * return self.x, self.y, self.x, self.y * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -24890,12 +26401,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 735, __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, 675, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 735, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -24906,7 +26417,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, 675, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 735, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24938,7 +26449,7 @@ static PyObject *__pyx_pf_10collisions_5Point_4area(CYTHON_UNUSED PyObject *__py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":682 + /* "collisions.py":742 * Number: The area of the shape * """ * return 0.0 # <<<<<<<<<<<<<< @@ -24950,7 +26461,7 @@ static PyObject *__pyx_pf_10collisions_5Point_4area(CYTHON_UNUSED PyObject *__py __pyx_r = __pyx_float_0_0; goto __pyx_L0; - /* "collisions.py":675 + /* "collisions.py":735 * return self.x, self.y, self.x, self.y * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -24965,7 +26476,7 @@ static PyObject *__pyx_pf_10collisions_5Point_4area(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "collisions.py":684 +/* "collisions.py":744 * return 0.0 * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -25027,12 +26538,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 744, __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, 684, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 744, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -25043,7 +26554,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, 684, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 744, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25079,7 +26590,7 @@ static PyObject *__pyx_pf_10collisions_5Point_6toPoints(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":689 + /* "collisions.py":749 * Iterable[pointLike]: Get a list of all the Points that make up this object; i.e. just this one point. * """ * return [self] # <<<<<<<<<<<<<< @@ -25087,16 +26598,16 @@ static PyObject *__pyx_pf_10collisions_5Point_6toPoints(CYTHON_UNUSED PyObject * * def _collides(self, othershape: Shape) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __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, 689, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self)) __PYX_ERR(0, 749, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":684 + /* "collisions.py":744 * return 0.0 * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -25115,11 +26626,11 @@ static PyObject *__pyx_pf_10collisions_5Point_6toPoints(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":691 +/* "collisions.py":751 * return [self] * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return self.x == othershape.x and self.y == othershape.y */ @@ -25179,7 +26690,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 691, __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: @@ -25187,14 +26698,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 691, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __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, "_collides") < 0)) __PYX_ERR(0, 691, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 751, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -25207,7 +26718,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, 691, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 751, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25248,25 +26759,28 @@ static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_collides", 1); - /* "collisions.py":692 + /* "collisions.py":752 * * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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, 692, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __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, 692, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 752, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -25274,49 +26788,49 @@ static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + 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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + __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, 752, __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, 692, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":693 + /* "collisions.py":753 * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): + * 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, 693, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __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, 693, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __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, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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, 693, __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, 753, __pyx_L1_error) if (__pyx_t_6) { - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_1 = __pyx_t_4; - __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; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __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, 753, __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; @@ -25325,33 +26839,33 @@ static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":692 + /* "collisions.py":752 * * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * return self.x == othershape.x and self.y == othershape.y * return othershape._collides(self) */ } - /* "collisions.py":694 - * if checkShpType(othershape, Point): + /* "collisions.py":754 + * 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, 694, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; + __pyx_t_4 = 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)) { + __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; @@ -25359,10 +26873,10 @@ static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_XDECREF(__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; } @@ -25370,11 +26884,11 @@ static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":691 + /* "collisions.py":751 * return [self] * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return self.x == othershape.x and self.y == othershape.y */ @@ -25392,11 +26906,11 @@ static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":696 +/* "collisions.py":756 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] */ @@ -25456,7 +26970,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 696, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 756, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -25464,14 +26978,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 696, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 756, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 696, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 756, __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, 696, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 756, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -25484,7 +26998,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, 696, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 756, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25526,25 +27040,28 @@ static PyObject *__pyx_pf_10collisions_5Point_10_where(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":697 + /* "collisions.py":757 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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, 697, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __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, 697, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -25552,131 +27069,131 @@ static PyObject *__pyx_pf_10collisions_5Point_10_where(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + 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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __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, 757, __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, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":698 + /* "collisions.py":758 * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): + * 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, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __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, 698, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __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, 758, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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, 698, __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, 758, __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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __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, 758, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __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, 758, __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, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __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, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __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, 698, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 698, __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, 698, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __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, 758, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error); + __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_3; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __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, 758, __pyx_L1_error); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; } else { - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __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":697 + /* "collisions.py":757 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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":699 - * if checkShpType(othershape, Point): + /* "collisions.py":759 + * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __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_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_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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self}; - __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, 699, __pyx_L1_error) + 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, 759, __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":696 + /* "collisions.py":756 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] */ @@ -25694,7 +27211,7 @@ static PyObject *__pyx_pf_10collisions_5Point_10_where(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":701 +/* "collisions.py":761 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< @@ -25763,7 +27280,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 701, __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: @@ -25771,21 +27288,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 701, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 701, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 761, __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, 701, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 761, __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, 701, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 761, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -25803,7 +27320,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, 701, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 761, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25842,17 +27359,17 @@ static PyObject *__pyx_pf_10collisions_5Point_12closestPointTo(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("closestPointTo", 1); - /* "collisions.py":712 + /* "collisions.py":772 * 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, 712, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 772, __pyx_L1_error) if (__pyx_t_1) { - /* "collisions.py":713 + /* "collisions.py":773 * """ * if returnAll: * return [(self.x, self.y)] # <<<<<<<<<<<<<< @@ -25860,28 +27377,28 @@ static PyObject *__pyx_pf_10collisions_5Point_12closestPointTo(CYTHON_UNUSED PyO * */ __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, 713, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __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, 713, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __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, 713, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 713, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 773, __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, 713, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __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, 713, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":712 + /* "collisions.py":772 * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object * """ * if returnAll: # <<<<<<<<<<<<<< @@ -25890,7 +27407,7 @@ static PyObject *__pyx_pf_10collisions_5Point_12closestPointTo(CYTHON_UNUSED PyO */ } - /* "collisions.py":714 + /* "collisions.py":774 * if returnAll: * return [(self.x, self.y)] * return (self.x, self.y) # <<<<<<<<<<<<<< @@ -25898,23 +27415,23 @@ static PyObject *__pyx_pf_10collisions_5Point_12closestPointTo(CYTHON_UNUSED PyO * def getTuple(self) -> tuple[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, 714, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __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, 714, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __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, 714, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 774, __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":701 + /* "collisions.py":761 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< @@ -25935,7 +27452,7 @@ static PyObject *__pyx_pf_10collisions_5Point_12closestPointTo(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":716 +/* "collisions.py":776 * return (self.x, self.y) * * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< @@ -25997,12 +27514,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 716, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __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, 716, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getTuple") < 0)) __PYX_ERR(0, 776, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -26013,7 +27530,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, 716, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getTuple", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 776, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26051,31 +27568,31 @@ static PyObject *__pyx_pf_10collisions_5Point_14getTuple(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTuple", 1); - /* "collisions.py":721 + /* "collisions.py":781 * Do you get the point? * """ * return (self.x, self.y) # <<<<<<<<<<<<<< * - * def handleCollisionsPos(self, + * def _contains(self, othershape: Shape) -> bool: */ __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, 721, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __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, 721, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __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, 721, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 781, __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":716 + /* "collisions.py":776 * return (self.x, self.y) * * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< @@ -26096,9 +27613,160 @@ static PyObject *__pyx_pf_10collisions_5Point_14getTuple(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":723 +/* "collisions.py":783 * 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_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, 783, __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, 783, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 783, __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, 783, __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("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 783, __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._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 */ + { + 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_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":784 + * + * def _contains(self, othershape: Shape) -> bool: + * return False # <<<<<<<<<<<<<< + * + * def handleCollisionsPos(self, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "collisions.py":783 + * return (self.x, self.y) + * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * return False + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":786 + * return False + * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldPoint: Union['Point',pointLike], * newPoint: Union['Point', pointLike], @@ -26115,42 +27783,42 @@ static PyObject *__pyx_pf_10collisions_30__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":730 + /* "collisions.py":793 * 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, 723, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __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, 723, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 786, __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, 723, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 786, __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, 723, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 786, __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, 723, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 786, __pyx_L1_error); - /* "collisions.py":723 - * return (self.x, self.y) + /* "collisions.py":786 + * 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, 723, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __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, 723, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 786, __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, 723, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 786, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -26169,16 +27837,16 @@ static PyObject *__pyx_pf_10collisions_30__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_17handleCollisionsPos(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_16handleCollisionsPos, "\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_17handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_17handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_16handleCollisionsPos}; -static PyObject *__pyx_pw_10collisions_5Point_17handleCollisionsPos(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 @@ -26248,7 +27916,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __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: @@ -26256,9 +27924,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __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, 723, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 786, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -26266,9 +27934,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 723, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 786, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -26276,42 +27944,42 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 723, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 786, __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, 723, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __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, 723, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __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, 723, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __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, 723, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __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, 723, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 786, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -26342,7 +28010,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, 723, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 786, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26356,7 +28024,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_16handleCollisionsPos(__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_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 */ { @@ -26369,7 +28037,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":768 +/* "collisions.py":831 * 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) # <<<<<<<<<<<<<< @@ -26430,12 +28098,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 768, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 831, __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, "lambda6") < 0)) __PYX_ERR(0, 768, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda6") < 0)) __PYX_ERR(0, 831, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -26446,7 +28114,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 768, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 831, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26489,43 +28157,43 @@ static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__ __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, 768, __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, 831, __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, 768, __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, 831, __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, 768, __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, 768, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_oldPoint)) { __Pyx_RaiseClosureNameError("oldPoint"); __PYX_ERR(0, 831, __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, 831, __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, 768, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __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, 768, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __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, 768, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __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, 768, __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, 831, __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, 768, __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, 831, __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, 768, __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, 768, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_oldPoint)) { __Pyx_RaiseClosureNameError("oldPoint"); __PYX_ERR(0, 831, __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, 831, __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, 768, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __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, 768, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __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, 768, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __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, 768, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __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; @@ -26547,15 +28215,15 @@ static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__ return __pyx_r; } -/* "collisions.py":723 - * return (self.x, self.y) +/* "collisions.py":786 + * return False * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldPoint: Union['Point',pointLike], * newPoint: Union['Point', pointLike], */ -static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(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) { +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; @@ -26574,7 +28242,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE PyObject *__pyx_v_smallness = NULL; PyObject *__pyx_v_out = NULL; PyObject *__pyx_v_outvel = NULL; - CYTHON_UNUSED Py_ssize_t __pyx_9genexpr13__pyx_v__; + CYTHON_UNUSED Py_ssize_t __pyx_9genexpr14__pyx_v__; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -26601,7 +28269,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE 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, 723, __pyx_L1_error) + __PYX_ERR(0, 786, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -26610,14 +28278,14 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldPoint); __Pyx_INCREF(__pyx_v_vel); - /* "collisions.py":754 + /* "collisions.py":817 * DidReflect (bool): Whether the line reflected off of something * """ * mvement = Line(oldPoint, newPoint) # <<<<<<<<<<<<<< * if not mvement.collides(objs): * if verbose: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -26637,21 +28305,21 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE 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, 754, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __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; - /* "collisions.py":755 + /* "collisions.py":818 * """ * 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, 755, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -26671,26 +28339,26 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE 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, 755, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __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, 755, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "collisions.py":756 + /* "collisions.py":819 * 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, 756, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 819, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":757 + /* "collisions.py":820 * if not mvement.collides(objs): * if verbose: * return newPoint, vel, [False] # <<<<<<<<<<<<<< @@ -26698,27 +28366,27 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE * points = [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __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, 757, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_False)) __PYX_ERR(0, 820, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __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, 757, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_newPoint)) __PYX_ERR(0, 820, __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, 757, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_vel)) __PYX_ERR(0, 820, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":756 + /* "collisions.py":819 * mvement = Line(oldPoint, newPoint) * if not mvement.collides(objs): * if verbose: # <<<<<<<<<<<<<< @@ -26727,7 +28395,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE */ } - /* "collisions.py":758 + /* "collisions.py":821 * if verbose: * return newPoint, vel, [False] * return newPoint, vel # <<<<<<<<<<<<<< @@ -26735,19 +28403,19 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE * for o in objs: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __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_INCREF(__pyx_v_newPoint); __Pyx_GIVEREF(__pyx_v_newPoint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_newPoint)) __PYX_ERR(0, 758, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_newPoint)) __PYX_ERR(0, 821, __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, 758, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_vel)) __PYX_ERR(0, 821, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":755 + /* "collisions.py":818 * """ * mvement = Line(oldPoint, newPoint) * if not mvement.collides(objs): # <<<<<<<<<<<<<< @@ -26756,19 +28424,19 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE */ } - /* "collisions.py":759 + /* "collisions.py":822 * 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, 759, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_points = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":760 + /* "collisions.py":823 * return newPoint, vel * points = [] * for o in objs: # <<<<<<<<<<<<<< @@ -26780,9 +28448,9 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __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, 760, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __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, 760, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 823, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -26790,28 +28458,28 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE { 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, 760, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 823, __pyx_L1_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, 760, __pyx_L1_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, 823, __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, 760, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __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, 760, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 823, __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, 760, __pyx_L1_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, 823, __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, 760, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -26821,7 +28489,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 760, __pyx_L1_error) + else __PYX_ERR(0, 823, __pyx_L1_error) } break; } @@ -26830,14 +28498,14 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":761 + /* "collisions.py":824 * 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, 761, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -26857,14 +28525,14 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE 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, 761, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __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":762 + /* "collisions.py":825 * for o in objs: * cs = o.whereCollides(mvement) * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) # <<<<<<<<<<<<<< @@ -26872,33 +28540,33 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE * if points == []: */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __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, 762, __pyx_L1_error) + __pyx_t_10 = PyObject_Length(__pyx_v_cs); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 825, __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_9genexpr13__pyx_v__ = __pyx_t_12; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_o))) __PYX_ERR(0, 762, __pyx_L1_error) + __pyx_9genexpr14__pyx_v__ = __pyx_t_12; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_o))) __PYX_ERR(0, 825, __pyx_L1_error) } } /* exit inner scope */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __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, 762, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cs)) __PYX_ERR(0, 825, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 825, __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, 762, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __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, 762, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __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, 762, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_3); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":760 + /* "collisions.py":823 * return newPoint, vel * points = [] * for o in objs: # <<<<<<<<<<<<<< @@ -26908,32 +28576,32 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":764 + /* "collisions.py":827 * 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, 764, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __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, 764, __pyx_L1_error) + __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, 827, __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, 764, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":765 + /* "collisions.py":828 * # 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, 765, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 828, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":766 + /* "collisions.py":829 * if points == []: * if verbose: * return oldPoint, [0, 0], [True] # <<<<<<<<<<<<<< @@ -26941,35 +28609,35 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE * 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, 766, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __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, 766, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 829, __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, 766, __pyx_L1_error); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 829, __pyx_L1_error); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __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, 766, __pyx_L1_error); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_True)) __PYX_ERR(0, 829, __pyx_L1_error); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __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, 766, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_oldPoint)) __PYX_ERR(0, 829, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2)) __PYX_ERR(0, 829, __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":765 + /* "collisions.py":828 * # Don't let you move when you're in a wall * if points == []: * if verbose: # <<<<<<<<<<<<<< @@ -26978,7 +28646,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE */ } - /* "collisions.py":767 + /* "collisions.py":830 * if verbose: * return oldPoint, [0, 0], [True] * return oldPoint, [0, 0] # <<<<<<<<<<<<<< @@ -26986,27 +28654,27 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE * closestP = points[0][0] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __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, 767, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 830, __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, 767, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 830, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __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, 767, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_oldPoint)) __PYX_ERR(0, 830, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":764 + /* "collisions.py":827 * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * # Don't let you move when you're in a wall * if points == []: # <<<<<<<<<<<<<< @@ -27015,65 +28683,65 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE */ } - /* "collisions.py":768 + /* "collisions.py":831 * 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, 768, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __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, 768, __pyx_L1_error) + __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, 831, __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, 768, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 831, __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, 768, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __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":769 + /* "collisions.py":832 * 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, 769, __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, 832, __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, 769, __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, 832, __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":770 + /* "collisions.py":833 * 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, 770, __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, 833, __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, 770, __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, 833, __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":771 + /* "collisions.py":834 * 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, 771, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -27093,50 +28761,50 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE 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, 771, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":772 + /* "collisions.py":835 * 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, 772, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_t, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_normal = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":773 + /* "collisions.py":836 * 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, 773, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __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, 773, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_hypot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __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, 773, __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, 836, __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, 773, __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, 836, __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, 773, __pyx_L1_error) + __pyx_t_14 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 836, __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, 773, __pyx_L1_error) + __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, 836, __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, 773, __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, 836, __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, 773, __pyx_L1_error) + __pyx_t_15 = PyNumber_Subtract(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 836, __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; @@ -27160,39 +28828,39 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __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, 773, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __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, 773, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __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, 773, __pyx_L1_error) + __pyx_t_15 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 836, __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; - /* "collisions.py":774 + /* "collisions.py":837 * 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, 774, __pyx_L1_error) + __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, 837, __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, 774, __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, 837, __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, 774, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __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, 774, __pyx_L1_error) + __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, 837, __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, 774, __pyx_L1_error) + __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, 837, __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, 774, __pyx_L1_error) + __pyx_t_14 = PyNumber_Subtract(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 837, __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; @@ -27201,21 +28869,21 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __pyx_v_y = __pyx_t_14; __pyx_t_14 = 0; - /* "collisions.py":775 + /* "collisions.py":838 * 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: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __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, 775, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); 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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __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, 775, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -27236,7 +28904,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE 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, 775, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -27259,56 +28927,56 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __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, 775, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __pyx_t_15 = __Pyx_PyInt_AddObjC(__pyx_t_14, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyInt_AddObjC(__pyx_t_14, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 838, __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":776 + /* "collisions.py":839 * 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, 776, __pyx_L1_error) + __pyx_t_15 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 839, __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, 776, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_RemainderObjC(__pyx_t_15, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 839, __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":777 + /* "collisions.py":840 * 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, 777, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 777, __pyx_L1_error) + __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, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_6) { - /* "collisions.py":778 + /* "collisions.py":841 * 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, 778, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __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_SET(__pyx_v_diff, __pyx_t_14); __pyx_t_14 = 0; - /* "collisions.py":777 + /* "collisions.py":840 * 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: # <<<<<<<<<<<<<< @@ -27317,35 +28985,35 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE */ } - /* "collisions.py":779 + /* "collisions.py":842 * 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, 779, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotate); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 842, __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, 779, __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, 842, __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, 779, __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, 842, __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, 779, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_dist_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __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, 779, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __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, 779, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 842, __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, 779, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __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, 779, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __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, 779, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 842, __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; @@ -27369,25 +29037,25 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __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, 779, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 842, __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":780 + /* "collisions.py":843 * 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, 780, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 843, __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, 780, __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, 843, __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, 780, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_180, __pyx_t_9, 0xB4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -27409,74 +29077,74 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __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, 780, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 843, __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, 780, __pyx_L1_error) + __pyx_t_15 = __Pyx_PySequence_ListKeepNew(__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 843, __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":781 + /* "collisions.py":844 * 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, 781, __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, 844, __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, 781, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 844, __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, 781, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __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, 781, __pyx_L1_error) + __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, 844, __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, 781, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 844, __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, 781, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 844, __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, 781, __pyx_L1_error) + __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 844, __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, 781, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_9)) __PYX_ERR(0, 781, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_9)) __PYX_ERR(0, 844, __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":783 + /* "collisions.py":846 * 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, 783, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 846, __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, 783, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = PyList_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 783, __pyx_L1_error) + __pyx_t_14 = PyList_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 846, __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, 783, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_int_0)) __PYX_ERR(0, 846, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_1)) __PYX_ERR(0, 846, __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, 783, __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, 846, __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, 783, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __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, 783, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __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; @@ -27500,44 +29168,44 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __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, 783, __pyx_L1_error) + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 846, __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":784 + /* "collisions.py":847 * # 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, 784, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 847, __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, 784, __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, 847, __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, 784, __pyx_L1_error) + __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, 847, __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, 784, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __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, 784, __pyx_L1_error) + __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, 847, __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, 784, __pyx_L1_error) + __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, 847, __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, 784, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_14, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __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, 784, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __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, 784, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -27559,7 +29227,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __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, 784, __pyx_L1_error) + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -27569,7 +29237,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 784, __pyx_L1_error) + __PYX_ERR(0, 847, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -27582,15 +29250,15 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __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, 784, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __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, 784, __pyx_L1_error) + __pyx_t_1 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __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); @@ -27598,7 +29266,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __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, 784, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) __PYX_ERR(0, 847, __pyx_L1_error) __pyx_t_16 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L14_unpacking_done; @@ -27606,7 +29274,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_16 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 784, __pyx_L1_error) + __PYX_ERR(0, 847, __pyx_L1_error) __pyx_L14_unpacking_done:; } __pyx_v_out = __pyx_t_9; @@ -27614,33 +29282,33 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE __pyx_v_outvel = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":785 + /* "collisions.py":848 * 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, 785, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 848, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":786 + /* "collisions.py":849 * 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, 786, __pyx_L1_error) + __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, 849, __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, 786, __pyx_L1_error) + __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, 849, __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, 786, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_15) < 0) __PYX_ERR(0, 849, __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, 786, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":785 + /* "collisions.py":848 * 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: # <<<<<<<<<<<<<< @@ -27649,17 +29317,17 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE */ } - /* "collisions.py":787 + /* "collisions.py":850 * 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, 787, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 850, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":788 + /* "collisions.py":851 * self.x, self.y = out[0], out[1] * if verbose: * return out, outvel, [True] # <<<<<<<<<<<<<< @@ -27667,27 +29335,27 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __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, 788, __pyx_L1_error); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 788, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_True)) __PYX_ERR(0, 851, __pyx_L1_error); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 851, __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, 788, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 851, __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, 788, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 851, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L0; - /* "collisions.py":787 + /* "collisions.py":850 * if replaceSelf: * self.x, self.y = out[0], out[1] * if verbose: # <<<<<<<<<<<<<< @@ -27696,7 +29364,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE */ } - /* "collisions.py":789 + /* "collisions.py":852 * if verbose: * return out, outvel, [True] * return out, outvel # <<<<<<<<<<<<<< @@ -27704,20 +29372,20 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE * def handleCollisionsVel(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 852, __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, 789, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 852, __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, 789, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 852, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L0; - /* "collisions.py":723 - * return (self.x, self.y) + /* "collisions.py":786 + * return False * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldPoint: Union['Point',pointLike], @@ -27759,7 +29427,7 @@ static PyObject *__pyx_pf_10collisions_5Point_16handleCollisionsPos(CYTHON_UNUSE return __pyx_r; } -/* "collisions.py":791 +/* "collisions.py":854 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -27778,39 +29446,39 @@ static PyObject *__pyx_pf_10collisions_32__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":796 + /* "collisions.py":859 * 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, 791, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __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, 791, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 854, __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, 791, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 854, __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, 791, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 854, __pyx_L1_error); - /* "collisions.py":791 + /* "collisions.py":854 * 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, 791, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __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, 791, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 854, __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, 791, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 854, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -27829,16 +29497,16 @@ static PyObject *__pyx_pf_10collisions_32__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsVel(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_5Point_18handleCollisionsVel, "\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_19handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_19handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_18handleCollisionsVel}; -static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsVel(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 @@ -27901,7 +29569,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 791, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -27909,9 +29577,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 791, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 791, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 854, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -27919,35 +29587,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 791, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 791, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 854, __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, 791, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 854, __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, 791, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 854, __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, 791, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 854, __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, 791, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 854, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -27973,7 +29641,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, 791, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 854, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27987,7 +29655,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_18handleCollisionsVel(__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_20handleCollisionsVel(__pyx_self, __pyx_v_self, __pyx_v_vel, __pyx_v_objs, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); /* function exit code */ { @@ -28000,7 +29668,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(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_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 @@ -28018,37 +29686,37 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - /* "collisions.py":814 + /* "collisions.py":877 * 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, 814, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __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, 814, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __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, 814, __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, 877, __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, 814, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __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, 814, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __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, 814, __pyx_L1_error) + __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, 877, __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, 814, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 877, __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, 814, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __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, 814, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 814, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 877, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -28070,31 +29738,31 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE __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, 814, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __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":815 + /* "collisions.py":878 * """ * 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, 815, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 878, __pyx_L1_error) if (__pyx_t_8) { - /* "collisions.py":816 + /* "collisions.py":879 * 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, 816, __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, 879, __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; @@ -28102,7 +29770,7 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 879, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -28115,15 +29783,15 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE __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, 816, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __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, 816, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 879, __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); @@ -28131,7 +29799,7 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE __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, 816, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) __PYX_ERR(0, 879, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; @@ -28139,15 +29807,15 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 879, __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, 816, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 879, __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, 816, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":815 + /* "collisions.py":878 * """ * o = self.handleCollisionsPos(self, (self.x+vel[0], self.y+vel[1]), objs, vel, False, precision, verbose) * if replaceSelf: # <<<<<<<<<<<<<< @@ -28156,17 +29824,17 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE */ } - /* "collisions.py":817 + /* "collisions.py":880 * 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, 817, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 880, __pyx_L1_error) if (__pyx_t_8) { - /* "collisions.py":818 + /* "collisions.py":881 * self.x, self.y = o[0] * if verbose: * return o[0], o[1], o[2] # <<<<<<<<<<<<<< @@ -28174,20 +29842,20 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE * */ __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, 818, __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, 881, __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, 818, __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, 881, __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, 818, __pyx_L1_error) + __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, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 881, __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, 818, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; @@ -28195,7 +29863,7 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE __pyx_t_6 = 0; goto __pyx_L0; - /* "collisions.py":817 + /* "collisions.py":880 * if replaceSelf: * self.x, self.y = o[0] * if verbose: # <<<<<<<<<<<<<< @@ -28204,7 +29872,7 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE */ } - /* "collisions.py":819 + /* "collisions.py":882 * if verbose: * return o[0], o[1], o[2] * return o[0], o[1] # <<<<<<<<<<<<<< @@ -28212,23 +29880,23 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE * 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, 819, __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, 882, __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, 819, __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, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __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, 819, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 882, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 882, __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":791 + /* "collisions.py":854 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -28253,7 +29921,7 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE return __pyx_r; } -/* "collisions.py":821 +/* "collisions.py":884 * return o[0], o[1] * * def copy(self) -> 'Point': # <<<<<<<<<<<<<< @@ -28262,16 +29930,16 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsVel(CYTHON_UNUSE */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_21copy(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_5Point_20copy, "\n Make a brand new Point with the same values!\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_21copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_21copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_20copy}; -static PyObject *__pyx_pw_10collisions_5Point_21copy(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 @@ -28315,12 +29983,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 884, __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, 821, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 884, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -28331,7 +29999,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, 821, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 884, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28345,7 +30013,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_20copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Point_22copy(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -28358,7 +30026,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_20copy(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; @@ -28373,7 +30041,7 @@ static PyObject *__pyx_pf_10collisions_5Point_20copy(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":825 + /* "collisions.py":888 * Make a brand new Point with the same values! * """ * return Point(self.x, self.y, self.bounciness) # <<<<<<<<<<<<<< @@ -28381,13 +30049,13 @@ static PyObject *__pyx_pf_10collisions_5Point_20copy(CYTHON_UNUSED PyObject *__p * def __getitem__(self, item: int) -> Number: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __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, 825, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __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, 825, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __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, 825, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -28410,7 +30078,7 @@ static PyObject *__pyx_pf_10collisions_5Point_20copy(CYTHON_UNUSED PyObject *__p __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, 825, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -28418,7 +30086,7 @@ static PyObject *__pyx_pf_10collisions_5Point_20copy(CYTHON_UNUSED PyObject *__p __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":821 + /* "collisions.py":884 * return o[0], o[1] * * def copy(self) -> 'Point': # <<<<<<<<<<<<<< @@ -28442,7 +30110,7 @@ static PyObject *__pyx_pf_10collisions_5Point_20copy(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":827 +/* "collisions.py":890 * return Point(self.x, self.y, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< @@ -28451,15 +30119,15 @@ static PyObject *__pyx_pf_10collisions_5Point_20copy(CYTHON_UNUSED PyObject *__p */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_23__getitem__(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*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_23__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_23__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_23__getitem__(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 @@ -28506,7 +30174,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -28514,14 +30182,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 827, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 890, __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, 827, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 890, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -28534,7 +30202,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, 827, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 890, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28548,8 +30216,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, 827, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_5Point_22__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, 890, __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; @@ -28566,7 +30234,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) { +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; @@ -28577,19 +30245,19 @@ static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":828 + /* "collisions.py":891 * * 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, 828, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 828, __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, 891, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":829 + /* "collisions.py":892 * def __getitem__(self, item: int) -> Number: * if item == 0: * return self.x # <<<<<<<<<<<<<< @@ -28597,13 +30265,13 @@ static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObje * 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, 829, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":828 + /* "collisions.py":891 * * def __getitem__(self, item: int) -> Number: * if item == 0: # <<<<<<<<<<<<<< @@ -28612,19 +30280,19 @@ static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObje */ } - /* "collisions.py":830 + /* "collisions.py":893 * 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, 830, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 830, __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, 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 (likely(__pyx_t_2)) { - /* "collisions.py":831 + /* "collisions.py":894 * return self.x * elif item == 1: * return self.y # <<<<<<<<<<<<<< @@ -28632,13 +30300,13 @@ static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObje * 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, 831, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":830 + /* "collisions.py":893 * if item == 0: * return self.x * elif item == 1: # <<<<<<<<<<<<<< @@ -28647,7 +30315,7 @@ static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObje */ } - /* "collisions.py":833 + /* "collisions.py":896 * return self.y * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -28656,35 +30324,35 @@ static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObje */ /*else*/ { - /* "collisions.py":834 + /* "collisions.py":897 * 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, 834, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __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, 834, __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, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":833 + /* "collisions.py":896 * 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, 833, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __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, 833, __pyx_L1_error) + __PYX_ERR(0, 896, __pyx_L1_error) } - /* "collisions.py":827 + /* "collisions.py":890 * return Point(self.x, self.y, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< @@ -28704,7 +30372,7 @@ static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":837 +/* "collisions.py":900 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< @@ -28713,15 +30381,15 @@ static PyObject *__pyx_pf_10collisions_5Point_22__getitem__(CYTHON_UNUSED PyObje */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_25__setitem__(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_5Point_25__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_25__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_25__setitem__(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 @@ -28771,7 +30439,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 837, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -28779,9 +30447,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 837, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 837, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 900, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -28789,14 +30457,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 837, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 837, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 900, __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, 837, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 900, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -28811,7 +30479,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, 837, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 900, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28825,8 +30493,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, 837, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_5Point_24__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, 900, __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; @@ -28843,7 +30511,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_24__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new) { +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; @@ -28854,28 +30522,28 @@ static PyObject *__pyx_pf_10collisions_5Point_24__setitem__(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":838 + /* "collisions.py":901 * * 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, 838, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 838, __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, 901, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":839 + /* "collisions.py":902 * 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, 839, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_new) < 0) __PYX_ERR(0, 902, __pyx_L1_error) - /* "collisions.py":838 + /* "collisions.py":901 * * def __setitem__(self, item: int, new: Number) -> None: * if item == 0: # <<<<<<<<<<<<<< @@ -28885,28 +30553,28 @@ static PyObject *__pyx_pf_10collisions_5Point_24__setitem__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "collisions.py":840 + /* "collisions.py":903 * 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, 840, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 840, __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, 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 (likely(__pyx_t_2)) { - /* "collisions.py":841 + /* "collisions.py":904 * 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, 841, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_new) < 0) __PYX_ERR(0, 904, __pyx_L1_error) - /* "collisions.py":840 + /* "collisions.py":903 * if item == 0: * self.x = new * elif item == 1: # <<<<<<<<<<<<<< @@ -28916,7 +30584,7 @@ static PyObject *__pyx_pf_10collisions_5Point_24__setitem__(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "collisions.py":843 + /* "collisions.py":906 * self.y = new * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -28925,36 +30593,36 @@ static PyObject *__pyx_pf_10collisions_5Point_24__setitem__(CYTHON_UNUSED PyObje */ /*else*/ { - /* "collisions.py":844 + /* "collisions.py":907 * 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, 844, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __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, 844, __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, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":843 + /* "collisions.py":906 * 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, 843, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __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, 843, __pyx_L1_error) + __PYX_ERR(0, 906, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":837 + /* "collisions.py":900 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< @@ -28976,7 +30644,7 @@ static PyObject *__pyx_pf_10collisions_5Point_24__setitem__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":847 +/* "collisions.py":910 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -28985,15 +30653,15 @@ static PyObject *__pyx_pf_10collisions_5Point_24__setitem__(CYTHON_UNUSED PyObje */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_27__iter__(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*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_27__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_27__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_27__iter__(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 @@ -29037,12 +30705,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 847, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 910, __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, 847, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 910, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -29053,7 +30721,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, 847, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 910, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29067,7 +30735,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_26__iter__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Point_28__iter__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -29080,7 +30748,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_26__iter__(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; @@ -29091,7 +30759,7 @@ static PyObject *__pyx_pf_10collisions_5Point_26__iter__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":848 + /* "collisions.py":911 * * def __iter__(self): * return iter([self.x, self.y]) # <<<<<<<<<<<<<< @@ -29099,26 +30767,26 @@ static PyObject *__pyx_pf_10collisions_5Point_26__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, 848, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __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, 848, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 911, __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, 848, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 848, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 911, __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, 848, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __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":847 + /* "collisions.py":910 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -29139,7 +30807,7 @@ static PyObject *__pyx_pf_10collisions_5Point_26__iter__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":850 +/* "collisions.py":913 * return iter([self.x, self.y]) * * def __str__(self): # <<<<<<<<<<<<<< @@ -29148,15 +30816,15 @@ static PyObject *__pyx_pf_10collisions_5Point_26__iter__(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_29__str__(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_5Point_29__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_29__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_29__str__(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 @@ -29200,12 +30868,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 913, __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, 850, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 913, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -29216,7 +30884,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, 850, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 913, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29230,7 +30898,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_28__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Point_30__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -29243,7 +30911,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_28__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +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; @@ -29256,7 +30924,7 @@ static PyObject *__pyx_pf_10collisions_5Point_28__str__(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":851 + /* "collisions.py":914 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -29264,7 +30932,7 @@ static PyObject *__pyx_pf_10collisions_5Point_28__str__(CYTHON_UNUSED PyObject * * class Line(Shape): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -29272,9 +30940,9 @@ static PyObject *__pyx_pf_10collisions_5Point_28__str__(CYTHON_UNUSED PyObject * __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, 851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __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, 851, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 914, __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; @@ -29282,13 +30950,13 @@ static PyObject *__pyx_pf_10collisions_5Point_28__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__3); + __Pyx_INCREF(__pyx_kp_u__6); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__3); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) + __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, 914, __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, 851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __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; @@ -29296,18 +30964,18 @@ static PyObject *__pyx_pf_10collisions_5Point_28__str__(CYTHON_UNUSED PyObject * __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__4); + __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__4); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__4); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) + __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, 914, __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":850 + /* "collisions.py":913 * return iter([self.x, self.y]) * * def __str__(self): # <<<<<<<<<<<<<< @@ -29328,9 +30996,9 @@ static PyObject *__pyx_pf_10collisions_5Point_28__str__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":856 - * """A line segment object defined by a start and an end point.""" - * GROUPS = [ShpGroups.LINES] +/* "collisions.py":920 + * GROUPS = {ShpGroups.LINES} + * TYPE = ShpTyps.Line * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: @@ -29346,20 +31014,20 @@ 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, 856, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __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, 920, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __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, 856, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 920, __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, 856, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 920, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -29441,7 +31109,7 @@ 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, 920, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -29449,9 +31117,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (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, 920, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 856, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 920, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -29459,21 +31127,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (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, 920, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 856, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 920, __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, 856, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 920, __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, 856, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 920, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -29490,14 +31158,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 856, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __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, 856, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 920, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29537,7 +31205,7 @@ static PyObject *__pyx_pf_10collisions_4Line___init__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":863 + /* "collisions.py":927 * 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) # <<<<<<<<<<<<<< @@ -29545,23 +31213,23 @@ static PyObject *__pyx_pf_10collisions_4Line___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, 863, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 927, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __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, 863, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 927, __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, 863, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 927, __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, 863, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __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, 863, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __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, 863, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -29582,13 +31250,13 @@ static PyObject *__pyx_pf_10collisions_4Line___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, 863, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __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":864 + /* "collisions.py":928 * """ * super().__init__(bounciness) * self.p1, self.p2 = p1, p2 # <<<<<<<<<<<<<< @@ -29599,14 +31267,14 @@ static PyObject *__pyx_pf_10collisions_4Line___init__(CYTHON_UNUSED PyObject *__ __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, 864, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_1) < 0) __PYX_ERR(0, 928, __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, 864, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_3) < 0) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":856 - * """A line segment object defined by a start and an end point.""" - * GROUPS = [ShpGroups.LINES] + /* "collisions.py":920 + * GROUPS = {ShpGroups.LINES} + * TYPE = ShpTyps.Line * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: @@ -29628,7 +31296,7 @@ static PyObject *__pyx_pf_10collisions_4Line___init__(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":866 +/* "collisions.py":930 * self.p1, self.p2 = p1, p2 * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -29690,12 +31358,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 866, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 930, __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, 866, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 930, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -29706,7 +31374,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, 866, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 930, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29748,7 +31416,7 @@ static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":873 + /* "collisions.py":937 * Number: The distance between the 2 points. * """ * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) # <<<<<<<<<<<<<< @@ -29756,36 +31424,36 @@ static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx * @property */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __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, 873, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hypot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __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, 873, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __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, 873, __pyx_L1_error) + __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, 937, __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, 873, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __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, 873, __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, 937, __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, 873, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __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, 873, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __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, 873, __pyx_L1_error) + __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, 937, __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, 873, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __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, 873, __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, 937, __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, 873, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 937, __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; @@ -29809,7 +31477,7 @@ static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx __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, 873, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -29817,7 +31485,7 @@ static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":866 + /* "collisions.py":930 * self.p1, self.p2 = p1, p2 * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -29841,7 +31509,7 @@ static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":875 +/* "collisions.py":939 * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) * * @property # <<<<<<<<<<<<<< @@ -29903,12 +31571,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 939, __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, 875, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 939, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -29919,7 +31587,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, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 939, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29956,7 +31624,7 @@ static PyObject *__pyx_pf_10collisions_4Line_4x(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("x", 1); - /* "collisions.py":878 + /* "collisions.py":942 * 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] # <<<<<<<<<<<<<< @@ -29964,16 +31632,16 @@ static PyObject *__pyx_pf_10collisions_4Line_4x(CYTHON_UNUSED PyObject *__pyx_se * def x(self, value): */ __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, 878, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __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, 878, __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, 942, __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":875 + /* "collisions.py":939 * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) * * @property # <<<<<<<<<<<<<< @@ -29993,7 +31661,7 @@ static PyObject *__pyx_pf_10collisions_4Line_4x(CYTHON_UNUSED PyObject *__pyx_se return __pyx_r; } -/* "collisions.py":879 +/* "collisions.py":943 * """One of the line's points' x value. Changing this will move the other point by the difference!""" * return self.p1[0] * @x.setter # <<<<<<<<<<<<<< @@ -30057,7 +31725,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 879, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 943, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -30065,14 +31733,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 879, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 943, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, 1); __PYX_ERR(0, 879, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, 1); __PYX_ERR(0, 943, __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, 879, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 943, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -30085,7 +31753,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, 879, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 943, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30124,79 +31792,79 @@ static PyObject *__pyx_pf_10collisions_4Line_6x(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("x", 1); - /* "collisions.py":881 + /* "collisions.py":945 * @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, 881, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __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, 881, __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, 945, __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, 881, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_value, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __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":882 + /* "collisions.py":946 * 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, 882, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); 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, 882, __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, 946, __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, 882, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __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, 882, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_value)) __PYX_ERR(0, 946, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 946, __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, 882, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_1) < 0) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":883 + /* "collisions.py":947 * 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, 883, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); 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, 883, __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, 947, __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, 883, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_diff); 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __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, 883, __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, 947, __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, 883, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __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, 883, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 947, __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, 883, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_2) < 0) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":879 + /* "collisions.py":943 * """One of the line's points' x value. Changing this will move the other point by the difference!""" * return self.p1[0] * @x.setter # <<<<<<<<<<<<<< @@ -30220,7 +31888,7 @@ static PyObject *__pyx_pf_10collisions_4Line_6x(CYTHON_UNUSED PyObject *__pyx_se return __pyx_r; } -/* "collisions.py":885 +/* "collisions.py":949 * self.p2 = [self.p2[0]+diff, self.p2[1]] * * @property # <<<<<<<<<<<<<< @@ -30282,12 +31950,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 949, __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, 885, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 949, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -30298,7 +31966,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, 885, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 949, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30335,7 +32003,7 @@ static PyObject *__pyx_pf_10collisions_4Line_8y(CYTHON_UNUSED PyObject *__pyx_se int __pyx_clineno = 0; __Pyx_RefNannySetupContext("y", 1); - /* "collisions.py":888 + /* "collisions.py":952 * 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] # <<<<<<<<<<<<<< @@ -30343,16 +32011,16 @@ static PyObject *__pyx_pf_10collisions_4Line_8y(CYTHON_UNUSED PyObject *__pyx_se * def y(self, value): */ __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, 888, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __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, 888, __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, 952, __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":885 + /* "collisions.py":949 * self.p2 = [self.p2[0]+diff, self.p2[1]] * * @property # <<<<<<<<<<<<<< @@ -30372,7 +32040,7 @@ static PyObject *__pyx_pf_10collisions_4Line_8y(CYTHON_UNUSED PyObject *__pyx_se return __pyx_r; } -/* "collisions.py":889 +/* "collisions.py":953 * """One of the line's points' y value. Changing this will move the other point by the difference!""" * return self.p1[1] * @y.setter # <<<<<<<<<<<<<< @@ -30436,7 +32104,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 953, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -30444,14 +32112,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 953, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, 1); __PYX_ERR(0, 889, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, 1); __PYX_ERR(0, 953, __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, 889, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 953, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -30464,7 +32132,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, 889, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 953, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30503,79 +32171,79 @@ static PyObject *__pyx_pf_10collisions_4Line_10y(CYTHON_UNUSED PyObject *__pyx_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("y", 1); - /* "collisions.py":891 + /* "collisions.py":955 * @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, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); 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, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __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, 955, __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, 891, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_value, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __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":892 + /* "collisions.py":956 * 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, 892, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __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, 892, __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, 956, __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, 892, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __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, 892, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 956, __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, 892, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_value)) __PYX_ERR(0, 956, __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, 892, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_1) < 0) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":893 + /* "collisions.py":957 * 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, 893, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); 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, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __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, 957, __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, 893, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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, 893, __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, 957, __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, 893, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_diff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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, 893, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __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, 893, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 957, __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, 893, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_3) < 0) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":889 + /* "collisions.py":953 * """One of the line's points' y value. Changing this will move the other point by the difference!""" * return self.p1[1] * @y.setter # <<<<<<<<<<<<<< @@ -30599,7 +32267,7 @@ static PyObject *__pyx_pf_10collisions_4Line_10y(CYTHON_UNUSED PyObject *__pyx_s return __pyx_r; } -/* "collisions.py":897 +/* "collisions.py":961 * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged * * @staticmethod # <<<<<<<<<<<<<< @@ -30667,7 +32335,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 897, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 961, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -30675,9 +32343,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 897, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 961, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, 1); __PYX_ERR(0, 897, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, 1); __PYX_ERR(0, 961, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -30685,14 +32353,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 897, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 961, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, 2); __PYX_ERR(0, 897, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, 2); __PYX_ERR(0, 961, __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, 897, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_onSegment") < 0)) __PYX_ERR(0, 961, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -30707,7 +32375,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 897, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 961, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30752,74 +32420,74 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_onSegment", 1); - /* "collisions.py":903 + /* "collisions.py":967 * """ * # Calculate the cross product * cross_product = (p[1] - a[1]) * (b[0] - a[0]) - (p[0] - a[0]) * (b[1] - a[1]) # <<<<<<<<<<<<<< * * # 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, 903, __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, 967, __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, 903, __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, 967, __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, 903, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 967, __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, 903, __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, 967, __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, 903, __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, 967, __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, 903, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 967, __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, 903, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __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, 903, __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, 967, __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, 903, __pyx_L1_error) + __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, 967, __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, 903, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __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, 903, __pyx_L1_error) + __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, 967, __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, 903, __pyx_L1_error) + __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, 967, __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, 903, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __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, 903, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 967, __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, 903, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __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":906 + /* "collisions.py":970 * * # 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, 906, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_cross_product); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __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, 906, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyInt_BoolNeObjC(__pyx_t_5, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "collisions.py":907 + /* "collisions.py":971 * # If the cross product is not zero, the point is not on the line * if abs(cross_product) != 0: * return False # <<<<<<<<<<<<<< @@ -30831,7 +32499,7 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":906 + /* "collisions.py":970 * * # If the cross product is not zero, the point is not on the line * if abs(cross_product) != 0: # <<<<<<<<<<<<<< @@ -30840,7 +32508,7 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject */ } - /* "collisions.py":910 + /* "collisions.py":974 * * # 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]) # <<<<<<<<<<<<<< @@ -30848,12 +32516,12 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject * 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, 910, __pyx_L1_error) + __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, 974, __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, 910, __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, 974, __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, 910, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 910, __pyx_L1_error) + __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, 974, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_4); @@ -30864,17 +32532,17 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject } __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, 910, __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, 974, __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, 910, __pyx_L1_error) + __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, 974, __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, 910, __pyx_L1_error) + __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, 974, __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, 910, __pyx_L1_error) + __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, 974, __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, 910, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 910, __pyx_L1_error) + __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, 974, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); @@ -30885,12 +32553,12 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject } __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, 910, __pyx_L1_error) + __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, 974, __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, 910, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 974, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -30899,12 +32567,12 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject __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, 910, __pyx_L1_error) + __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, 974, __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, 910, __pyx_L1_error) + __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, 974, __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, 910, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 910, __pyx_L1_error) + __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, 974, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); @@ -30915,17 +32583,17 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject } __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, 910, __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, 974, __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, 910, __pyx_L1_error) + __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, 974, __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, 910, __pyx_L1_error) + __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, 974, __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, 910, __pyx_L1_error) + __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, 974, __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, 910, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 910, __pyx_L1_error) + __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, 974, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_8); @@ -30936,7 +32604,7 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject } __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, 910, __pyx_L1_error) + __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, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -30949,7 +32617,7 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":897 + /* "collisions.py":961 * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged * * @staticmethod # <<<<<<<<<<<<<< @@ -30976,7 +32644,7 @@ static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":912 +/* "collisions.py":976 * 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]: # <<<<<<<<<<<<<< @@ -31038,12 +32706,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 912, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 976, __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, 912, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 976, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -31054,7 +32722,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, 912, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 976, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31097,7 +32765,7 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":919 + /* "collisions.py":983 * 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]) # <<<<<<<<<<<<<< @@ -31105,18 +32773,18 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py * def toLines(self) -> Iterable['Line']: */ __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, 919, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __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, 919, __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, 983, __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, 919, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __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, 919, __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, 983, __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, 919, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 919, __pyx_L1_error) + __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, 983, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_2); @@ -31127,18 +32795,18 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py } __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, 919, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __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, 919, __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, 983, __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, 919, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __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, 919, __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, 983, __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, 919, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 919, __pyx_L1_error) + __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, 983, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_3); @@ -31149,18 +32817,18 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py } __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, 919, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __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, 919, __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, 983, __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, 919, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __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, 919, __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, 983, __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, 919, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 919, __pyx_L1_error) + __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, 983, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_4); @@ -31171,18 +32839,18 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py } __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, 919, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __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, 919, __pyx_L1_error) + __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, 983, __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, 919, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __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, 919, __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, 983, __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, 919, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 919, __pyx_L1_error) + __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, 983, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_6); @@ -31193,20 +32861,20 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py } __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, 919, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 983, __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, 919, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 983, __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, 919, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 983, __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, 919, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 983, __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, 919, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4)) __PYX_ERR(0, 983, __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; @@ -31215,7 +32883,7 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py __pyx_t_6 = 0; goto __pyx_L0; - /* "collisions.py":912 + /* "collisions.py":976 * 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]: # <<<<<<<<<<<<<< @@ -31240,7 +32908,7 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "collisions.py":921 +/* "collisions.py":985 * 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']: # <<<<<<<<<<<<<< @@ -31302,12 +32970,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 921, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 985, __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, 921, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 985, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -31318,7 +32986,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, 921, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 985, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31354,7 +33022,7 @@ static PyObject *__pyx_pf_10collisions_4Line_16toLines(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":926 + /* "collisions.py":990 * Iterable[Line]: Get a list of all the Lines that make up this object; i.e. just this one line. * """ * return [self] # <<<<<<<<<<<<<< @@ -31362,16 +33030,16 @@ static PyObject *__pyx_pf_10collisions_4Line_16toLines(CYTHON_UNUSED PyObject *_ * def toPoints(self) -> Iterable[pointLike]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __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, 926, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self)) __PYX_ERR(0, 990, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":921 + /* "collisions.py":985 * 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']: # <<<<<<<<<<<<<< @@ -31390,7 +33058,7 @@ static PyObject *__pyx_pf_10collisions_4Line_16toLines(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":928 +/* "collisions.py":992 * return [self] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -31452,12 +33120,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 928, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 992, __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, 928, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 992, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -31468,7 +33136,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, 928, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 992, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31506,31 +33174,31 @@ static PyObject *__pyx_pf_10collisions_4Line_18toPoints(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":933 + /* "collisions.py":997 * Iterable[pointLike]: Get a list of all the Points that make up this object. * """ * return [self.p1, self.p2] # <<<<<<<<<<<<<< * - * def _collides(self, othershape: Shape) -> bool: + * 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, 933, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __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, 933, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 997, __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, 933, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 997, __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":928 + /* "collisions.py":992 * return [self] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -31551,24 +33219,175 @@ static PyObject *__pyx_pf_10collisions_4Line_18toPoints(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":935 +/* "collisions.py":999 * return [self.p1, self.p2] * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * return False + * + */ + +/* Python wrapper */ +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_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 +) { + 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_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, 999, __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, 999, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 999, __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, 999, __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("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 999, __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._contains", __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); + + /* 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_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":1000 + * + * 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":999 + * 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":1002 + * return False + * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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_21_collides(PyObject *__pyx_self, +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_21_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_21_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_21_collides(PyObject *__pyx_self, +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 @@ -31615,7 +33434,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -31623,14 +33442,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 935, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1002, __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, 935, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 1002, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -31643,7 +33462,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, 935, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1002, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31657,7 +33476,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_20_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_4Line_22_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -31670,7 +33489,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":942 +/* "collisions.py":1009 * return False * # Calculate the direction of the lines * def direction(xi, yi, xj, yj, xk, yk): # <<<<<<<<<<<<<< @@ -31746,7 +33565,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -31754,9 +33573,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 1); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 1); __PYX_ERR(0, 1009, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -31764,9 +33583,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 2); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 2); __PYX_ERR(0, 1009, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -31774,9 +33593,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 3); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 3); __PYX_ERR(0, 1009, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -31784,9 +33603,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 4); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 4); __PYX_ERR(0, 1009, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: @@ -31794,14 +33613,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 5); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 5); __PYX_ERR(0, 1009, __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, 942, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "direction") < 0)) __PYX_ERR(0, 1009, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; @@ -31822,7 +33641,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 1009, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31861,7 +33680,7 @@ static PyObject *__pyx_pf_10collisions_4Line_9_collides_direction(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("direction", 1); - /* "collisions.py":943 + /* "collisions.py":1010 * # Calculate the direction of the lines * def direction(xi, yi, xj, yj, xk, yk): * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) # <<<<<<<<<<<<<< @@ -31869,23 +33688,23 @@ static PyObject *__pyx_pf_10collisions_4Line_9_collides_direction(CYTHON_UNUSED * d1 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p1[0], self.p1[1]) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyNumber_Subtract(__pyx_v_xk, __pyx_v_xi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_xk, __pyx_v_xi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __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, 943, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_yj, __pyx_v_yi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __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, 943, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __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, 943, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_yk, __pyx_v_yi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __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, 943, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_xj, __pyx_v_xi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __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, 943, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1010, __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, 943, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __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; @@ -31893,7 +33712,7 @@ static PyObject *__pyx_pf_10collisions_4Line_9_collides_direction(CYTHON_UNUSED __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":942 + /* "collisions.py":1009 * return False * # Calculate the direction of the lines * def direction(xi, yi, xj, yj, xk, yk): # <<<<<<<<<<<<<< @@ -31915,15 +33734,15 @@ static PyObject *__pyx_pf_10collisions_4Line_9_collides_direction(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":935 - * return [self.p1, self.p2] +/* "collisions.py":1002 + * return False * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) */ -static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { +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; @@ -31947,17 +33766,162 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_collides", 1); - /* "collisions.py":936 + /* "collisions.py":1003 + * + * 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): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __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, 1003, __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, 1003, __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, 1003, __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, 1003, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1004 + * 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): + */ + __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, 1004, __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, 1004, __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, 1004, __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, 1004, __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, 1004, __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, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1004, __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, 1004, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 1004, __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, 1004, __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, 1004, __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, 1004, __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":1003 * * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, Line): + * if checkShpType(othershape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error) + } + + /* "collisions.py":1005 + * 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, 1005, __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, 936, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1005, __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, 1005, __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 @@ -31977,161 +33941,22 @@ static PyObject *__pyx_pf_10collisions_4Line_20_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_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) + 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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 936, __pyx_L1_error) + __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_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":937 - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) # <<<<<<<<<<<<<< - * if checkShpType(othershape, Line): - * if not self.check_rects(othershape): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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_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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __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, 937, __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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 937, __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, 937, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 937, __pyx_L1_error); - __pyx_t_4 = 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, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = NULL; - __pyx_t_5 = 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_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __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_L4_bool_binop_done:; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "collisions.py":936 - * - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, Line): - */ - } - - /* "collisions.py":938 - * if checkShpType(othershape, Point): - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, 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, 938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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; - } - } - #endif - { - 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, 938, __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, 938, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - - /* "collisions.py":939 + /* "collisions.py":1006 * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, Line): + * 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, 939, __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, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -32151,17 +33976,17 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject 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, 939, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __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, 939, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = (!__pyx_t_6); if (__pyx_t_10) { - /* "collisions.py":940 - * if checkShpType(othershape, Line): + /* "collisions.py":1007 + * if checkShpType(othershape, ShpTyps.Line): * if not self.check_rects(othershape): * return False # <<<<<<<<<<<<<< * # Calculate the direction of the lines @@ -32172,65 +33997,65 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":939 + /* "collisions.py":1006 * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, Line): + * if checkShpType(othershape, ShpTyps.Line): * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return False * # Calculate the direction of the lines */ } - /* "collisions.py":942 + /* "collisions.py":1009 * 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__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __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__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_direction = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":945 + /* "collisions.py":1012 * 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_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __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, 945, __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, 1012, __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, 945, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __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, 945, __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, 1012, __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, 945, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __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, 945, __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, 1012, __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, 945, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __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, 945, __pyx_L1_error) + __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, 1012, __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, 945, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __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, 945, __pyx_L1_error) + __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, 1012, __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, 945, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __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, 945, __pyx_L1_error) + __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, 1012, __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, 945, __pyx_L1_error) + __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, 1012, __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; @@ -32241,44 +34066,44 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __pyx_v_d1 = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":946 + /* "collisions.py":1013 * * 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_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __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, 946, __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, 1013, __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, 946, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __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, 946, __pyx_L1_error) + __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, 1013, __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, 946, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __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, 946, __pyx_L1_error) + __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, 1013, __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, 946, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __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, 946, __pyx_L1_error) + __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, 1013, __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, 946, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __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, 946, __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, 1013, __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, 946, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __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, 946, __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, 1013, __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, 946, __pyx_L1_error) + __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, 1013, __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; @@ -32289,44 +34114,44 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __pyx_v_d2 = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":947 + /* "collisions.py":1014 * 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, 947, __pyx_L1_error) + __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_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_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_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) + __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_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 947, __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, 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_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __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, 947, __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, 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_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __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, 947, __pyx_L1_error) + __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_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) + __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_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 947, __pyx_L1_error) + __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_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) + __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_9 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 947, __pyx_L1_error) + __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, 947, __pyx_L1_error) + __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; @@ -32337,44 +34162,44 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __pyx_v_d3 = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":948 + /* "collisions.py":1015 * 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, 948, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __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, 948, __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, 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_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __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, 948, __pyx_L1_error) + __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_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) + __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_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 948, __pyx_L1_error) + __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_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) + __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_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 948, __pyx_L1_error) + __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_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) + __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_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __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, 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_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) + __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_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_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, 948, __pyx_L1_error) + __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; @@ -32385,35 +34210,35 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __pyx_v_d4 = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":951 + /* "collisions.py":1018 * * # 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, 951, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_d1, __pyx_v_d2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __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, 951, __pyx_L1_error) + __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, 1018, __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, 951, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1018, __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, 951, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_d3, __pyx_v_d4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __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, 951, __pyx_L1_error) + __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, 1018, __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, 951, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1018, __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":952 + /* "collisions.py":1019 * # Check if the line segments straddle each other * if d1 * d2 < 0 and d3 * d4 < 0: * return True # <<<<<<<<<<<<<< @@ -32425,7 +34250,7 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":951 + /* "collisions.py":1018 * * # Check if the line segments straddle each other * if d1 * d2 < 0 and d3 * d4 < 0: # <<<<<<<<<<<<<< @@ -32434,7 +34259,7 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject */ } - /* "collisions.py":955 + /* "collisions.py":1022 * * # 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 \ # <<<<<<<<<<<<<< @@ -32442,68 +34267,68 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject * (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, 955, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __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, 1022, __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, 955, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __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, 1022, __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, 955, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 1022, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8)) __PYX_ERR(0, 955, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1022, __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, 955, __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, 1022, __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, 955, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __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, 1022, __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, 955, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 1022, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 955, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __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, 1022, __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, 955, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __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, 1022, __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, 955, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7)) __PYX_ERR(0, 1022, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11)) __PYX_ERR(0, 955, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11)) __PYX_ERR(0, 1022, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -32527,11 +34352,11 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __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, 955, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __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, 955, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1022, __pyx_L1_error) if (!__pyx_t_10) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -32542,75 +34367,75 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject } __pyx_L12_next_or:; - /* "collisions.py":956 + /* "collisions.py":1023 * # 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, 956, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __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, 1023, __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, 956, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __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, 1023, __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, 956, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(0, 1023, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(0, 956, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __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, 1023, __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, 956, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __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, 1023, __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, 956, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8)) __PYX_ERR(0, 1023, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11)) __PYX_ERR(0, 956, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __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, 1023, __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, 956, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __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, 1023, __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, 956, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8)) __PYX_ERR(0, 1023, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(0, 956, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(0, 1023, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -32634,11 +34459,11 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __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, 956, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __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, 956, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1023, __pyx_L1_error) if (!__pyx_t_10) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -32649,75 +34474,75 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject } __pyx_L14_next_or:; - /* "collisions.py":957 + /* "collisions.py":1024 * 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, 957, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d3, __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, 957, __pyx_L1_error) + __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_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, 957, __pyx_L1_error) + __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_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 957, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1024, __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, 957, __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, 1024, __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, 957, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1024, __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, 957, __pyx_L1_error) + __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, 1024, __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, 957, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1024, __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, 957, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9)) __PYX_ERR(0, 957, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9)) __PYX_ERR(0, 1024, __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, 957, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1024, __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, 957, __pyx_L1_error) + __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, 1024, __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, 957, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); 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, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 957, __pyx_L1_error) + __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, 1024, __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, 957, __pyx_L1_error) + __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_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4)) __PYX_ERR(0, 957, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7)) __PYX_ERR(0, 957, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7)) __PYX_ERR(0, 1024, __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, 957, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1024, __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, 957, __pyx_L1_error) + __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, 1024, __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, 957, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1024, __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, 957, __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, 1024, __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, 957, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1024, __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, 957, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 957, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 1024, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -32741,11 +34566,11 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __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, 957, __pyx_L1_error) + 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, 957, __pyx_L1_error) + __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 { @@ -32756,16 +34581,16 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject } __pyx_L16_next_or:; - /* "collisions.py":958 + /* "collisions.py":1025 * (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, 958, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d4, __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, 958, __pyx_L1_error) + __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 { @@ -32774,60 +34599,60 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __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, 958, __pyx_L1_error) + __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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1025, __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, 958, __pyx_L1_error) + __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, 1025, __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, 958, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1025, __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, 958, __pyx_L1_error) + __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, 1025, __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, 958, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1025, __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, 958, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9)) __PYX_ERR(0, 1025, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_11)) __PYX_ERR(0, 958, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_11)) __PYX_ERR(0, 1025, __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, 958, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1025, __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, 958, __pyx_L1_error) + __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, 1025, __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, 958, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); 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, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 958, __pyx_L1_error) + __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, 1025, __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, 958, __pyx_L1_error) + __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_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9)) __PYX_ERR(0, 958, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9)) __PYX_ERR(0, 1025, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8)) __PYX_ERR(0, 958, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8)) __PYX_ERR(0, 1025, __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, 958, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1025, __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, 958, __pyx_L1_error) + __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, 1025, __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, 958, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1025, __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, 958, __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, 1025, __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, 958, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1025, __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, 958, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(0, 1025, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -32851,7 +34676,7 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __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, 958, __pyx_L1_error) + 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; } @@ -32863,16 +34688,16 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":938 - * if checkShpType(othershape, Point): + /* "collisions.py":1005 + * if checkShpType(othershape, ShpTyps.Point): * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return False */ } - /* "collisions.py":960 + /* "collisions.py":1027 * (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) # <<<<<<<<<<<<<< @@ -32880,7 +34705,7 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject * 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, 960, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -32900,7 +34725,7 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject 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, 960, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -32908,11 +34733,11 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":935 - * return [self.p1, self.p2] + /* "collisions.py":1002 + * return False * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) */ @@ -32939,24 +34764,24 @@ static PyObject *__pyx_pf_10collisions_4Line_20_collides(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":962 +/* "collisions.py":1029 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_23_where(PyObject *__pyx_self, +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*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_23_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_23_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_23_where(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 @@ -33003,7 +34828,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 962, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -33011,14 +34836,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 962, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 962, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1029, __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, 962, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 1029, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -33031,7 +34856,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, 962, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1029, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33045,7 +34870,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_22_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_4Line_24_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -33058,7 +34883,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":969 +/* "collisions.py":1036 * 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): # <<<<<<<<<<<<<< @@ -33122,7 +34947,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1036, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -33130,14 +34955,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1036, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("line", 1, 2, 2, 1); __PYX_ERR(0, 969, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("line", 1, 2, 2, 1); __PYX_ERR(0, 1036, __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, 969, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "line") < 0)) __PYX_ERR(0, 1036, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -33150,7 +34975,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("line", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 969, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("line", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1036, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33192,73 +35017,73 @@ static PyObject *__pyx_pf_10collisions_4Line_6_where_line(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line", 1); - /* "collisions.py":970 + /* "collisions.py":1037 * # 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, 970, __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, 1037, __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, 970, __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, 1037, __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, 970, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __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":971 + /* "collisions.py":1038 * 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, 971, __pyx_L1_error) + __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, 1038, __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, 971, __pyx_L1_error) + __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, 1038, __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, 971, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __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":972 + /* "collisions.py":1039 * 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_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, 972, __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, 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, 972, __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, 1039, __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, 972, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__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_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, 972, __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, 1039, __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, 972, __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, 1039, __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, 972, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __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, 972, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __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":973 + /* "collisions.py":1040 * B = (p2[0] - p1[0]) * C = (p1[0]*p2[1] - p2[0]*p1[1]) * return A, B, -C # <<<<<<<<<<<<<< @@ -33266,24 +35091,24 @@ static PyObject *__pyx_pf_10collisions_4Line_6_where_line(CYTHON_UNUSED PyObject * 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, 973, __pyx_L1_error) + __pyx_t_1 = PyNumber_Negative(__pyx_v_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1040, __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, 973, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_A)) __PYX_ERR(0, 1040, __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, 973, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_B)) __PYX_ERR(0, 1040, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":969 + /* "collisions.py":1036 * 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): # <<<<<<<<<<<<<< @@ -33308,15 +35133,15 @@ static PyObject *__pyx_pf_10collisions_4Line_6_where_line(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":962 +/* "collisions.py":1029 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] */ -static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { +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; @@ -33339,25 +35164,28 @@ static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":963 + /* "collisions.py":1030 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] - * if checkShpType(othershape, Line): + * if checkShpType(othershape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __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, 963, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1030, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -33365,353 +35193,356 @@ static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + 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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error) + __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, 1030, __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, 963, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":964 + /* "collisions.py":1031 * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] # <<<<<<<<<<<<<< - * if checkShpType(othershape, Line): + * if checkShpType(othershape, ShpTyps.Line): * if not self.collides(othershape): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __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_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_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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error) + 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, 1031, __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1031, __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, 964, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __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, 964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __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, 964, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 964, __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, 964, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __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, 1031, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1031, __pyx_L1_error); + __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_3; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __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, 1031, __pyx_L1_error); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; } else { - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __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":963 + /* "collisions.py":1030 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] - * if checkShpType(othershape, Line): + * if checkShpType(othershape, ShpTyps.Line): */ } - /* "collisions.py":965 - * if checkShpType(othershape, Point): + /* "collisions.py":1032 + * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * if not self.collides(othershape): * return [] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 965, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __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, 1032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __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_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_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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_4}; - __pyx_t_1 = __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error) + 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, 1032, __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 965, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":966 + /* "collisions.py":1033 * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] - * if checkShpType(othershape, Line): + * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 966, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __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_GOTREF(__pyx_t_4); + __pyx_t_2 = 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); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - 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, 966, __pyx_L1_error) + 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, 1033, __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "collisions.py":967 - * if checkShpType(othershape, Line): + /* "collisions.py":1034 + * 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, 967, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":966 + /* "collisions.py":1033 * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] - * if checkShpType(othershape, Line): + * 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":969 + /* "collisions.py":1036 * 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__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error) + __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, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_line = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":974 + /* "collisions.py":1041 * 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, 974, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_pf_10collisions_4Line_6_where_line(__pyx_v_line, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __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, 1041, __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 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error) + __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, 1041, __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, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_10collisions_4Line_6_where_line(__pyx_v_line, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 1041, __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_4; - __pyx_t_4 = 0; - __pyx_v_L2 = __pyx_t_2; + __pyx_v_L1 = __pyx_t_2; __pyx_t_2 = 0; + __pyx_v_L2 = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":975 + /* "collisions.py":1042 * 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_2 = __Pyx_GetItemInt(__pyx_v_L1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error) + __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, 1042, __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, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __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, 975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __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_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, 975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error) + __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, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 975, __pyx_L1_error) + __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, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __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_v_D = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1042, __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":976 + /* "collisions.py":1043 * 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_2 = __Pyx_GetItemInt(__pyx_v_L1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error) + __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, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) + __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, 1043, __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, 1043, __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 = __Pyx_GetItemInt(__pyx_v_L1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error) + __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, 1043, __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, 1043, __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, 976, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __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, 1043, __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_Dx = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_Dx = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":977 + /* "collisions.py":1044 * 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_2 = __Pyx_GetItemInt(__pyx_v_L1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) + __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_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, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_L2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_L1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) + __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, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_Dy = __pyx_t_2; - __pyx_t_2 = 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_Dy = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":978 + /* "collisions.py":1045 * 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, 978, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_D, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1045, __pyx_L1_error) if (__pyx_t_7) { - /* "collisions.py":979 + /* "collisions.py":1046 * 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_2 = __Pyx_PyNumber_Divide(__pyx_v_Dx, __pyx_v_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_x = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_Dx, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_x = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":980 + /* "collisions.py":1047 * if D != 0: * x = Dx / D * y = Dy / D # <<<<<<<<<<<<<< * return [[float(x),float(y)]] * else: */ - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_Dy, __pyx_v_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_y = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_Dy, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_y = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":981 + /* "collisions.py":1048 * x = Dx / D * y = Dy / D * return [[float(x),float(y)]] # <<<<<<<<<<<<<< @@ -33719,28 +35550,28 @@ static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__ * return [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __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, 981, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error); - __pyx_t_2 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1048, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":978 + /* "collisions.py":1045 * Dx = L1[2] * L2[1] - L1[1] * L2[2] * Dy = L1[0] * L2[2] - L1[2] * L2[0] * if D != 0: # <<<<<<<<<<<<<< @@ -33749,7 +35580,7 @@ static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__ */ } - /* "collisions.py":983 + /* "collisions.py":1050 * return [[float(x),float(y)]] * else: * return [] # <<<<<<<<<<<<<< @@ -33758,23 +35589,23 @@ static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__ */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; } - /* "collisions.py":965 - * if checkShpType(othershape, Point): + /* "collisions.py":1032 + * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * if not self.collides(othershape): * return [] */ } - /* "collisions.py":984 + /* "collisions.py":1051 * else: * return [] * return othershape._where(self) # <<<<<<<<<<<<<< @@ -33782,16 +35613,16 @@ static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__ * 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, 984, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; + __pyx_t_3 = 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)) { + __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_2); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -33799,22 +35630,22 @@ static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__ } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self}; - __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, 984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 1051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":962 + /* "collisions.py":1029 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] */ @@ -33840,7 +35671,7 @@ static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":986 +/* "collisions.py":1053 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -33849,16 +35680,16 @@ static PyObject *__pyx_pf_10collisions_4Line_22_where(CYTHON_UNUSED PyObject *__ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_25closestPointTo(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*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_24closestPointTo, "\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_25closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_25closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_24closestPointTo}; -static PyObject *__pyx_pw_10collisions_4Line_25closestPointTo(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 @@ -33909,7 +35740,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 986, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1053, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -33917,21 +35748,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 986, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1053, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 986, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1053, __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, 986, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1053, __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, 986, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 1053, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -33949,7 +35780,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, 986, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1053, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33963,7 +35794,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_24closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); + __pyx_r = __pyx_pf_10collisions_4Line_26closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); /* function exit code */ { @@ -33976,7 +35807,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1014 +/* "collisions.py":1081 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< @@ -34043,7 +35874,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -34051,9 +35882,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 1014, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 1081, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -34061,14 +35892,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 1014, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 1081, __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, 1014, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 1081, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -34083,7 +35914,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, 1014, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1081, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -34131,20 +35962,20 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":1015 + /* "collisions.py":1082 * 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, 1015, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __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, 1015, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1082, __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, 1015, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __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, 1015, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1082, __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; @@ -34167,14 +35998,14 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject __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, 1015, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1082, __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":1016 + /* "collisions.py":1083 * def calculate(ln, point, recalculate): * p2 = ln.closestPointTo(Point(*point)) * olineP = point # <<<<<<<<<<<<<< @@ -34184,17 +36015,17 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject __Pyx_INCREF(__pyx_v_point); __pyx_v_olineP = __pyx_v_point; - /* "collisions.py":1017 + /* "collisions.py":1084 * 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, 1017, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1084, __pyx_L1_error) if (__pyx_t_7) { - /* "collisions.py":1018 + /* "collisions.py":1085 * olineP = point * if recalculate: * olineP = p2 # <<<<<<<<<<<<<< @@ -34204,21 +36035,21 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject __Pyx_INCREF(__pyx_v_p2); __Pyx_DECREF_SET(__pyx_v_olineP, __pyx_v_p2); - /* "collisions.py":1019 + /* "collisions.py":1086 * 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, 1019, __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, 1019, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1086, __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, 1086, __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, 1019, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __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, 1019, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __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, 1019, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1086, __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; @@ -34241,14 +36072,14 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject __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, 1019, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __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":1017 + /* "collisions.py":1084 * p2 = ln.closestPointTo(Point(*point)) * olineP = point * if recalculate: # <<<<<<<<<<<<<< @@ -34257,7 +36088,7 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject */ } - /* "collisions.py":1020 + /* "collisions.py":1087 * olineP = p2 * p2 = self.closestPointTo(Point(*p2)) * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 # <<<<<<<<<<<<<< @@ -34265,51 +36096,51 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject * calculate(self, othershape.p1, False), */ __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, 1020, __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, 1087, __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, 1020, __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, 1087, __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, 1020, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __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, 1020, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __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, 1020, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __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, 1020, __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, 1087, __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, 1020, __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, 1087, __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, 1020, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __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, 1020, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __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, 1020, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __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, 1020, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __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, 1020, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __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, 1020, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p2)) __PYX_ERR(0, 1087, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1087, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1014 + /* "collisions.py":1081 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< @@ -34334,7 +36165,7 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject return __pyx_r; } -/* "collisions.py":1041 +/* "collisions.py":1108 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< @@ -34401,7 +36232,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1041, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -34409,9 +36240,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1041, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 1041, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 1108, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -34419,14 +36250,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1041, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 1041, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 1108, __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, 1041, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 1108, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -34441,7 +36272,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, 1041, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1108, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -34489,20 +36320,20 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":1042 + /* "collisions.py":1109 * 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, 1042, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __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, 1042, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1109, __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, 1042, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1109, __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, 1042, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1109, __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; @@ -34525,14 +36356,14 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec __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, 1042, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __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":1043 + /* "collisions.py":1110 * def calculate(ln, point, recalculate): * p2 = ln.closestPointTo(Point(*point)) * olineP = point # <<<<<<<<<<<<<< @@ -34542,17 +36373,17 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec __Pyx_INCREF(__pyx_v_point); __pyx_v_olineP = __pyx_v_point; - /* "collisions.py":1044 + /* "collisions.py":1111 * 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, 1044, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) if (__pyx_t_7) { - /* "collisions.py":1045 + /* "collisions.py":1112 * olineP = point * if recalculate: * olineP = p2 # <<<<<<<<<<<<<< @@ -34562,21 +36393,21 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec __Pyx_INCREF(__pyx_v_p2); __Pyx_DECREF_SET(__pyx_v_olineP, __pyx_v_p2); - /* "collisions.py":1046 + /* "collisions.py":1113 * 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, 1046, __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, 1046, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1113, __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, 1113, __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, 1046, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1113, __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, 1046, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1113, __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, 1046, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __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; @@ -34599,14 +36430,14 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec __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, 1046, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __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":1044 + /* "collisions.py":1111 * p2 = ln.closestPointTo(Point(*point)) * olineP = point * if recalculate: # <<<<<<<<<<<<<< @@ -34615,7 +36446,7 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec */ } - /* "collisions.py":1047 + /* "collisions.py":1114 * olineP = p2 * p2 = self.closestPointTo(Point(*p2)) * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 # <<<<<<<<<<<<<< @@ -34623,51 +36454,51 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec * calculate(self, p, False) for p in othershape.toPoints() */ __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, 1047, __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, 1114, __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, 1047, __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, 1114, __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, 1047, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __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, 1047, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __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, 1047, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __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, 1047, __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, 1114, __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, 1047, __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, 1114, __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, 1047, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1114, __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, 1047, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __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, 1047, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1114, __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, 1047, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __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, 1047, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1114, __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, 1047, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p2)) __PYX_ERR(0, 1114, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1041 + /* "collisions.py":1108 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< @@ -34692,7 +36523,7 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec return __pyx_r; } -/* "collisions.py":1027 +/* "collisions.py":1094 * calculate(othershape, self.p2, True), * ] * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< @@ -34753,12 +36584,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1027, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1094, __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, 1027, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda7") < 0)) __PYX_ERR(0, 1094, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -34769,7 +36600,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda7", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1027, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda7", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1094, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -34805,7 +36636,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self 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, 1027, __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, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -34822,7 +36653,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "collisions.py":1055 +/* "collisions.py":1122 * calculate(ln, self.p2, True) for ln in othershape.toLines() * ] * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< @@ -34883,12 +36714,12 @@ 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, 1122, __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, 1055, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda8") < 0)) __PYX_ERR(0, 1122, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -34899,7 +36730,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda8", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1055, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda8", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1122, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -34935,7 +36766,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self 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, 1055, __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, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -34952,7 +36783,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "collisions.py":986 +/* "collisions.py":1053 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -34960,7 +36791,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self * Find the closest point ON this object TO another object. */ -static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { +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; @@ -34970,11 +36801,11 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb PyObject *__pyx_v_colls = NULL; PyObject *__pyx_v_calculate = 0; PyObject *__pyx_v_tries = NULL; - PyObject *__pyx_9genexpr14__pyx_v_i = NULL; - PyObject *__pyx_9genexpr15__pyx_v_p = NULL; - PyObject *__pyx_9genexpr16__pyx_v_ln = 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_i = 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; @@ -34997,7 +36828,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb 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, 986, __pyx_L1_error) + __PYX_ERR(0, 1053, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -35005,25 +36836,28 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":997 + /* "collisions.py":1064 * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object * """ - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] * det = dx * dx + dy * dy */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 997, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __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, 997, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -35031,87 +36865,87 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + 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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) + __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, 1064, __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, 997, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1064, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":998 + /* "collisions.py":1065 * """ - * if checkShpType(othershape, Point): + * 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, 998, __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, 1065, __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, 998, __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, 1065, __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, 998, __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, 1065, __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, 998, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1065, __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_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); 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_DECREF(__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, 998, __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, 998, __pyx_L1_error) + __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, 1065, __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, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 998, __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, 998, __pyx_L1_error) + __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, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __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, 1065, __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_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1065, __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_3; - __pyx_t_3 = 0; + __pyx_v_dy = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":999 - * if checkShpType(othershape, Point): + /* "collisions.py":1066 + * 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_3 = PyNumber_Multiply(__pyx_v_dx, __pyx_v_dx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_dx, __pyx_v_dx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __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, 1066, __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_4; - __pyx_t_4 = 0; + __pyx_v_det = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1000 + /* "collisions.py":1067 * 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, 1000, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_det, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1001 + /* "collisions.py":1068 * det = dx * dx + dy * dy * if det == 0: * return self.p1 # <<<<<<<<<<<<<< @@ -35119,13 +36953,13 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb * a = min(1, max(0, a)) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 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, 1068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1000 + /* "collisions.py":1067 * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] * det = dx * dx + dy * dy * if det == 0: # <<<<<<<<<<<<<< @@ -35134,52 +36968,52 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ } - /* "collisions.py":1002 + /* "collisions.py":1069 * 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_4 = __Pyx_GetItemInt(__pyx_v_othershape, 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __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, 1002, __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, 1069, __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, 1069, __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, 1069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1069, __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 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1069, __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, 1002, __pyx_L1_error) + __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, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __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, 1002, __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, 1069, __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, 1069, __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, 1002, __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_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1069, __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_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __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, 1069, __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_4, __pyx_v_det); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_det); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1069, __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_a = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1003 + /* "collisions.py":1070 * return self.p1 * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det * a = min(1, max(0, a)) # <<<<<<<<<<<<<< @@ -35189,116 +37023,116 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_v_a); __pyx_t_2 = __pyx_v_a; __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error) - __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, 1003, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1070, __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, 1070, __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, 1070, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = __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, 1003, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __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_4); - __pyx_t_2 = __pyx_t_4; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 1003, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error) + __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, 1070, __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, 1003, __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, 1070, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = __pyx_t_2; + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1070, __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_4; + __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1004 + /* "collisions.py":1071 * 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] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __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, 1071, __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, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __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, 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_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_a, __pyx_v_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __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, 1004, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1071, __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 = PyNumber_Multiply(__pyx_v_a, __pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __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, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __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, 1071, __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, 1071, __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, 1071, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __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, 1004, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1071, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error); - __pyx_t_3 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error); + __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_v_p = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1005 + /* "collisions.py":1072 * 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, 1005, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1072, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1006 + /* "collisions.py":1073 * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) * if returnAll: * return [p] # <<<<<<<<<<<<<< * return p - * elif checkShpType(othershape, Line): + * elif checkShpType(othershape, ShpTyps.Line): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __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, 1006, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_p)) __PYX_ERR(0, 1073, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1005 + /* "collisions.py":1072 * a = min(1, max(0, a)) * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) * if returnAll: # <<<<<<<<<<<<<< @@ -35307,11 +37141,11 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ } - /* "collisions.py":1007 + /* "collisions.py":1074 * if returnAll: * return [p] * return p # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Line): + * elif checkShpType(othershape, ShpTyps.Line): * colls = self.whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); @@ -35319,26 +37153,29 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __pyx_r = __pyx_v_p; goto __pyx_L0; - /* "collisions.py":997 + /* "collisions.py":1064 * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object * """ - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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":1008 + /* "collisions.py":1075 * return [p] * return p - * elif checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * 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, 1008, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1008, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1075, __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, 1075, __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 @@ -35358,22 +37195,22 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __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, 1008, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __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, 1008, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1009 + /* "collisions.py":1076 * return p - * elif checkShpType(othershape, Line): + * 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, 1009, __pyx_L1_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, 1076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -35393,39 +37230,39 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb 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, 1009, __pyx_L1_error) + 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_v_colls = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1010 - * elif checkShpType(othershape, Line): + /* "collisions.py":1077 + * 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, 1010, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1077, __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, 1010, __pyx_L1_error) + __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, 1077, __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, 1010, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1011 + /* "collisions.py":1078 * 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, 1011, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1078, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1012 + /* "collisions.py":1079 * if colls != []: * if returnAll: * return colls # <<<<<<<<<<<<<< @@ -35437,7 +37274,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __pyx_r = __pyx_v_colls; goto __pyx_L0; - /* "collisions.py":1011 + /* "collisions.py":1078 * colls = self.whereCollides(othershape) * if colls != []: * if returnAll: # <<<<<<<<<<<<<< @@ -35446,7 +37283,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ } - /* "collisions.py":1013 + /* "collisions.py":1080 * if returnAll: * return colls * return colls[0] # <<<<<<<<<<<<<< @@ -35454,14 +37291,14 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb * p2 = ln.closestPointTo(Point(*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, 1013, __pyx_L1_error) + __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, 1080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1010 - * elif checkShpType(othershape, Line): + /* "collisions.py":1077 + * elif checkShpType(othershape, ShpTyps.Line): * colls = self.whereCollides(othershape) * if colls != []: # <<<<<<<<<<<<<< * if returnAll: @@ -35469,131 +37306,131 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ } - /* "collisions.py":1014 + /* "collisions.py":1081 * 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__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) + __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, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_calculate = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1022 + /* "collisions.py":1089 * 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, 1022, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __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, 1022, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_self)) __PYX_ERR(0, 1089, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1089, __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, 1022, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_False)) __PYX_ERR(0, 1089, __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, 1022, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1023 + /* "collisions.py":1090 * 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, 1023, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __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, 1023, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_self)) __PYX_ERR(0, 1090, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1090, __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, 1023, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_False)) __PYX_ERR(0, 1090, __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, 1023, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1024 + /* "collisions.py":1091 * 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, 1024, __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, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __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, 1024, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_othershape)) __PYX_ERR(0, 1091, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1024, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1091, __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, 1024, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_True)) __PYX_ERR(0, 1091, __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, 1024, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1025 + /* "collisions.py":1092 * 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, 1025, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1092, __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, 1025, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_othershape)) __PYX_ERR(0, 1092, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 1092, __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, 1025, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True)) __PYX_ERR(0, 1092, __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, 1025, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1021 + /* "collisions.py":1088 * 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, 1021, __pyx_L1_error) + __pyx_t_8 = PyList_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1088, __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, 1021, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_3)) __PYX_ERR(0, 1021, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_4)) __PYX_ERR(0, 1021, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_4)) __PYX_ERR(0, 1088, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; @@ -35601,47 +37438,47 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __pyx_v_tries = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1027 + /* "collisions.py":1094 * 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, 1027, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1094, __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, 1027, __pyx_L1_error) + __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, 1094, __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, 1027, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 1094, __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, 1027, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1094, __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":1028 + /* "collisions.py":1095 * ] * 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, 1028, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1095, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1029 + /* "collisions.py":1096 * tries.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in tries] # <<<<<<<<<<<<<< * return tries[0][0] - * elif checkShpType(othershape, Circle): + * 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, 1029, __pyx_L11_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0; @@ -35649,28 +37486,28 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(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, 1029, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1096, __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, 1029, __pyx_L11_error) + __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, 1096, __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, 1029, __pyx_L11_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1096, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_i, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_i, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr14__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1029, __pyx_L11_error) + __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, 1096, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1029, __pyx_L11_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1096, __pyx_L11_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); __pyx_9genexpr14__pyx_v_i = 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_9genexpr14__pyx_v_i); __pyx_9genexpr14__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __pyx_9genexpr15__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L15_exit_scope:; } /* exit inner scope */ @@ -35678,7 +37515,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1028 + /* "collisions.py":1095 * ] * tries.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -35687,51 +37524,54 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ } - /* "collisions.py":1030 + /* "collisions.py":1097 * if returnAll: * return [i[0] for i in tries] * return tries[0][0] # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Circle): + * 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, 1030, __pyx_L1_error) + __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, 1097, __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, 1030, __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, 1097, __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":1008 + /* "collisions.py":1075 * return [p] * return p - * elif checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * colls = self.whereCollides(othershape) * if colls != []: */ } - /* "collisions.py":1031 + /* "collisions.py":1098 * return [i[0] for i in tries] * return tries[0][0] - * elif checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1031, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = NULL; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __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_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { + __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_2); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; @@ -35739,66 +37579,66 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_8}; + 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_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __pyx_L1_error) + __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, 1098, __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, 1031, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1032 + /* "collisions.py":1099 * return tries[0][0] - * elif checkShpType(othershape, Circle): + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): * return self.closestPointTo(Point(*othershape.closestPointTo(self))) */ __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, 1032, __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, 1099, __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, 1032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1099, __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, 1099, __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, 1032, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1099, __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_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); + 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_2); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, 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_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __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_8)) __PYX_ERR(0, 1032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_2 = NULL; + __pyx_t_8 = 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)) { + __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_2); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; @@ -35806,11 +37646,11 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_8, __pyx_v_returnAll}; + 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_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) + __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, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -35818,26 +37658,29 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1031 + /* "collisions.py":1098 * return [i[0] for i in tries] * return tries[0][0] - * elif checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): */ } - /* "collisions.py":1033 - * elif checkShpType(othershape, Circle): + /* "collisions.py":1100 + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(*othershape.closestPointTo(self))) * else: # Rects, Rotated rects and polygons */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error) + __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_Arc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __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, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS @@ -35857,27 +37700,27 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __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, 1033, __pyx_L1_error) + 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, 1033, __pyx_L1_error) + __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) { - /* "collisions.py":1034 + /* "collisions.py":1101 * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + * 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1034, __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, 1101, __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, 1034, __pyx_L1_error) + __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_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = NULL; __pyx_t_5 = 0; @@ -35897,14 +37740,14 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb 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, 1034, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1101, __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, 1034, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); 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_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -35927,7 +37770,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __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, 1034, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -35935,16 +37778,16 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1033 - * elif checkShpType(othershape, Circle): + /* "collisions.py":1100 + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(*othershape.closestPointTo(self))) * else: # Rects, Rotated rects and polygons */ } - /* "collisions.py":1036 + /* "collisions.py":1103 * return self.closestPointTo(Point(*othershape.closestPointTo(self))) * else: # Rects, Rotated rects and polygons * colls = self.whereCollides(othershape) # <<<<<<<<<<<<<< @@ -35952,7 +37795,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb * 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, 1036, __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, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -35972,39 +37815,39 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb 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, 1036, __pyx_L1_error) + 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_colls = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1037 + /* "collisions.py":1104 * else: # Rects, Rotated rects and polygons * colls = self.whereCollides(othershape) * if colls != []: # <<<<<<<<<<<<<< * if returnAll: * return colls */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __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, 1037, __pyx_L1_error) + __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, 1104, __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, 1037, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":1038 + /* "collisions.py":1105 * 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, 1038, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1105, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1039 + /* "collisions.py":1106 * if colls != []: * if returnAll: * return colls # <<<<<<<<<<<<<< @@ -36016,7 +37859,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __pyx_r = __pyx_v_colls; goto __pyx_L0; - /* "collisions.py":1038 + /* "collisions.py":1105 * colls = self.whereCollides(othershape) * if colls != []: * if returnAll: # <<<<<<<<<<<<<< @@ -36025,7 +37868,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ } - /* "collisions.py":1040 + /* "collisions.py":1107 * if returnAll: * return colls * return colls[0] # <<<<<<<<<<<<<< @@ -36033,13 +37876,13 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb * 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, 1040, __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, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1037 + /* "collisions.py":1104 * else: # Rects, Rotated rects and polygons * colls = self.whereCollides(othershape) * if colls != []: # <<<<<<<<<<<<<< @@ -36048,19 +37891,19 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ } - /* "collisions.py":1041 + /* "collisions.py":1108 * 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_4Line_14closestPointTo_3calculate, 0, __pyx_n_s_Line_closestPointTo_locals_calcu, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __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__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_calculate = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1052 + /* "collisions.py":1119 * ] + [ * calculate(ln, self.p1, True) for ln in othershape.toLines() * ] + [ # <<<<<<<<<<<<<< @@ -36069,24 +37912,24 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ { /* enter inner scope */ - /* "collisions.py":1048 + /* "collisions.py":1115 * 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, 1048, __pyx_L20_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1115, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_3); - /* "collisions.py":1049 + /* "collisions.py":1116 * 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, 1049, __pyx_L20_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = NULL; __pyx_t_5 = 0; @@ -36106,7 +37949,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb 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, 1049, __pyx_L20_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -36115,9 +37958,9 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __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, 1049, __pyx_L20_error) + __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __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, 1049, __pyx_L20_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1116, __pyx_L20_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -36126,28 +37969,28 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb { 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, 1049, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1116, __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, 1049, __pyx_L20_error) + __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, 1116, __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, 1049, __pyx_L20_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __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, 1049, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1116, __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, 1049, __pyx_L20_error) + __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, 1116, __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, 1049, __pyx_L20_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -36157,59 +38000,59 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(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, 1049, __pyx_L20_error) + else __PYX_ERR(0, 1116, __pyx_L20_error) } break; } __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_p, __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, 1049, __pyx_L20_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __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, 1049, __pyx_L20_error); - __Pyx_INCREF(__pyx_9genexpr15__pyx_v_p); - __Pyx_GIVEREF(__pyx_9genexpr15__pyx_v_p); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_9genexpr15__pyx_v_p)) __PYX_ERR(0, 1049, __pyx_L20_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_self)) __PYX_ERR(0, 1116, __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, 1116, __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, 1049, __pyx_L20_error); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1049, __pyx_L20_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_False)) __PYX_ERR(0, 1116, __pyx_L20_error); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1116, __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, 1048, __pyx_L20_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1115, __pyx_L20_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_p); __pyx_9genexpr15__pyx_v_p = 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_9genexpr15__pyx_v_p); __pyx_9genexpr15__pyx_v_p = 0; + __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":1050 + /* "collisions.py":1117 * 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, 1050, __pyx_L27_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":1051 + /* "collisions.py":1118 * 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, 1051, __pyx_L27_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -36229,7 +38072,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb 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, 1051, __pyx_L27_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1118, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -36238,9 +38081,9 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __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, 1051, __pyx_L27_error) + __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __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, 1051, __pyx_L27_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1118, __pyx_L27_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { @@ -36249,28 +38092,28 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(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, 1051, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1118, __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, 1051, __pyx_L27_error) + __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, 1118, __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, 1051, __pyx_L27_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1118, __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, 1051, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1118, __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, 1051, __pyx_L27_error) + __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, 1118, __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, 1051, __pyx_L27_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1118, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_10); #endif } @@ -36280,73 +38123,73 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(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, 1051, __pyx_L27_error) + else __PYX_ERR(0, 1118, __pyx_L27_error) } break; } __Pyx_GOTREF(__pyx_t_10); } - __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_ln, __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, 1051, __pyx_L27_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1118, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1051, __pyx_L27_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1118, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_9genexpr16__pyx_v_ln); - __Pyx_GIVEREF(__pyx_9genexpr16__pyx_v_ln); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_9genexpr16__pyx_v_ln)) __PYX_ERR(0, 1051, __pyx_L27_error); + __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, 1118, __pyx_L27_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10)) __PYX_ERR(0, 1051, __pyx_L27_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10)) __PYX_ERR(0, 1118, __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, 1051, __pyx_L27_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True)) __PYX_ERR(0, 1118, __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, 1051, __pyx_L27_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1118, __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, 1050, __pyx_L27_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1117, __pyx_L27_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_ln); __pyx_9genexpr16__pyx_v_ln = 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_9genexpr16__pyx_v_ln); __pyx_9genexpr16__pyx_v_ln = 0; + __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":1050 + /* "collisions.py":1117 * 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, 1050, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1117, __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":1052 + /* "collisions.py":1119 * ] + [ * 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, 1052, __pyx_L34_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":1053 + /* "collisions.py":1120 * 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, 1053, __pyx_L34_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1120, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -36366,7 +38209,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb 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, 1053, __pyx_L34_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -36375,9 +38218,9 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __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, 1053, __pyx_L34_error) + __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1120, __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, 1053, __pyx_L34_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1120, __pyx_L34_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -36386,28 +38229,28 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb { 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, 1053, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1120, __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, 1053, __pyx_L34_error) + __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, 1120, __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, 1053, __pyx_L34_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __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, 1053, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1120, __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, 1053, __pyx_L34_error) + __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, 1120, __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, 1053, __pyx_L34_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -36417,88 +38260,88 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(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, 1053, __pyx_L34_error) + else __PYX_ERR(0, 1120, __pyx_L34_error) } break; } __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_ln, __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, 1053, __pyx_L34_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1053, __pyx_L34_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1120, __pyx_L34_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, 1053, __pyx_L34_error); + __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, 1120, __pyx_L34_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L34_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1120, __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, 1053, __pyx_L34_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True)) __PYX_ERR(0, 1120, __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, 1053, __pyx_L34_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __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, 1052, __pyx_L34_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1119, __pyx_L34_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ln); __pyx_9genexpr17__pyx_v_ln = 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_9genexpr17__pyx_v_ln); __pyx_9genexpr17__pyx_v_ln = 0; + __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":1052 + /* "collisions.py":1119 * ] + [ * 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, 1052, __pyx_L1_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1119, __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":1055 + /* "collisions.py":1122 * 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, 1055, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __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, 1055, __pyx_L1_error) + __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, 1122, __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, 1055, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1122, __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, 1055, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1122, __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":1056 + /* "collisions.py":1123 * ] * 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, 1056, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1123, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1057 + /* "collisions.py":1124 * tries.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in tries] # <<<<<<<<<<<<<< @@ -36507,7 +38350,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1057, __pyx_L42_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1124, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; @@ -36515,28 +38358,28 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb { 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, 1057, __pyx_L42_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1124, __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, 1057, __pyx_L42_error) + __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, 1124, __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, 1057, __pyx_L42_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1124, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_10); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_i, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_i, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_9genexpr18__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1057, __pyx_L42_error) + __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, 1124, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_10); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1057, __pyx_L42_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1124, __pyx_L42_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i); __pyx_9genexpr18__pyx_v_i = 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_9genexpr18__pyx_v_i); __pyx_9genexpr18__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L46_exit_scope:; } /* exit inner scope */ @@ -36544,7 +38387,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1056 + /* "collisions.py":1123 * ] * tries.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -36553,7 +38396,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb */ } - /* "collisions.py":1058 + /* "collisions.py":1125 * if returnAll: * return [i[0] for i in tries] * return tries[0][0] # <<<<<<<<<<<<<< @@ -36561,9 +38404,9 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb * 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, 1058, __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, 1125, __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, 1058, __pyx_L1_error) + __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, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; @@ -36571,7 +38414,7 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb goto __pyx_L0; } - /* "collisions.py":986 + /* "collisions.py":1053 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -36599,18 +38442,18 @@ static PyObject *__pyx_pf_10collisions_4Line_24closestPointTo(CYTHON_UNUSED PyOb __Pyx_XDECREF(__pyx_v_colls); __Pyx_XDECREF(__pyx_v_calculate); __Pyx_XDECREF(__pyx_v_tries); - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_ln); + __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_i); + __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":1060 +/* "collisions.py":1127 * return tries[0][0] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -36628,18 +38471,18 @@ static PyObject *__pyx_pf_10collisions_36__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, 1060, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1127, __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, 1060, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1127, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1127, __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, 1060, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1127, __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, 1060, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1127, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -36658,16 +38501,16 @@ static PyObject *__pyx_pf_10collisions_36__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_27isCorner(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*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_26isCorner, "\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_27isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_27isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_26isCorner}; -static PyObject *__pyx_pw_10collisions_4Line_27isCorner(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 @@ -36719,7 +38562,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1060, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -36727,21 +38570,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1060, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1060, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1127, __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, 1060, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1127, __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, 1060, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 1127, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -36759,7 +38602,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, 1060, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1127, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36773,7 +38616,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_26isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); + __pyx_r = __pyx_pf_10collisions_4Line_28isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); /* function exit code */ { @@ -36786,7 +38629,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1071 +/* "collisions.py":1138 * bool: Whether the point is on a corner of this shape * """ * def rountTuple(x): # <<<<<<<<<<<<<< @@ -36847,12 +38690,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1071, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1138, __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, 1071, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rountTuple") < 0)) __PYX_ERR(0, 1138, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -36863,7 +38706,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rountTuple", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1071, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rountTuple", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36905,7 +38748,7 @@ static PyObject *__pyx_pf_10collisions_4Line_8isCorner_rountTuple(PyObject *__py __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":1072 + /* "collisions.py":1139 * """ * def rountTuple(x): * return (round(x[0], precision), round(x[1], precision)) # <<<<<<<<<<<<<< @@ -36913,47 +38756,47 @@ static PyObject *__pyx_pf_10collisions_4Line_8isCorner_rountTuple(PyObject *__py * */ __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, 1072, __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, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1072, __pyx_L1_error) } - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1139, __pyx_L1_error) } + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1139, __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, 1072, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1139, __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, 1072, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_precision)) __PYX_ERR(0, 1139, __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, 1072, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1139, __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, 1072, __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, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1072, __pyx_L1_error) } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1139, __pyx_L1_error) } + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __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, 1072, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1139, __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, 1072, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_precision)) __PYX_ERR(0, 1139, __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, 1072, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1139, __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, 1072, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __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, 1072, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1139, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1139, __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":1071 + /* "collisions.py":1138 * bool: Whether the point is on a corner of this shape * """ * def rountTuple(x): # <<<<<<<<<<<<<< @@ -36974,7 +38817,7 @@ static PyObject *__pyx_pf_10collisions_4Line_8isCorner_rountTuple(PyObject *__py return __pyx_r; } -/* "collisions.py":1060 +/* "collisions.py":1127 * return tries[0][0] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -36982,7 +38825,7 @@ static PyObject *__pyx_pf_10collisions_4Line_8isCorner_rountTuple(PyObject *__py * Finds whether a point is on a corner of this shape. */ -static PyObject *__pyx_pf_10collisions_4Line_26isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision) { +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; @@ -37000,7 +38843,7 @@ static PyObject *__pyx_pf_10collisions_4Line_26isCorner(CYTHON_UNUSED PyObject * 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, 1060, __pyx_L1_error) + __PYX_ERR(0, 1127, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -37008,19 +38851,19 @@ static PyObject *__pyx_pf_10collisions_4Line_26isCorner(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_cur_scope->__pyx_v_precision); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_precision); - /* "collisions.py":1071 + /* "collisions.py":1138 * 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__13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error) + __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, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rountTuple = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1073 + /* "collisions.py":1140 * def rountTuple(x): * return (round(x[0], precision), round(x[1], precision)) * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) # <<<<<<<<<<<<<< @@ -37028,17 +38871,17 @@ static PyObject *__pyx_pf_10collisions_4Line_26isCorner(CYTHON_UNUSED PyObject * * 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, 1073, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1140, __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, 1073, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1140, __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, 1073, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_v_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1140, __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, 1073, __pyx_L1_error) + __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, 1140, __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, 1073, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1140, __pyx_L1_error) if (!__pyx_t_5) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { @@ -37047,14 +38890,14 @@ static PyObject *__pyx_pf_10collisions_4Line_26isCorner(CYTHON_UNUSED PyObject * __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, 1073, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __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, 1073, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1140, __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, 1073, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __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, 1073, __pyx_L1_error) + __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, 1140, __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); @@ -37065,7 +38908,7 @@ static PyObject *__pyx_pf_10collisions_4Line_26isCorner(CYTHON_UNUSED PyObject * __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1060 + /* "collisions.py":1127 * return tries[0][0] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -37089,7 +38932,7 @@ static PyObject *__pyx_pf_10collisions_4Line_26isCorner(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":1075 +/* "collisions.py":1142 * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -37098,16 +38941,16 @@ static PyObject *__pyx_pf_10collisions_4Line_26isCorner(CYTHON_UNUSED PyObject * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_29tangent(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*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_28tangent, "\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_29tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_29tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_28tangent}; -static PyObject *__pyx_pw_10collisions_4Line_29tangent(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 @@ -37157,7 +39000,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1075, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -37165,9 +39008,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1075, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 1075, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 1142, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -37175,14 +39018,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1075, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 1075, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 1142, __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, 1075, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 1142, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -37197,7 +39040,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, 1075, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1142, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37211,7 +39054,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_28tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); + __pyx_r = __pyx_pf_10collisions_4Line_30tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); /* function exit code */ { @@ -37224,7 +39067,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1090 +/* "collisions.py":1157 * elif point == self.p2: * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) * def fixangle(angle): # <<<<<<<<<<<<<< @@ -37285,12 +39128,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L3_error) + 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, "fixangle") < 0)) __PYX_ERR(0, 1090, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fixangle") < 0)) __PYX_ERR(0, 1157, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -37301,7 +39144,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fixangle", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1090, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fixangle", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1157, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37339,43 +39182,43 @@ static PyObject *__pyx_pf_10collisions_4Line_7tangent_fixangle(CYTHON_UNUSED PyO __Pyx_RefNannySetupContext("fixangle", 0); __Pyx_INCREF(__pyx_v_angle); - /* "collisions.py":1091 + /* "collisions.py":1158 * 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, 1091, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_angle, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1092 + /* "collisions.py":1159 * 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, 1092, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1092, __pyx_L1_error) + __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, 1159, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1093 + /* "collisions.py":1160 * 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, 1093, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__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; - /* "collisions.py":1092 + /* "collisions.py":1159 * def fixangle(angle): * angle = angle % 360 * if angle > 180: # <<<<<<<<<<<<<< @@ -37384,7 +39227,7 @@ static PyObject *__pyx_pf_10collisions_4Line_7tangent_fixangle(CYTHON_UNUSED PyO */ } - /* "collisions.py":1094 + /* "collisions.py":1161 * if angle > 180: * angle = angle - 360 * return abs(angle) # Because we don't need to use this for anything else # <<<<<<<<<<<<<< @@ -37392,13 +39235,13 @@ static PyObject *__pyx_pf_10collisions_4Line_7tangent_fixangle(CYTHON_UNUSED PyO * 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_PyNumber_Absolute(__pyx_v_angle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_v_angle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1090 + /* "collisions.py":1157 * elif point == self.p2: * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) * def fixangle(angle): # <<<<<<<<<<<<<< @@ -37418,7 +39261,7 @@ static PyObject *__pyx_pf_10collisions_4Line_7tangent_fixangle(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":1075 +/* "collisions.py":1142 * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -37426,7 +39269,7 @@ static PyObject *__pyx_pf_10collisions_4Line_7tangent_fixangle(CYTHON_UNUSED PyO * Finds the tangent on this surface to a point with a given velocity. */ -static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel) { +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; @@ -37448,22 +39291,22 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tangent", 1); - /* "collisions.py":1086 + /* "collisions.py":1153 * 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: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __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, 1086, __pyx_L1_error) + __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, 1153, __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, 1086, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "collisions.py":1087 + /* "collisions.py":1154 * """ * if point == self.p1: * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) # <<<<<<<<<<<<<< @@ -37471,41 +39314,41 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __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, 1087, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_degrees); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __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, 1087, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1154, __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, 1087, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1154, __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, 1087, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1154, __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, 1087, __pyx_L1_error) + __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, 1154, __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, 1087, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1154, __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, 1087, __pyx_L1_error) + __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, 1154, __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, 1087, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1154, __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, 1087, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1154, __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, 1087, __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, 1154, __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, 1087, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1154, __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, 1087, __pyx_L1_error) + __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, 1154, __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, 1087, __pyx_L1_error) + __pyx_t_8 = PyNumber_Subtract(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1154, __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; @@ -37529,7 +39372,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(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_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -37552,7 +39395,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ __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, 1087, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -37560,7 +39403,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1086 + /* "collisions.py":1153 * Number: The tangent of the line at the point. You can -90 to get the normal. * """ * if point == self.p1: # <<<<<<<<<<<<<< @@ -37569,22 +39412,22 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1088 + /* "collisions.py":1155 * 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, 1088, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __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, 1088, __pyx_L1_error) + __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, 1155, __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, 1088, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "collisions.py":1089 + /* "collisions.py":1156 * 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])) # <<<<<<<<<<<<<< @@ -37592,41 +39435,41 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ * angle = angle % 360 */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __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, 1089, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __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, 1089, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1156, __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, 1089, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atan2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1156, __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, 1089, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1156, __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, 1089, __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, 1156, __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, 1089, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1156, __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, 1089, __pyx_L1_error) + __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, 1156, __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, 1089, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_9); 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_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, 1089, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1156, __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, 1089, __pyx_L1_error) + __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, 1156, __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, 1089, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1156, __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, 1089, __pyx_L1_error) + __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, 1156, __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, 1089, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1156, __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; @@ -37650,7 +39493,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ __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, 1089, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -37673,7 +39516,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ __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, 1089, __pyx_L1_error) + 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; } @@ -37681,7 +39524,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1088 + /* "collisions.py":1155 * 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: # <<<<<<<<<<<<<< @@ -37690,38 +39533,38 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1090 + /* "collisions.py":1157 * 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__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error) + __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, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_fixangle = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1095 + /* "collisions.py":1162 * 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, 1095, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __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, 1095, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_degrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __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, 1095, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1162, __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, 1095, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atan2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1162, __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, 1095, __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, 1162, __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, 1095, __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, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_10 = 0; @@ -37743,7 +39586,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(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_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -37766,61 +39609,61 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ __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, 1095, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1162, __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, 1095, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __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, 1095, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_RemainderObjC(__pyx_t_2, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1162, __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":1096 + /* "collisions.py":1163 * 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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __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, 1096, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __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, 1096, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1163, __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, 1096, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1163, __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, 1096, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1163, __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, 1096, __pyx_L1_error) + __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, 1163, __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, 1096, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1163, __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, 1096, __pyx_L1_error) + __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, 1163, __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, 1096, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1163, __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, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1163, __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, 1096, __pyx_L1_error) + __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, 1163, __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, 1096, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1163, __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, 1096, __pyx_L1_error) + __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, 1163, __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, 1096, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1163, __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; @@ -37844,7 +39687,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ __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, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -37867,48 +39710,48 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ __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, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1163, __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, 1096, __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, 1163, __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; - /* "collisions.py":1097 + /* "collisions.py":1164 * 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_1 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_toDeg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_toDeg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __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, 1097, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10collisions_4Line_7tangent_fixangle(__pyx_v_fixangle, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1164, __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, 1097, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_toDeg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __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, 1097, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __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_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, 1097, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_4Line_7tangent_fixangle(__pyx_v_fixangle, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __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, 1097, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __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, 1097, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1164, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_v_tries = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1098 + /* "collisions.py":1165 * 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))] # <<<<<<<<<<<<<< @@ -37916,27 +39759,27 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ * def handleCollisionsPos(self, */ __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, 1098, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __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, 1098, __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, 1165, __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, 1098, __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, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1165, __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, 1098, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1165, __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, 1098, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_tries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __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, 1098, __pyx_L1_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_tries, __pyx_t_2); 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_t_2 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __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; @@ -37944,7 +39787,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1075 + /* "collisions.py":1142 * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -37974,7 +39817,7 @@ static PyObject *__pyx_pf_10collisions_4Line_28tangent(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":1100 +/* "collisions.py":1167 * return [(phi-180)%360, phi % 360][tries.index(min(tries))] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -37993,42 +39836,42 @@ static PyObject *__pyx_pf_10collisions_38__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":1107 + /* "collisions.py":1174 * replaceSelf: bool = True, * precision: Number = BASEPRECISION, * verbose: bool = False # <<<<<<<<<<<<<< * ) -> tuple['Line', pointLike, verboseOutput]: * """ */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __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, 1100, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 1167, __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, 1100, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 1167, __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, 1100, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1167, __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, 1100, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 1167, __pyx_L1_error); - /* "collisions.py":1100 + /* "collisions.py":1167 * return [(phi-180)%360, phi % 360][tries.index(min(tries))] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldLine: 'Line', * newLine: 'Line', */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __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, 1100, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1167, __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, 1100, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1167, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -38047,16 +39890,16 @@ static PyObject *__pyx_pf_10collisions_38__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_31handleCollisionsPos(PyObject *__pyx_self, +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_30handleCollisionsPos, "\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_31handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_31handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_30handleCollisionsPos}; -static PyObject *__pyx_pw_10collisions_4Line_31handleCollisionsPos(PyObject *__pyx_self, +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 @@ -38126,7 +39969,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1167, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -38134,9 +39977,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1167, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 1100, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 1167, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -38144,9 +39987,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1167, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 1100, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 1167, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -38154,42 +39997,42 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1167, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 1100, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 1167, __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, 1100, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1167, __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, 1100, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1167, __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, 1100, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1167, __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, 1100, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1167, __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, 1100, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 1167, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -38220,7 +40063,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, 1100, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 1167, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38234,7 +40077,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_30handleCollisionsPos(__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); + __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 */ { @@ -38247,7 +40090,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1132 +/* "collisions.py":1199 * DidReflect (bool): Whether the line reflected off of something * """ * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< @@ -38308,12 +40151,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1199, __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, 1132, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda9") < 0)) __PYX_ERR(0, 1199, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -38324,7 +40167,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda9", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1132, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda9", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1199, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38360,7 +40203,7 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self 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, 1132, __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, 1199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -38377,12 +40220,12 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "collisions.py":1133 +/* "collisions.py":1200 * """ * 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) - * points = [] + * # Don't let you move when you're in a wall */ /* Python wrapper */ @@ -38438,12 +40281,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1133, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1200, __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, "lambda10") < 0)) __PYX_ERR(0, 1133, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda10") < 0)) __PYX_ERR(0, 1200, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -38454,7 +40297,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda10", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1133, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda10", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1200, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38490,7 +40333,7 @@ static PyObject *__pyx_lambda_funcdef_lambda10(CYTHON_UNUSED PyObject *__pyx_sel 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, 1133, __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, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -38507,9 +40350,9 @@ static PyObject *__pyx_lambda_funcdef_lambda10(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":1155 - * return oldLine, [0, 0], [None, True] - * return oldLine, [0, 0] +/* "collisions.py":1222 + * 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 @@ -38568,12 +40411,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1155, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1222, __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, 1155, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda11") < 0)) __PYX_ERR(0, 1222, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -38584,7 +40427,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, 1155, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda11", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1222, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38620,7 +40463,7 @@ static PyObject *__pyx_lambda_funcdef_lambda11(CYTHON_UNUSED PyObject *__pyx_sel 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, 1155, __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, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -38637,12 +40480,12 @@ static PyObject *__pyx_lambda_funcdef_lambda11(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":1174 - * 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":1244 + * 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 */ @@ -38698,12 +40541,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1244, __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, 1174, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda12") < 0)) __PYX_ERR(0, 1244, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -38714,7 +40557,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda12", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda12", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1244, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38750,7 +40593,7 @@ static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_sel 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, 1174, __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, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -38767,7 +40610,7 @@ static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":1100 +/* "collisions.py":1167 * return [(phi-180)%360, phi % 360][tries.index(min(tries))] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -38775,7 +40618,7 @@ static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_sel * newLine: 'Line', */ -static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(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) { +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; @@ -38788,8 +40631,8 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_v_newPoint = NULL; PyObject *__pyx_v_thisNormal = NULL; PyObject *__pyx_v_paralell = NULL; - PyObject *__pyx_v_cLine = 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; @@ -38808,8 +40651,8 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_v_newp2 = NULL; PyObject *__pyx_v_out = NULL; PyObject *__pyx_v_outvel = NULL; - PyObject *__pyx_9genexpr19__pyx_v_i = 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; @@ -38820,9 +40663,9 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; - Py_ssize_t __pyx_t_9; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_t_11; + 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; @@ -38839,114 +40682,114 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_v_newLine); __Pyx_INCREF(__pyx_v_vel); - /* "collisions.py":1132 + /* "collisions.py":1199 * 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, 1132, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __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, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __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, 1132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __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, 1132, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1199, __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, 1132, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1199, __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, 1132, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1199, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __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, 1132, __pyx_L1_error) + __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, 1199, __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, 1132, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 1199, __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, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __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, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __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, 1132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_oldLine, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1133 + /* "collisions.py":1200 * """ * 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) - * points = [] + * # 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, 1133, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __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, 1133, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __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, 1133, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __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, 1133, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1200, __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, 1133, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __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, 1133, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __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, 1133, __pyx_L1_error) + __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, 1200, __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, 1133, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1200, __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, 1133, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __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, 1133, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __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, 1133, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __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":1134 + /* "collisions.py":1201 * 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) # <<<<<<<<<<<<<< - * points = [] - * hit = False + * # 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, 1134, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __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, 1134, __pyx_L1_error) + __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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __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, 1134, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1201, __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, 1134, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -38970,27 +40813,157 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __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, 1134, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __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":1135 - * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) + /* "collisions.py":1203 * 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, 1203, __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, 1203, __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, 1203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "collisions.py":1204 + * # 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, 1204, __pyx_L1_error) + if (__pyx_t_9) { + + /* "collisions.py":1205 + * 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, 1205, __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, 1205, __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, 1205, __pyx_L1_error); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __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, 1205, __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, 1205, __pyx_L1_error); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1205, __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, 1205, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 1205, __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":1204 + * # 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":1206 + * 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, 1206, __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, 1206, __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, 1206, __pyx_L1_error); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __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, 1206, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":1203 + * 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":1207 + * return oldLine, [0, 0], [None, True] + * return oldLine, [0, 0] * points = [] # <<<<<<<<<<<<<< * hit = False * for o in objs: */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_points = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_points = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":1136 - * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) + /* "collisions.py":1208 + * return oldLine, [0, 0] * points = [] * hit = False # <<<<<<<<<<<<<< * for o in objs: @@ -38998,7 +40971,7 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED */ __pyx_v_hit = 0; - /* "collisions.py":1137 + /* "collisions.py":1209 * points = [] * hit = False * for o in objs: # <<<<<<<<<<<<<< @@ -39006,96 +40979,96 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED * hit = True */ 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_9 = 0; - __pyx_t_10 = NULL; + __pyx_t_3 = __pyx_v_objs; __Pyx_INCREF(__pyx_t_3); + __pyx_t_10 = 0; + __pyx_t_11 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1137, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __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, 1209, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_10)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + 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, 1137, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1209, __pyx_L1_error) #endif - if (__pyx_t_9 >= __pyx_temp) break; + if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1137, __pyx_L1_error) + __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, 1209, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + 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, 1137, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1209, __pyx_L1_error) #endif - if (__pyx_t_9 >= __pyx_temp) break; + if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1137, __pyx_L1_error) + __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, 1209, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); #endif } } else { - __pyx_t_3 = __pyx_t_10(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { + __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, 1137, __pyx_L1_error) + else __PYX_ERR(0, 1209, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_6); } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_6); + __pyx_t_6 = 0; - /* "collisions.py":1138 + /* "collisions.py":1210 * 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1210, __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_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + 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_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, 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_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __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_3)) __PYX_ERR(0, 1138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1210, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { - /* "collisions.py":1139 + /* "collisions.py":1211 * for o in objs: * if o.collides(mvement): * hit = True # <<<<<<<<<<<<<< @@ -39104,41 +41077,41 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED */ __pyx_v_hit = 1; - /* "collisions.py":1140 + /* "collisions.py":1212 * 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); 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_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + 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_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, 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_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __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_3)) __PYX_ERR(0, 1140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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; } { /* enter inner scope */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L8_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1212, __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, 1212, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -39158,7 +41131,7 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED 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, 1140, __pyx_L8_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1212, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -39167,9 +41140,9 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(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, 1140, __pyx_L8_error) + __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __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, 1140, __pyx_L8_error) + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1212, __pyx_L10_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -39178,28 +41151,28 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(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, 1140, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1212, __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, 1140, __pyx_L8_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, 1212, __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, 1140, __pyx_L8_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1212, __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, 1140, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1212, __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, 1140, __pyx_L8_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, 1212, __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, 1140, __pyx_L8_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1212, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -39209,21 +41182,21 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(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, 1140, __pyx_L8_error) + else __PYX_ERR(0, 1212, __pyx_L10_error) } break; } __Pyx_GOTREF(__pyx_t_5); } - __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_i, __pyx_t_5); + __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, 1140, __pyx_L8_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1212, __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, 1140, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1212, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_9genexpr19__pyx_v_i); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1140, __pyx_L8_error) + __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_9genexpr20__pyx_v_i); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1212, __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, 1140, __pyx_L8_error) + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1212, __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; @@ -39246,32 +41219,32 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(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, 1140, __pyx_L8_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1212, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1140, __pyx_L8_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1212, __pyx_L10_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_11) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_9genexpr19__pyx_v_i))) __PYX_ERR(0, 1140, __pyx_L8_error) + if (__pyx_t_9) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr20__pyx_v_i))) __PYX_ERR(0, 1212, __pyx_L10_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__pyx_v_i = 0; - goto __pyx_L13_exit_scope; - __pyx_L8_error:; - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_i); __pyx_9genexpr20__pyx_v_i = 0; + goto __pyx_L15_exit_scope; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_i); __pyx_9genexpr20__pyx_v_i = 0; goto __pyx_L1_error; - __pyx_L13_exit_scope:; + __pyx_L15_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __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":1141 + /* "collisions.py":1213 * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: # <<<<<<<<<<<<<< @@ -39283,9 +41256,9 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(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, 1141, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __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, 1141, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1213, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_13)) { @@ -39293,79 +41266,79 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(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, 1141, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1141, __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, 1213, __pyx_L1_error) #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __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, 1141, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1141, __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, 1213, __pyx_L1_error) #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif } } else { - __pyx_t_6 = __pyx_t_13(__pyx_t_1); - if (unlikely(!__pyx_t_6)) { + __pyx_t_4 = __pyx_t_13(__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, 1141, __pyx_L1_error) + else __PYX_ERR(0, 1213, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_6); - __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_4); + __pyx_t_4 = 0; - /* "collisions.py":1143 + /* "collisions.py":1215 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1215, __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, 1215, __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, 1143, __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, 1215, __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, 1143, __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, 1215, __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, 1143, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1215, __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, 1143, __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, 1215, __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, 1143, __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, 1215, __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, 1143, __pyx_L1_error) + __pyx_t_16 = PyNumber_Subtract(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1215, __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, 1143, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1215, __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, 1143, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7)) __PYX_ERR(0, 1215, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16)) __PYX_ERR(0, 1143, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16)) __PYX_ERR(0, 1215, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_16 = 0; __pyx_t_16 = NULL; @@ -39387,93 +41360,93 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(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, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __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_6)) __PYX_ERR(0, 1143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1215, __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_6); - __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_cPoint, __pyx_t_4); + __pyx_t_4 = 0; - /* "collisions.py":1144 + /* "collisions.py":1216 * # 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_6 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1144, __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, 1216, __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, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1216, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_t_5 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __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, 1144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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, 1144, __pyx_L1_error) + __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, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __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, 1216, __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, 1216, __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_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __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, 1216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __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, 1216, __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, 1144, __pyx_L1_error) + __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __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, 1144, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_p)) __PYX_ERR(0, 1216, __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, 1144, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_o)) __PYX_ERR(0, 1216, __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, 1144, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6)) __PYX_ERR(0, 1144, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_2); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1144, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_v_cPoint)) __PYX_ERR(0, 1216, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_4)) __PYX_ERR(0, 1216, __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, 1216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1141 + /* "collisions.py":1213 * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: # <<<<<<<<<<<<<< @@ -39483,7 +41456,7 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1138 + /* "collisions.py":1210 * hit = False * for o in objs: * if o.collides(mvement): # <<<<<<<<<<<<<< @@ -39492,7 +41465,7 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1137 + /* "collisions.py":1209 * points = [] * hit = False * for o in objs: # <<<<<<<<<<<<<< @@ -39500,60 +41473,60 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED * hit = True */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1146 + /* "collisions.py":1218 * 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: # <<<<<<<<<<<<<< * if verbose: * return newLine, vel, [None, False] */ - __pyx_t_11 = (!__pyx_v_hit); - if (__pyx_t_11) { + __pyx_t_9 = (!__pyx_v_hit); + if (__pyx_t_9) { - /* "collisions.py":1147 + /* "collisions.py":1219 * #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_11 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1147, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1219, __pyx_L1_error) + if (__pyx_t_9) { - /* "collisions.py":1148 + /* "collisions.py":1220 * if not hit: * if verbose: * return newLine, vel, [None, False] # <<<<<<<<<<<<<< * return newLine, vel - * # Don't let you move when you're in a wall + * points.sort(key=lambda x: x[3]) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, Py_None)) __PYX_ERR(0, 1148, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(0, 1220, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, Py_False)) __PYX_ERR(0, 1148, __pyx_L1_error); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1148, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, Py_False)) __PYX_ERR(0, 1220, __pyx_L1_error); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __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, 1148, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_newLine)) __PYX_ERR(0, 1220, __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, 1148, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L1_error); - __pyx_t_4 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_vel)) __PYX_ERR(0, 1220, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3)) __PYX_ERR(0, 1220, __pyx_L1_error); + __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1147 + /* "collisions.py":1219 * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: * if verbose: # <<<<<<<<<<<<<< @@ -39562,27 +41535,27 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1149 + /* "collisions.py":1221 * if verbose: * return newLine, vel, [None, False] * return newLine, vel # <<<<<<<<<<<<<< - * # Don't let you move when you're in a wall - * if points == []: + * points.sort(key=lambda x: x[3]) + * 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, 1149, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1221, __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, 1149, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_newLine)) __PYX_ERR(0, 1221, __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, 1149, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_vel)) __PYX_ERR(0, 1221, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1146 + /* "collisions.py":1218 * 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: # <<<<<<<<<<<<<< @@ -39591,319 +41564,209 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1151 - * return newLine, vel - * # Don't let you move when you're in a wall - * if points == []: # <<<<<<<<<<<<<< - * if verbose: - * return oldLine, [0, 0], [None, True] - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_points, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1151, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_11) { - - /* "collisions.py":1152 - * # Don't let you move when you're in a wall - * if points == []: - * if verbose: # <<<<<<<<<<<<<< - * return oldLine, [0, 0], [None, True] - * return oldLine, [0, 0] - */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) - if (__pyx_t_11) { - - /* "collisions.py":1153 - * if points == []: - * if verbose: - * return oldLine, [0, 0], [None, True] # <<<<<<<<<<<<<< - * return oldLine, [0, 0] - * points.sort(key=lambda x: x[3]) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __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, 1153, __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, 1153, __pyx_L1_error); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __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, 1153, __pyx_L1_error); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, Py_True)) __PYX_ERR(0, 1153, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_oldLine); - __Pyx_GIVEREF(__pyx_v_oldLine); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_oldLine)) __PYX_ERR(0, 1153, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 1153, __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":1152 - * # Don't let you move when you're in a wall - * if points == []: - * if verbose: # <<<<<<<<<<<<<< - * return oldLine, [0, 0], [None, True] - * return oldLine, [0, 0] - */ - } - - /* "collisions.py":1154 - * if verbose: - * return oldLine, [0, 0], [None, True] - * return oldLine, [0, 0] # <<<<<<<<<<<<<< - * points.sort(key=lambda x: x[3]) - * closestP = points[0][0] # Closest point on the OTHER object - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __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, 1154, __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, 1154, __pyx_L1_error); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_oldLine); - __Pyx_GIVEREF(__pyx_v_oldLine); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_oldLine)) __PYX_ERR(0, 1154, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "collisions.py":1151 + /* "collisions.py":1222 + * return newLine, vel, [None, False] * return newLine, vel - * # Don't let you move when you're in a wall - * if points == []: # <<<<<<<<<<<<<< - * if verbose: - * return oldLine, [0, 0], [None, True] - */ - } - - /* "collisions.py":1155 - * return oldLine, [0, 0], [None, True] - * return oldLine, [0, 0] * 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, 1155, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __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, 1222, __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, 1222, __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, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __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_4)) __PYX_ERR(0, 1155, __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, 1155, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1155, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1156 - * return oldLine, [0, 0] + /* "collisions.py":1223 + * 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_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, 1156, __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, 1156, __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, 1223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_closestP = __pyx_t_2; - __pyx_t_2 = 0; + __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, 1223, __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":1157 + /* "collisions.py":1224 * 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_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, 1157, __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, 1224, __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, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_cPoint, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_cPoint, __pyx_t_2); + __pyx_t_2 = 0; - /* "collisions.py":1158 + /* "collisions.py":1225 * 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_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, 1158, __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, 1158, __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, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_closestObj = __pyx_t_2; - __pyx_t_2 = 0; + __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, 1225, __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":1159 + /* "collisions.py":1226 * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __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, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __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, 1159, __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, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1159, __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, 1226, __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, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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, 1159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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, 1159, __pyx_L1_error) + __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, 1226, __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, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_16 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_t_16 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 1159, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1226, __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, 1159, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_15)) __PYX_ERR(0, 1226, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_16)) __PYX_ERR(0, 1159, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_16)) __PYX_ERR(0, 1226, __pyx_L1_error); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_16 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_6); + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_16)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_v_closestP, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __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, 1159, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __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_t_6 = NULL; + __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (likely(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_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_8 = 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_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1}; + __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_2)) __PYX_ERR(0, 1159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_v_newPoint = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_newPoint = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1161 + /* "collisions.py":1228 * 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 - * cLine = None + * thisIsOnP = oldLine.isCorner(cPoint, precision) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1161, __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, 1161, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __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, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atan2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1161, __pyx_L1_error) + __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, 1228, __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, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_oldLine, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1161, __pyx_L1_error) + __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, 1228, __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, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_oldLine, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1161, __pyx_L1_error) + __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, 1228, __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, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Subtract(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __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, 1228, __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, 1161, __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, 1228, __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, 1161, __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, 1228, __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, 1161, __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, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1228, __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_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1161, __pyx_L1_error) + __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; __pyx_t_8 = 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)) { + __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_3); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; @@ -39911,13 +41774,13 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_6, __pyx_t_15}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_15}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __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_4)) __PYX_ERR(0, 1161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; @@ -39935,54 +41798,44 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2}; + __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_v_thisNormal = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_thisNormal = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1162 + /* "collisions.py":1229 * * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) * paralell = False # <<<<<<<<<<<<<< - * cLine = None * thisIsOnP = oldLine.isCorner(cPoint, precision) + * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): */ __Pyx_INCREF(Py_False); __pyx_v_paralell = Py_False; - /* "collisions.py":1163 + /* "collisions.py":1230 * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) * paralell = False - * cLine = None # <<<<<<<<<<<<<< - * thisIsOnP = oldLine.isCorner(cPoint, precision) - * if checkShpType(closestObj, Line): - */ - __Pyx_INCREF(Py_None); - __pyx_v_cLine = Py_None; - - /* "collisions.py":1164 - * paralell = False - * cLine = None * thisIsOnP = oldLine.isCorner(cPoint, precision) # <<<<<<<<<<<<<< - * if checkShpType(closestObj, Line): - * cLine = closestObj + * 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, 1164, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; + __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { + __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_4); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; @@ -39990,35 +41843,38 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_cPoint, __pyx_v_precision}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + 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, 1230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_v_thisIsOnP = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_thisIsOnP = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1165 - * cLine = None + /* "collisions.py":1231 + * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) - * if checkShpType(closestObj, Line): # <<<<<<<<<<<<<< - * cLine = closestObj - * elif checkShpType(closestObj, ShpGroups.CLOSED): + * 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, 1165, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1231, __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, 1231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { + __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_5); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; @@ -40026,440 +41882,370 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_closestObj, __pyx_t_4}; - __pyx_t_2 = __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_closestObj, __pyx_t_5}; + __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, 1231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1231, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_9) { - /* "collisions.py":1166 + /* "collisions.py":1232 * thisIsOnP = oldLine.isCorner(cPoint, precision) - * if checkShpType(closestObj, Line): - * cLine = closestObj # <<<<<<<<<<<<<< - * elif checkShpType(closestObj, ShpGroups.CLOSED): - * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] + * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): + * paralell = not thisIsOnP # <<<<<<<<<<<<<< + * if not paralell: + * cLine = None */ - __Pyx_INCREF(__pyx_v_closestObj); - __Pyx_DECREF_SET(__pyx_v_cLine, __pyx_v_closestObj); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBool_FromLong((!__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":1165 - * cLine = None + /* "collisions.py":1231 + * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) - * if checkShpType(closestObj, Line): # <<<<<<<<<<<<<< - * cLine = closestObj - * elif checkShpType(closestObj, ShpGroups.CLOSED): + * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): # <<<<<<<<<<<<<< + * paralell = not thisIsOnP + * if not paralell: */ - goto __pyx_L22; } - /* "collisions.py":1167 - * if checkShpType(closestObj, Line): - * cLine = closestObj - * elif checkShpType(closestObj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< - * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] - * if colllidingLns != []: + /* "collisions.py":1233 + * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): + * paralell = not thisIsOnP + * if not paralell: # <<<<<<<<<<<<<< + * cLine = None + * if checkShpType(closestObj, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_8 = 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_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_closestObj, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_11) { + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_18 = (!__pyx_t_9); + if (__pyx_t_18) { - /* "collisions.py":1168 - * cLine = closestObj - * elif checkShpType(closestObj, ShpGroups.CLOSED): - * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] # <<<<<<<<<<<<<< - * if colllidingLns != []: - * cLine = colllidingLns[0] + /* "collisions.py":1234 + * paralell = not thisIsOnP + * if not paralell: + * cLine = None # <<<<<<<<<<<<<< + * if checkShpType(closestObj, ShpTyps.Line): + * cLine = closestObj */ - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_toLines); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1168, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_INCREF(Py_None); + __pyx_v_cLine = Py_None; + + /* "collisions.py":1235 + * 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, 1235, __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, 1235, __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, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_8 = 1; } - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); - __pyx_t_9 = 0; - __pyx_t_10 = NULL; - } else { - __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1168, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1168, __pyx_L25_error) + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_closestObj, __pyx_t_2}; + __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, 1235, __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, 1235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_18) { + + /* "collisions.py":1236 + * cLine = None + * if checkShpType(closestObj, ShpTyps.Line): + * cLine = closestObj # <<<<<<<<<<<<<< + * elif checkShpType(closestObj, ShpGroups.CLOSED): + * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] + */ + __Pyx_INCREF(__pyx_v_closestObj); + __Pyx_DECREF_SET(__pyx_v_cLine, __pyx_v_closestObj); + + /* "collisions.py":1235 + * if not paralell: + * cLine = None + * if checkShpType(closestObj, ShpTyps.Line): # <<<<<<<<<<<<<< + * cLine = closestObj + * elif checkShpType(closestObj, ShpGroups.CLOSED): + */ + goto __pyx_L24; + } + + /* "collisions.py":1237 + * 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, 1237, __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, 1237, __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, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_8 = 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_8 = 1; } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_closestObj, __pyx_t_5}; + __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, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_10)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - { - 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, 1168, __pyx_L25_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1168, __pyx_L25_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L25_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, 1168, __pyx_L25_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1168, __pyx_L25_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_10(__pyx_t_5); - 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, 1168, __pyx_L25_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_i, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr20__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1168, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Point); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1168, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_closestP); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1168, __pyx_L25_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L25_error) + } + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_18) { + + /* "collisions.py":1238 + * cLine = closestObj + * elif checkShpType(closestObj, ShpGroups.CLOSED): + * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] # <<<<<<<<<<<<<< + * if colllidingLns != []: + * cLine = colllidingLns[0] + */ + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_toLines); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (likely(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_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_4, function); + __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; - __pyx_t_1 = __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L25_error) + 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, 1238, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1168, __pyx_L25_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_11) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr20__pyx_v_i))) __PYX_ERR(0, 1168, __pyx_L25_error) + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); + __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, 1238, __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, 1238, __pyx_L27_error) } - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_i); __pyx_9genexpr20__pyx_v_i = 0; - goto __pyx_L30_exit_scope; - __pyx_L25_error:; - __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_i); __pyx_9genexpr20__pyx_v_i = 0; - goto __pyx_L1_error; - __pyx_L30_exit_scope:; - } /* exit inner scope */ - __pyx_v_colllidingLns = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "collisions.py":1169 - * 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, Circle) and (not thisIsOnP): - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_colllidingLns, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1169, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1169, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_11) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + { + 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, 1238, __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, 1238, __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, 1238, __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, 1238, __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, 1238, __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, 1238, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_11(__pyx_t_5); + 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, 1238, __pyx_L27_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __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, 1238, __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, 1238, __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, 1238, __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, 1238, __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; + __pyx_t_4 = NULL; + __pyx_t_8 = 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_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; + __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, 1238, __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, 1238, __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, 1238, __pyx_L27_error) + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_i); __pyx_9genexpr21__pyx_v_i = 0; + goto __pyx_L32_exit_scope; + __pyx_L27_error:; + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_i); __pyx_9genexpr21__pyx_v_i = 0; + goto __pyx_L1_error; + __pyx_L32_exit_scope:; + } /* exit inner scope */ + __pyx_v_colllidingLns = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":1170 - * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] - * if colllidingLns != []: - * cLine = colllidingLns[0] # <<<<<<<<<<<<<< - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): - * paralell = True + /* "collisions.py":1239 + * 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_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, 1170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_cLine, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __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, 1239, __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, 1239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_18) { - /* "collisions.py":1169 - * 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, Circle) and (not thisIsOnP): + /* "collisions.py":1240 + * 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, 1240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_cLine, __pyx_t_5); + __pyx_t_5 = 0; - /* "collisions.py":1167 - * if checkShpType(closestObj, Line): - * cLine = closestObj - * elif checkShpType(closestObj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< - * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] - * if colllidingLns != []: + /* "collisions.py":1239 + * 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): */ - goto __pyx_L22; - } + } - /* "collisions.py":1171 - * if colllidingLns != []: - * cLine = colllidingLns[0] - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< - * paralell = True - * if cLine is not None: + /* "collisions.py":1237 + * 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_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; - __pyx_t_8 = 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_8 = 1; + goto __pyx_L24; } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_closestObj, __pyx_t_1}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 2+__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_5)) __PYX_ERR(0, 1171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1171, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_18) { - } else { - __pyx_t_11 = __pyx_t_18; - goto __pyx_L32_bool_binop_done; - } - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1171, __pyx_L1_error) - __pyx_t_19 = (!__pyx_t_18); - __pyx_t_11 = __pyx_t_19; - __pyx_L32_bool_binop_done:; - if (__pyx_t_11) { - - /* "collisions.py":1172 - * cLine = colllidingLns[0] - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): - * paralell = True # <<<<<<<<<<<<<< - * if cLine is not None: - * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) - */ - __Pyx_INCREF(Py_True); - __Pyx_DECREF_SET(__pyx_v_paralell, Py_True); - - /* "collisions.py":1171 - * if colllidingLns != []: - * cLine = colllidingLns[0] - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< - * paralell = True - * if cLine is not None: - */ - } - __pyx_L22:; - - /* "collisions.py":1173 - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): - * 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])) - */ - __pyx_t_11 = (__pyx_v_cLine != Py_None); - if (__pyx_t_11) { - - /* "collisions.py":1174 - * 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, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __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, 1174, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __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_2)) __PYX_ERR(0, 1174, __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, 1174, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __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_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __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_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_sortedOtherLn = __pyx_t_2; - __pyx_t_2 = 0; - /* "collisions.py":1175 - * 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 + /* "collisions.py":1241 + * if colllidingLns != []: + * cLine = colllidingLns[0] + * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< + * paralell = True + * if cLine is not None: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_degrees); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __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, 1175, __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, 1175, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __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, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __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, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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, 1175, __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, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __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, 1175, __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, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyNumber_Subtract(__pyx_t_6, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = NULL; + __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_16)) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; @@ -40467,105 +42253,271 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_1, __pyx_t_15}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_closestObj, __pyx_t_2}; + __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, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __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_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); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; - } + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1241, __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, 1241, __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":1242 + * cLine = colllidingLns[0] + * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): + * paralell = True # <<<<<<<<<<<<<< + * if cLine is not None: + * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) + */ + __Pyx_INCREF(Py_True); + __Pyx_DECREF_SET(__pyx_v_paralell, Py_True); + + /* "collisions.py":1241 + * if colllidingLns != []: + * cLine = colllidingLns[0] + * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< + * paralell = True + * if cLine is not None: + */ } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __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, 1175, __pyx_L1_error) + __pyx_L24:; + + /* "collisions.py":1243 + * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): + * 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])) + */ + __pyx_t_18 = (__pyx_v_cLine != Py_None); + if (__pyx_t_18) { + + /* "collisions.py":1244 + * 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, 1244, __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, 1244, __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, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __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, 1244, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1244, __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, 1244, __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, 1244, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __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, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_v_otherLnNormal = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sortedOtherLn = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1245 + * 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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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, 1245, __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; + __pyx_t_16 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_16)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_2, __pyx_t_15}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __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, 1245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1}; + __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, 1245, __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":1176 - * 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":1246 + * 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, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __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 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) - if (!__pyx_t_11) { - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L35_bool_binop_done; + __pyx_t_5 = __Pyx_PyInt_RemainderObjC(__pyx_v_otherLnNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1246, __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, 1246, __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, 1246, __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, 1246, __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, 1246, __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, 1246, __pyx_L1_error) + if (!__pyx_t_18) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + __Pyx_INCREF(__pyx_t_6); + __pyx_t_3 = __pyx_t_6; + __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, 1246, __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, 1246, __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, 1246, __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, 1246, __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, 1246, __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, 1246, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_3 = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_L37_bool_binop_done:; + __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_3); + __pyx_t_3 = 0; + + /* "collisions.py":1243 + * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): + * 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])) + */ } - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_otherLnNormal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_RemainderObjC(__pyx_t_3, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1176, __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_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_2 = __pyx_t_5; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_L35_bool_binop_done:; - __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_2); - __pyx_t_2 = 0; - /* "collisions.py":1173 - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): - * 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])) + /* "collisions.py":1233 + * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): + * paralell = not thisIsOnP + * if not paralell: # <<<<<<<<<<<<<< + * cLine = None + * if checkShpType(closestObj, ShpTyps.Line): */ } - /* "collisions.py":1177 - * 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":1247 + * 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 * collTyp = 3 @@ -40573,17 +42525,17 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_180); __pyx_v_velDiff = __pyx_int_180; - /* "collisions.py":1178 - * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision + /* "collisions.py":1248 + * 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_11 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) + if (__pyx_t_18) { - /* "collisions.py":1179 + /* "collisions.py":1249 * velDiff = 180 * if paralell: # Line off line * collTyp = 3 # <<<<<<<<<<<<<< @@ -40593,7 +42545,7 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_3); __pyx_v_collTyp = __pyx_int_3; - /* "collisions.py":1181 + /* "collisions.py":1251 * 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 # <<<<<<<<<<<<<< @@ -40603,47 +42555,47 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_v_thisNormal); __pyx_v_normal = __pyx_v_thisNormal; - /* "collisions.py":1182 + /* "collisions.py":1252 * # 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, 1182, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_degrees); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __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, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __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, 1182, __pyx_L1_error) + __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, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1182, __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, 1252, __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, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __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_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error) + __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, 1252, __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, 1252, __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, 1182, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1182, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; + __pyx_t_1 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_4)) { + __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_4); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_8 = 1; @@ -40651,55 +42603,55 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_16, __pyx_t_6}; + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_16, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __pyx_t_15 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __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_2)) __PYX_ERR(0, 1182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_phi = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1252, __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":1178 - * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision + /* "collisions.py":1248 + * 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) */ - goto __pyx_L37; + goto __pyx_L39; } - /* "collisions.py":1184 + /* "collisions.py":1254 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 * else: * otherIsOnP = closestObj.isCorner(closestP, precision) # <<<<<<<<<<<<<< @@ -40707,52 +42659,52 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED * collTyp = 0 */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_closestP, __pyx_v_precision}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __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_3)) __PYX_ERR(0, 1184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_v_otherIsOnP = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_otherIsOnP = __pyx_t_6; + __pyx_t_6 = 0; - /* "collisions.py":1185 + /* "collisions.py":1255 * 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, 1185, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1255, __pyx_L1_error) if (__pyx_t_19) { } else { - __pyx_t_11 = __pyx_t_19; - goto __pyx_L39_bool_binop_done; + __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, 1185, __pyx_L1_error) - __pyx_t_11 = __pyx_t_19; - __pyx_L39_bool_binop_done:; - if (__pyx_t_11) { + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1255, __pyx_L1_error) + __pyx_t_18 = __pyx_t_19; + __pyx_L41_bool_binop_done:; + if (__pyx_t_18) { - /* "collisions.py":1186 + /* "collisions.py":1256 * otherIsOnP = closestObj.isCorner(closestP, precision) * if thisIsOnP and otherIsOnP: # Point off point collision * collTyp = 0 # <<<<<<<<<<<<<< @@ -40762,52 +42714,52 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_0); __pyx_v_collTyp = __pyx_int_0; - /* "collisions.py":1188 + /* "collisions.py":1258 * 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 # <<<<<<<<<<<<<< * elif thisIsOnP and (not otherIsOnP): # Point off line * collTyp = 1 */ + __pyx_t_6 = __pyx_int_0; + __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_int_0; __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = __pyx_int_0; - __Pyx_INCREF(__pyx_t_2); - __pyx_v_normal = __pyx_t_3; + __pyx_v_normal = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_v_phi = __pyx_t_3; __pyx_t_3 = 0; - __pyx_v_phi = __pyx_t_2; - __pyx_t_2 = 0; - /* "collisions.py":1185 + /* "collisions.py":1255 * 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) */ - goto __pyx_L38; + goto __pyx_L40; } - /* "collisions.py":1189 + /* "collisions.py":1259 * # 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, 1189, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) if (__pyx_t_19) { } else { - __pyx_t_11 = __pyx_t_19; - goto __pyx_L41_bool_binop_done; + __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, 1189, __pyx_L1_error) - __pyx_t_18 = (!__pyx_t_19); - __pyx_t_11 = __pyx_t_18; - __pyx_L41_bool_binop_done:; - if (__pyx_t_11) { + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1259, __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":1190 + /* "collisions.py":1260 * normal, phi = 0, 0 * elif thisIsOnP and (not otherIsOnP): # Point off line * collTyp = 1 # <<<<<<<<<<<<<< @@ -40817,108 +42769,108 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_1); __pyx_v_collTyp = __pyx_int_1; - /* "collisions.py":1192 + /* "collisions.py":1262 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_closestP, __pyx_v_vel}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __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_2)) __PYX_ERR(0, 1192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_normal = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1262, __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":1193 + /* "collisions.py":1263 * # 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_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __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, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_math); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1193, __pyx_L1_error) + __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, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_atan2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __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, 1193, __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, 1263, __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, 1193, __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, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __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, 1193, __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, 1263, __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, 1193, __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, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __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; __pyx_t_15 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_6); + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_t_4, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_t_1, __pyx_t_2}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = NULL; + __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { + __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_6); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; @@ -40926,50 +42878,50 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2}; - __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; + __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, 1263, __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_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1193, __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, 1263, __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_v_phi = __pyx_t_5; __pyx_t_5 = 0; - /* "collisions.py":1189 + /* "collisions.py":1259 * # 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 */ - goto __pyx_L38; + goto __pyx_L40; } - /* "collisions.py":1194 + /* "collisions.py":1264 * 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_18 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) - __pyx_t_19 = (!__pyx_t_18); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) + __pyx_t_19 = (!__pyx_t_9); if (__pyx_t_19) { } else { - __pyx_t_11 = __pyx_t_19; - goto __pyx_L43_bool_binop_done; + __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, 1194, __pyx_L1_error) - __pyx_t_11 = __pyx_t_19; - __pyx_L43_bool_binop_done:; - if (__pyx_t_11) { + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) + __pyx_t_18 = __pyx_t_19; + __pyx_L45_bool_binop_done:; + if (__pyx_t_18) { - /* "collisions.py":1195 + /* "collisions.py":1265 * 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 # <<<<<<<<<<<<<< @@ -40979,105 +42931,105 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_2); __pyx_v_collTyp = __pyx_int_2; - /* "collisions.py":1197 + /* "collisions.py":1267 * 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, 1197, __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, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_normal = __pyx_t_5; __pyx_t_5 = 0; - /* "collisions.py":1198 + /* "collisions.py":1268 * # 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_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atan2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = PyNumber_Subtract(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __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, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __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, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1198, __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, 1268, __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, 1268, __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, 1268, __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, 1268, __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, 1268, __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_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; + __pyx_t_4 = NULL; __pyx_t_8 = 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); + 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_1, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_15, __pyx_t_16}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_15, __pyx_t_16}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __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_3)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = NULL; + __pyx_t_2 = NULL; __pyx_t_8 = 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); + 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_2, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1198, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6}; + __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, 1268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_phi = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_phi = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1199 + /* "collisions.py":1269 * 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 # <<<<<<<<<<<<<< @@ -41087,17 +43039,17 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_velDiff, __pyx_int_0); - /* "collisions.py":1194 + /* "collisions.py":1264 * 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 */ - goto __pyx_L38; + goto __pyx_L40; } - /* "collisions.py":1204 + /* "collisions.py":1274 * # 'Cannot have a line reflecting off of another line when they aren\'t paralell; something bad must have occured!' * #) * collTyp = None # <<<<<<<<<<<<<< @@ -41108,127 +43060,226 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(Py_None); __pyx_v_collTyp = Py_None; - /* "collisions.py":1205 + /* "collisions.py":1275 * #) * collTyp = None * normal, phi = 0, 0 # <<<<<<<<<<<<<< * - * # the distance between the closest point on the other object and the corresponding point on the newLine + * if round(newPoint[0], precision) == round(closestP[0], precision) and round(newPoint[1], precision) == round(closestP[1], precision): */ - __pyx_t_2 = __pyx_int_0; - __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_int_0; + __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_int_0; __Pyx_INCREF(__pyx_t_5); - __pyx_v_normal = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_normal = __pyx_t_3; + __pyx_t_3 = 0; __pyx_v_phi = __pyx_t_5; __pyx_t_5 = 0; } - __pyx_L38:; + __pyx_L40:; } - __pyx_L37:; + __pyx_L39:; - /* "collisions.py":1208 + /* "collisions.py":1277 + * 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, 1277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __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, 1277, __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, 1277, __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, 1277, __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, 1277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __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, 1277, __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, 1277, __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, 1277, __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, 1277, __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, 1277, __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, 1277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __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, 1277, __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, 1277, __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, 1277, __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, 1277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1277, __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, 1277, __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, 1277, __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, 1277, __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, 1277, __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, 1277, __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":1278 + * + * 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, 1278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_5); + __pyx_t_5 = 0; + + /* "collisions.py":1277 + * 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 + * + */ + } + + /* "collisions.py":1281 * * # 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_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1208, __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, 1208, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __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, 1208, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_hypot); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __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, 1281, __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, 1281, __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, 1208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_16 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1281, __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_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, 1208, __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, 1208, __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, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1208, __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, 1281, __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, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; + __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_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_6))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_16, __pyx_t_15}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_16, __pyx_t_15}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __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, 1208, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1281, __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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __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, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_dist_left = __pyx_t_15; __pyx_t_15 = 0; - /* "collisions.py":1209 + /* "collisions.py":1282 * # 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, 1209, __pyx_L1_error) + __pyx_t_15 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_15, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_t_15, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_v_diff = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_diff = __pyx_t_6; + __pyx_t_6 = 0; - /* "collisions.py":1210 + /* "collisions.py":1283 * 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_3 = PyObject_RichCompare(__pyx_v_diff, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1210, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_11) { + __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, 1283, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_18) { - /* "collisions.py":1211 + /* "collisions.py":1284 * 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_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_6); + __pyx_t_6 = 0; - /* "collisions.py":1210 + /* "collisions.py":1283 * 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? # <<<<<<<<<<<<<< @@ -41237,37 +43288,37 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1212 + /* "collisions.py":1285 * 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, 1212, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotate); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1285, __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, 1212, __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, 1285, __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, 1212, __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, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_2 = PyNumber_Add(__pyx_t_16, __pyx_v_dist_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_t_16, __pyx_v_dist_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1285, __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, 1212, __pyx_L1_error) + __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1285, __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, 1212, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_2)) __PYX_ERR(0, 1212, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_5)) __PYX_ERR(0, 1285, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_3)) __PYX_ERR(0, 1285, __pyx_L1_error); __pyx_t_5 = 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, 1212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1212, __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, 1285, __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, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1285, __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; __pyx_t_5 = NULL; __pyx_t_8 = 0; @@ -41284,40 +43335,40 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_closestP, __pyx_t_16, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); + PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_closestP, __pyx_t_16, __pyx_t_2}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __pyx_v_pos = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_pos = __pyx_t_6; + __pyx_t_6 = 0; - /* "collisions.py":1213 + /* "collisions.py":1286 * 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, 1213, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_16 = PyNumber_Subtract(__pyx_v_velDiff, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1213, __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, 1286, __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, 1286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __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_8 = 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)) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15); + if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_8 = 1; @@ -41325,423 +43376,423 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_vel, __pyx_t_16}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_vel, __pyx_t_16}; + __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_3)) __PYX_ERR(0, 1213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1286, __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_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1213, __pyx_L1_error) + __pyx_t_15 = __Pyx_PySequence_ListKeepNew(__pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_15); __pyx_t_15 = 0; - /* "collisions.py":1214 + /* "collisions.py":1287 * 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, 1214, __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, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = PyNumber_Multiply(__pyx_t_15, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1214, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1287, __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, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 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, 1214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1214, __pyx_L1_error) + __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, 1287, __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, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1287, __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, 1214, __pyx_L1_error) + __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1287, __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, 1214, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(0, 1287, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_2)) __PYX_ERR(0, 1287, __pyx_L1_error); __pyx_t_16 = 0; - __pyx_t_1 = 0; + __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_15); __pyx_t_15 = 0; - /* "collisions.py":1215 + /* "collisions.py":1288 * 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, 1215, __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, 1288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_15, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1215, __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, 1288, __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, 1288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __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, 1215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __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, 1215, __pyx_L1_error) + __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, 1288, __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, 1288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1288, __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, 1215, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1288, __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, 1215, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_3)) __PYX_ERR(0, 1215, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(0, 1288, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_6)) __PYX_ERR(0, 1288, __pyx_L1_error); __pyx_t_16 = 0; - __pyx_t_3 = 0; + __pyx_t_6 = 0; __pyx_v_diff2Point = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; - /* "collisions.py":1216 + /* "collisions.py":1289 * 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, 1216, __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, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_15, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1216, __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, 1289, __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, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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, 1216, __pyx_L1_error) + __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, 1289, __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, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __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, 1216, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1289, __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, 1216, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(0, 1289, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error); __pyx_t_16 = 0; - __pyx_t_1 = 0; + __pyx_t_2 = 0; __pyx_v_odiff = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; - /* "collisions.py":1218 + /* "collisions.py":1291 * 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_1, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1218, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __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, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __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_3, 0, __pyx_int_0)) __PYX_ERR(0, 1218, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0)) __PYX_ERR(0, 1291, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_16)) __PYX_ERR(0, 1218, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_16)) __PYX_ERR(0, 1291, __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, 1218, __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, 1291, __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, 1218, __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, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_16, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_16, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __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; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_2}; - __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_3}; + __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __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; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1218, __pyx_L1_error) + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_smallness = __pyx_t_15; __pyx_t_15 = 0; - /* "collisions.py":1219 + /* "collisions.py":1292 * # 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, 1219, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 1292, __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, 1219, __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, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1292, __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, 1219, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 1292, __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, 1219, __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, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1292, __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, 1219, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2)) __PYX_ERR(0, 1219, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error); - __pyx_t_2 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3)) __PYX_ERR(0, 1292, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_6)) __PYX_ERR(0, 1292, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __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, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __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, 1219, __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 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error) + __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, 1292, __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, 1292, __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, 1219, __pyx_L1_error) + __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, 1292, __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, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error) + __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, 1292, __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, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1219, __pyx_L1_error) + __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, 1292, __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, 1292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __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, 1219, __pyx_L1_error); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1292, __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, 1292, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 1219, __pyx_L1_error); - __pyx_t_1 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 1292, __pyx_L1_error); + __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_v_newp1 = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; - __pyx_v_newp2 = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_newp2 = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; - /* "collisions.py":1220 + /* "collisions.py":1293 * 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, 1220, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - /* "collisions.py":1221 + /* "collisions.py":1294 * 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_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1221, __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, 1221, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1221, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __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, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Add(__pyx_t_16, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __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, 1294, __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, 1294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1221, __pyx_L1_error) + __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, 1294, __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, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __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_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __pyx_L1_error) + __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, 1294, __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, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __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_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __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, 1221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __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, 1294, __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, 1294, __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 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __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, 1294, __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, 1294, __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, 1294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_16)) __PYX_ERR(0, 1221, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6)) __PYX_ERR(0, 1221, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16)) __PYX_ERR(0, 1294, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1294, __pyx_L1_error); __pyx_t_16 = 0; - __pyx_t_6 = 0; + __pyx_t_4 = 0; - /* "collisions.py":1222 + /* "collisions.py":1295 * 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1222, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1295, __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, 1295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_t_16, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error) + __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, 1295, __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, 1295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1222, __pyx_L1_error) + __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, 1295, __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, 1295, __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_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, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __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, 1222, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __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, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1222, __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, 1295, __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, 1295, __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, 1295, __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_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, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __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, 1295, __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, 1295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_16)) __PYX_ERR(0, 1222, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_16)) __PYX_ERR(0, 1295, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error); __pyx_t_16 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = NULL; + __pyx_t_1 = 0; + __pyx_t_1 = NULL; __pyx_t_8 = 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); + 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_1, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_2, __pyx_t_6}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1221, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_3, __pyx_t_4}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __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, 1294, __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; } - /* "collisions.py":1223 + /* "collisions.py":1296 * 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_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_2); + 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_6, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_newp1, __pyx_v_newp2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + 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, 1296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = NULL; + __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_6)) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15); + if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_8 = 1; @@ -41749,61 +43800,61 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED } #endif { - PyObject *__pyx_callargs[8] = {__pyx_t_6, __pyx_t_5, __pyx_t_1, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision, __pyx_v_verbose}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_8, 7+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + PyObject *__pyx_callargs[8] = {__pyx_t_4, __pyx_t_5, __pyx_t_2, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision, __pyx_v_verbose}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_8, 7+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1293, __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_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_6); + __pyx_t_6 = 0; - /* "collisions.py":1224 + /* "collisions.py":1297 * (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_3 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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, 1224, __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, 1297, __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, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_v_out = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_out = __pyx_t_6; + __pyx_t_6 = 0; __pyx_v_outvel = __pyx_t_15; __pyx_t_15 = 0; - /* "collisions.py":1225 + /* "collisions.py":1298 * 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_11 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1225, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1298, __pyx_L1_error) + if (__pyx_t_18) { - /* "collisions.py":1226 + /* "collisions.py":1299 * 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, 1226, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_15) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __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, 1299, __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_3) < 0) __PYX_ERR(0, 1226, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_6) < 0) __PYX_ERR(0, 1299, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":1225 + /* "collisions.py":1298 * Line(newp1, newp2), objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< @@ -41812,17 +43863,17 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1227 + /* "collisions.py":1300 * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 * if verbose: # <<<<<<<<<<<<<< * return out, outvel, [collTyp, True] * return out, outvel */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1227, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1300, __pyx_L1_error) + if (__pyx_t_18) { - /* "collisions.py":1228 + /* "collisions.py":1301 * self.p1, self.p2 = out.p1, out.p2 * if verbose: * return out, outvel, [collTyp, True] # <<<<<<<<<<<<<< @@ -41830,30 +43881,30 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1301, __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_3, 0, __pyx_v_collTyp)) __PYX_ERR(0, 1228, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_collTyp)) __PYX_ERR(0, 1301, __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, 1228, __pyx_L1_error); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, Py_True)) __PYX_ERR(0, 1301, __pyx_L1_error); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1301, __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, 1228, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 1301, __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, 1228, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error); - __pyx_t_3 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 1301, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_6)) __PYX_ERR(0, 1301, __pyx_L1_error); + __pyx_t_6 = 0; __pyx_r = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L0; - /* "collisions.py":1227 + /* "collisions.py":1300 * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 * if verbose: # <<<<<<<<<<<<<< @@ -41862,7 +43913,7 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1229 + /* "collisions.py":1302 * if verbose: * return out, outvel, [collTyp, True] * return out, outvel # <<<<<<<<<<<<<< @@ -41870,19 +43921,19 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED * def handleCollisionsVel(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1302, __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, 1229, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 1302, __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, 1229, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 1302, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L0; - /* "collisions.py":1100 + /* "collisions.py":1167 * return [(phi-180)%360, phi % 360][tries.index(min(tries))] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -41916,8 +43967,8 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_v_newPoint); __Pyx_XDECREF(__pyx_v_thisNormal); __Pyx_XDECREF(__pyx_v_paralell); - __Pyx_XDECREF(__pyx_v_cLine); __Pyx_XDECREF(__pyx_v_thisIsOnP); + __Pyx_XDECREF(__pyx_v_cLine); __Pyx_XDECREF(__pyx_v_colllidingLns); __Pyx_XDECREF(__pyx_v_sortedOtherLn); __Pyx_XDECREF(__pyx_v_otherLnNormal); @@ -41936,8 +43987,8 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_v_newp2); __Pyx_XDECREF(__pyx_v_out); __Pyx_XDECREF(__pyx_v_outvel); - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_i); __Pyx_XDECREF(__pyx_v_oldLine); __Pyx_XDECREF(__pyx_v_newLine); __Pyx_XDECREF(__pyx_v_vel); @@ -41946,7 +43997,7 @@ static PyObject *__pyx_pf_10collisions_4Line_30handleCollisionsPos(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":1231 +/* "collisions.py":1304 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -41965,39 +44016,39 @@ static PyObject *__pyx_pf_10collisions_40__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":1236 + /* "collisions.py":1309 * 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, 1231, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __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, 1231, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 1304, __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, 1231, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1304, __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, 1231, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 1304, __pyx_L1_error); - /* "collisions.py":1231 + /* "collisions.py":1304 * 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, 1231, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __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, 1231, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1304, __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, 1231, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1304, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -42016,16 +44067,16 @@ static PyObject *__pyx_pf_10collisions_40__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_33handleCollisionsVel(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_35handleCollisionsVel(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_32handleCollisionsVel, "\n Handles movement of this line via velocity and it bouncing off of other objects.\n\n Args:\n vel (pointLike): The velocity of this line.\n objs (Shapes / Iterable[Shape]): The objects to bounce off of.\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 position 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_33handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_33handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_32handleCollisionsVel}; -static PyObject *__pyx_pw_10collisions_4Line_33handleCollisionsVel(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_34handleCollisionsVel, "\n Handles movement of this line via velocity and it bouncing off of other objects.\n\n Args:\n vel (pointLike): The velocity of this line.\n objs (Shapes / Iterable[Shape]): The objects to bounce off of.\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 position 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_35handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_35handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_34handleCollisionsVel}; +static PyObject *__pyx_pw_10collisions_4Line_35handleCollisionsVel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -42088,7 +44139,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1304, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -42096,9 +44147,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1304, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 1231, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 1304, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -42106,35 +44157,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1304, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 1231, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 1304, __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, 1231, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1304, __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, 1231, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1304, __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, 1231, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1304, __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, 1231, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 1304, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -42160,7 +44211,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, 1231, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 1304, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -42174,7 +44225,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_32handleCollisionsVel(__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_4Line_34handleCollisionsVel(__pyx_self, __pyx_v_self, __pyx_v_vel, __pyx_v_objs, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); /* function exit code */ { @@ -42187,7 +44238,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(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_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) { PyObject *__pyx_v_o = NULL; PyObject *__pyx_v_out = NULL; PyObject *__pyx_v_outvel = NULL; @@ -42209,75 +44260,75 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - /* "collisions.py":1255 + /* "collisions.py":1328 * 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, 1255, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __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, 1255, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1328, __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, 1255, __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, 1328, __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, 1255, __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, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1328, __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, 1255, __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, 1328, __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, 1255, __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, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1328, __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, 1255, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7)) __PYX_ERR(0, 1328, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 1255, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1328, __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, 1255, __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, 1328, __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, 1255, __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, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1328, __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, 1255, __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, 1328, __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, 1255, __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, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1328, __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, 1255, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1328, __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, 1255, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 1328, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 1255, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 1328, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -42300,7 +44351,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(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, 1255, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -42323,56 +44374,56 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(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, 1255, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __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":1256 + /* "collisions.py":1329 * """ * 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, 1256, __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, 1329, __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, 1256, __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, 1329, __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":1257 + /* "collisions.py":1330 * 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, 1257, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1330, __pyx_L1_error) if (__pyx_t_11) { - /* "collisions.py":1258 + /* "collisions.py":1331 * 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, 1258, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __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, 1258, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __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, 1258, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_2) < 0) __PYX_ERR(0, 1331, __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, 1258, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_1) < 0) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1257 + /* "collisions.py":1330 * 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: # <<<<<<<<<<<<<< @@ -42381,17 +44432,17 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(CYTHON_UNUSED */ } - /* "collisions.py":1259 + /* "collisions.py":1332 * 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, 1259, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1332, __pyx_L1_error) if (__pyx_t_11) { - /* "collisions.py":1260 + /* "collisions.py":1333 * self.p1, self.p2 = out.p1, out.p2 * if verbose: * return out, outvel, o[2] # <<<<<<<<<<<<<< @@ -42399,24 +44450,24 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(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, 1260, __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, 1333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1260, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __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, 1260, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 1333, __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, 1260, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 1333, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1259 + /* "collisions.py":1332 * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 * if verbose: # <<<<<<<<<<<<<< @@ -42425,7 +44476,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(CYTHON_UNUSED */ } - /* "collisions.py":1261 + /* "collisions.py":1334 * if verbose: * return out, outvel, o[2] * return out, outvel # <<<<<<<<<<<<<< @@ -42433,19 +44484,19 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(CYTHON_UNUSED * def copy(self) -> 'Line': */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1334, __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, 1261, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 1334, __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, 1261, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 1334, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1231 + /* "collisions.py":1304 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -42475,7 +44526,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":1263 +/* "collisions.py":1336 * return out, outvel * * def copy(self) -> 'Line': # <<<<<<<<<<<<<< @@ -42484,16 +44535,16 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsVel(CYTHON_UNUSED */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_35copy(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_37copy(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_34copy, "\n Make a copy of the Line with the same values!\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_35copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_35copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_34copy}; -static PyObject *__pyx_pw_10collisions_4Line_35copy(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_36copy, "\n Make a copy of the Line with the same values!\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_37copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_37copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_36copy}; +static PyObject *__pyx_pw_10collisions_4Line_37copy(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -42537,12 +44588,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1263, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1336, __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, 1263, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 1336, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -42553,7 +44604,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, 1263, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1336, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -42567,7 +44618,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_34copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_4Line_36copy(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -42580,7 +44631,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_34copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_4Line_36copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -42595,7 +44646,7 @@ static PyObject *__pyx_pf_10collisions_4Line_34copy(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":1267 + /* "collisions.py":1340 * Make a copy of the Line with the same values! * """ * return Line(self.p1, self.p2, self.bounciness) # <<<<<<<<<<<<<< @@ -42603,13 +44654,13 @@ static PyObject *__pyx_pf_10collisions_4Line_34copy(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, 1267, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1340, __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, 1267, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1340, __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, 1267, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __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, 1267, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -42632,7 +44683,7 @@ static PyObject *__pyx_pf_10collisions_4Line_34copy(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, 1267, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -42640,7 +44691,7 @@ static PyObject *__pyx_pf_10collisions_4Line_34copy(CYTHON_UNUSED PyObject *__py __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1263 + /* "collisions.py":1336 * return out, outvel * * def copy(self) -> 'Line': # <<<<<<<<<<<<<< @@ -42664,7 +44715,7 @@ static PyObject *__pyx_pf_10collisions_4Line_34copy(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "collisions.py":1269 +/* "collisions.py":1342 * return Line(self.p1, self.p2, self.bounciness) * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< @@ -42673,15 +44724,15 @@ static PyObject *__pyx_pf_10collisions_4Line_34copy(CYTHON_UNUSED PyObject *__py */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_37__getitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_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*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_37__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_37__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_37__getitem__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_39__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_39__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_39__getitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -42728,7 +44779,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1269, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1342, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -42736,14 +44787,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1269, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1342, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1269, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1342, __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, 1269, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1342, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -42756,7 +44807,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, 1269, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1342, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -42770,8 +44821,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, 1269, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_4Line_36__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, 1342, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_4Line_38__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); /* function exit code */ goto __pyx_L0; @@ -42788,7 +44839,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_36__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) { +static PyObject *__pyx_pf_10collisions_4Line_38__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; @@ -42799,19 +44850,19 @@ static PyObject *__pyx_pf_10collisions_4Line_36__getitem__(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":1270 + /* "collisions.py":1343 * * 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, 1270, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1270, __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, 1343, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1271 + /* "collisions.py":1344 * def __getitem__(self, item: int) -> pointLike: * if item == 0: * return self.p1 # <<<<<<<<<<<<<< @@ -42819,13 +44870,13 @@ static PyObject *__pyx_pf_10collisions_4Line_36__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, 1271, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1270 + /* "collisions.py":1343 * * def __getitem__(self, item: int) -> pointLike: * if item == 0: # <<<<<<<<<<<<<< @@ -42834,19 +44885,19 @@ static PyObject *__pyx_pf_10collisions_4Line_36__getitem__(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1272 + /* "collisions.py":1345 * 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, 1272, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1272, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1273 + /* "collisions.py":1346 * return self.p1 * elif item == 1: * return self.p2 # <<<<<<<<<<<<<< @@ -42854,13 +44905,13 @@ static PyObject *__pyx_pf_10collisions_4Line_36__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, 1273, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1272 + /* "collisions.py":1345 * if item == 0: * return self.p1 * elif item == 1: # <<<<<<<<<<<<<< @@ -42869,7 +44920,7 @@ static PyObject *__pyx_pf_10collisions_4Line_36__getitem__(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1275 + /* "collisions.py":1348 * return self.p2 * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -42878,35 +44929,35 @@ static PyObject *__pyx_pf_10collisions_4Line_36__getitem__(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "collisions.py":1276 + /* "collisions.py":1349 * 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, 1276, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1349, __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, 1276, __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, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1275 + /* "collisions.py":1348 * 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, 1275, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __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, 1275, __pyx_L1_error) + __PYX_ERR(0, 1348, __pyx_L1_error) } - /* "collisions.py":1269 + /* "collisions.py":1342 * return Line(self.p1, self.p2, self.bounciness) * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< @@ -42926,7 +44977,7 @@ static PyObject *__pyx_pf_10collisions_4Line_36__getitem__(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":1279 +/* "collisions.py":1352 * ) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -42935,15 +44986,15 @@ static PyObject *__pyx_pf_10collisions_4Line_36__getitem__(CYTHON_UNUSED PyObjec */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_39__setitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_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*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_39__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_39__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_39__setitem__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_41__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_41__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_41__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -42993,7 +45044,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1352, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -43001,9 +45052,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1352, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 1279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 1352, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -43011,14 +45062,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1352, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 1279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 1352, __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, 1279, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 1352, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -43033,7 +45084,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, 1279, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1352, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -43047,8 +45098,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, 1279, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_4Line_38__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, 1352, __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 */ goto __pyx_L0; @@ -43065,7 +45116,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_38__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new) { +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) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -43076,28 +45127,28 @@ static PyObject *__pyx_pf_10collisions_4Line_38__setitem__(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":1280 + /* "collisions.py":1353 * * 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, 1280, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1280, __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, 1353, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1281 + /* "collisions.py":1354 * 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, 1281, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_v_new) < 0) __PYX_ERR(0, 1354, __pyx_L1_error) - /* "collisions.py":1280 + /* "collisions.py":1353 * * def __setitem__(self, item: int, new: pointLike) -> None: * if item == 0: # <<<<<<<<<<<<<< @@ -43107,28 +45158,28 @@ static PyObject *__pyx_pf_10collisions_4Line_38__setitem__(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":1282 + /* "collisions.py":1355 * 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, 1282, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1282, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1283 + /* "collisions.py":1356 * 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, 1283, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_v_new) < 0) __PYX_ERR(0, 1356, __pyx_L1_error) - /* "collisions.py":1282 + /* "collisions.py":1355 * if item == 0: * self.p1 = new * elif item == 1: # <<<<<<<<<<<<<< @@ -43138,7 +45189,7 @@ static PyObject *__pyx_pf_10collisions_4Line_38__setitem__(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":1285 + /* "collisions.py":1358 * self.p2 = new * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -43147,36 +45198,36 @@ static PyObject *__pyx_pf_10collisions_4Line_38__setitem__(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "collisions.py":1286 + /* "collisions.py":1359 * 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, 1286, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __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, 1286, __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, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1285 + /* "collisions.py":1358 * 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, 1285, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __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, 1285, __pyx_L1_error) + __PYX_ERR(0, 1358, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":1279 + /* "collisions.py":1352 * ) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -43198,7 +45249,7 @@ static PyObject *__pyx_pf_10collisions_4Line_38__setitem__(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":1289 +/* "collisions.py":1362 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -43207,15 +45258,15 @@ static PyObject *__pyx_pf_10collisions_4Line_38__setitem__(CYTHON_UNUSED PyObjec */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_41__iter__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_43__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_4Line_41__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_41__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_41__iter__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_43__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_43__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_43__iter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -43259,12 +45310,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1289, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1362, __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, 1289, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 1362, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -43275,7 +45326,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, 1289, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1362, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -43289,7 +45340,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_40__iter__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_4Line_42__iter__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -43302,7 +45353,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_40__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_4Line_42__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -43313,7 +45364,7 @@ static PyObject *__pyx_pf_10collisions_4Line_40__iter__(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":1290 + /* "collisions.py":1363 * * def __iter__(self): * return iter((self.p1, self.p2)) # <<<<<<<<<<<<<< @@ -43321,26 +45372,26 @@ static PyObject *__pyx_pf_10collisions_4Line_40__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, 1290, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __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, 1290, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1363, __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, 1290, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1363, __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, 1290, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __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":1289 + /* "collisions.py":1362 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -43361,7 +45412,7 @@ static PyObject *__pyx_pf_10collisions_4Line_40__iter__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":1292 +/* "collisions.py":1365 * return iter((self.p1, self.p2)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -43370,15 +45421,15 @@ static PyObject *__pyx_pf_10collisions_4Line_40__iter__(CYTHON_UNUSED PyObject * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_43__str__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_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_4Line_43__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_43__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_43__str__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_45__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_45__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_45__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -43422,12 +45473,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1292, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1365, __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, 1292, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 1365, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -43438,7 +45489,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, 1292, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1365, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -43452,7 +45503,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_42__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_4Line_44__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -43465,7 +45516,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_42__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +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; @@ -43478,7 +45529,7 @@ static PyObject *__pyx_pf_10collisions_4Line_42__str__(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":1293 + /* "collisions.py":1366 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -43486,7 +45537,7 @@ static PyObject *__pyx_pf_10collisions_4Line_42__str__(CYTHON_UNUSED PyObject *_ * class Circle(Shape): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1293, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -43494,9 +45545,9 @@ static PyObject *__pyx_pf_10collisions_4Line_42__str__(CYTHON_UNUSED PyObject *_ __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, 1293, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1366, __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, 1293, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __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; @@ -43508,9 +45559,9 @@ static PyObject *__pyx_pf_10collisions_4Line_42__str__(CYTHON_UNUSED PyObject *_ __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, 1293, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __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, 1293, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1366, __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; @@ -43518,18 +45569,18 @@ static PyObject *__pyx_pf_10collisions_4Line_42__str__(CYTHON_UNUSED PyObject *_ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__16); + __Pyx_INCREF(__pyx_kp_u__5); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__16); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__16); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1293, __pyx_L1_error) + __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, 1366, __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":1292 + /* "collisions.py":1365 * return iter((self.p1, self.p2)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -43550,9 +45601,9 @@ static PyObject *__pyx_pf_10collisions_4Line_42__str__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":1300 - * `.toLines()` or `.toPoints()` it will return an empty list; so please check for it *before* closed shapes.""" - * GROUPS = [ShpGroups.CLOSED] +/* "collisions.py":1374 + * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} + * TYPE = ShpTyps.Circle * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: @@ -43568,20 +45619,20 @@ static PyObject *__pyx_pf_10collisions_42__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_defaults12, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __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, 1300, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __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, 1300, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1374, __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, 1300, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 1374, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -43666,7 +45717,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1374, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -43674,9 +45725,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1374, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); __PYX_ERR(0, 1300, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); __PYX_ERR(0, 1374, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -43684,9 +45735,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1374, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); __PYX_ERR(0, 1300, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); __PYX_ERR(0, 1374, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -43694,21 +45745,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1374, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); __PYX_ERR(0, 1300, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); __PYX_ERR(0, 1374, __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, 1300, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1374, __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, 1300, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 1374, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -43727,14 +45778,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 1300, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1374, __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, 1300, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1374, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -43774,7 +45825,7 @@ static PyObject *__pyx_pf_10collisions_6Circle___init__(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":1308 + /* "collisions.py":1382 * 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) # <<<<<<<<<<<<<< @@ -43782,23 +45833,23 @@ static PyObject *__pyx_pf_10collisions_6Circle___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, 1308, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 1382, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1382, __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, 1308, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1382, __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, 1308, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 1382, __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, 1308, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1382, __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, 1308, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1382, __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, 1308, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -43819,13 +45870,13 @@ static PyObject *__pyx_pf_10collisions_6Circle___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, 1308, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __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":1309 + /* "collisions.py":1383 * """ * super().__init__(bounciness) * self.x, self.y, self.r = x, y, r # <<<<<<<<<<<<<< @@ -43838,16 +45889,16 @@ static PyObject *__pyx_pf_10collisions_6Circle___init__(CYTHON_UNUSED PyObject * __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, 1309, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 1383, __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, 1309, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 1383, __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, 1309, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_t_2) < 0) __PYX_ERR(0, 1383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1300 - * `.toLines()` or `.toPoints()` it will return an empty list; so please check for it *before* closed shapes.""" - * GROUPS = [ShpGroups.CLOSED] + /* "collisions.py":1374 + * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} + * TYPE = ShpTyps.Circle * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: @@ -43869,7 +45920,7 @@ static PyObject *__pyx_pf_10collisions_6Circle___init__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":1311 +/* "collisions.py":1385 * self.x, self.y, self.r = x, y, r * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -43931,12 +45982,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1311, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1385, __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, 1311, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 1385, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -43947,7 +45998,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, 1311, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1385, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -43988,7 +46039,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":1318 + /* "collisions.py":1392 * 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 # <<<<<<<<<<<<<< @@ -43996,48 +46047,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, 1318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1392, __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, 1318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5)) __PYX_ERR(0, 1318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5)) __PYX_ERR(0, 1392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6)) __PYX_ERR(0, 1318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6)) __PYX_ERR(0, 1392, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; @@ -44046,7 +46097,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__p __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1311 + /* "collisions.py":1385 * self.x, self.y, self.r = x, y, r * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -44070,7 +46121,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":1320 +/* "collisions.py":1394 * return self.x - self.r, self.y - self.r, self.x + self.r, self.y + self.r * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -44132,12 +46183,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1320, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1394, __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, 1320, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 1394, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -44148,7 +46199,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, 1320, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1394, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -44186,25 +46237,25 @@ static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":1327 + /* "collisions.py":1401 * Number: The area of the circle. * """ * return math.pi * self.r**2 # <<<<<<<<<<<<<< * - * def _collides(self, othershape: Shape) -> bool: + * 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, 1327, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __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, 1327, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1401, __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, 1327, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __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, 1327, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1401, __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, 1327, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __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; @@ -44212,7 +46263,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__p __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1320 + /* "collisions.py":1394 * return self.x - self.r, self.y - self.r, self.x + self.r, self.y + self.r * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -44233,24 +46284,24 @@ static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":1329 +/* "collisions.py":1403 * return math.pi * self.r**2 * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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 */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_7_collides(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_7_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_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_7_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_7_collides(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -44269,7 +46320,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_collides (wrapper)", 0); + __Pyx_RefNannySetupContext("_contains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -44297,7 +46348,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1329, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1403, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -44305,14 +46356,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1329, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1403, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1329, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 1403, __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, 1329, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 1403, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -44325,7 +46376,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, 1329, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1403, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -44335,11 +46386,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Circle._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_6_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_6Circle_6_contains(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -44351,12 +46402,228 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_6_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; - PyObject *__pyx_v_iy = NULL; +/* "collisions.py":1414 + * 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: + */ + +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; + 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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1414, __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_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, 1414, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("collisions.Circle._contains.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_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); + 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; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + unsigned int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + 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; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1414, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p); + __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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; + __pyx_t_7 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; + __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, 1414, __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, 1414, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (!__pyx_t_10); + if (__pyx_t_11) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + 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_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #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; +} + +/* "collisions.py":1403 + * 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 + */ + +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; + PyObject *__pyx_v_ps = NULL; + PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -44365,34 +46632,47 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_collides(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; long __pyx_t_9; - long __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_collides", 1); + __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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1403, __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":1330 + /* "collisions.py":1404 * - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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, Line): + * if checkShpType(othershape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __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, 1330, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -44400,84 +46680,87 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_collides(CYTHON_UNUSED PyObject } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + 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_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) + __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, 1404, __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, 1330, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1331 - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): + /* "collisions.py":1405 + * 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, Line): - * if not self.check_rects(othershape): + * if checkShpType(othershape, ShpTyps.Line): + * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) */ __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, 1331, __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, 1405, __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, 1331, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1405, __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, 1331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1405, __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_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1405, __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_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __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, 1331, __pyx_L1_error) + __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, 1405, __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, 1331, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __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, 1405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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, 1331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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, 1405, __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, 1405, __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, 1331, __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, 1405, __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, 1331, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 1405, __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":1330 + /* "collisions.py":1404 * - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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, Line): + * if checkShpType(othershape, ShpTyps.Line): */ } - /* "collisions.py":1332 - * if checkShpType(othershape, Point): + /* "collisions.py":1406 + * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< - * if not self.check_rects(othershape): - * return False + * 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, 1332, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __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, 1332, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1406, __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, 1406, __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 @@ -44497,303 +46780,212 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_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, 1332, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __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, 1332, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1333 + /* "collisions.py":1407 * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 - * if checkShpType(othershape, Line): - * if not self.check_rects(othershape): # <<<<<<<<<<<<<< - * return False - * # Calculate the distance from point to the line segment + * 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 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; + __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, 1407, __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, 1407, __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, 1407, __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, 1407, __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, 1407, __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; + __pyx_t_8 = 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_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_2, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - 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, 1333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_8, __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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __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, 1333, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (!__pyx_t_6); - if (__pyx_t_7) { - - /* "collisions.py":1334 - * if checkShpType(othershape, Line): - * if not self.check_rects(othershape): - * 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 - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "collisions.py":1333 - * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 - * if checkShpType(othershape, Line): - * if not self.check_rects(othershape): # <<<<<<<<<<<<<< - * return False - * # Calculate the distance from point to the line segment - */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1407, __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_L5_bool_binop_done; } - - /* "collisions.py":1336 - * 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, 1336, __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, 1336, __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, 1336, __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, 1336, __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, 1336, __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, 1336, __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, 1407, __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, 1336, __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, 1336, __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, 1336, __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, 1336, __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, 1336, __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, 1336, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1407, __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, 1407, __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, 1407, __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, 1336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 1407, __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; - __pyx_v_line_mag = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1337 - * # 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, 1337, __pyx_L1_error) - if (__pyx_t_7) { - - /* "collisions.py":1338 - * 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 # <<<<<<<<<<<<<< - * - * 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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __pyx_L1_error) + __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_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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __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, 1338, __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, 1338, __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; + } + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L5_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":1337 - * # 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 - * + /* "collisions.py":1406 + * 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): */ - } + } - /* "collisions.py":1340 - * 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]) + /* "collisions.py":1408 + * 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1340, __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, 1340, __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, 1340, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __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, 1408, __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, 1408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_8}; + __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, 1408, __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, 1340, __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, 1340, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1408, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1409 + * 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): + * 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, 1409, __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, 1340, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __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, 1409, __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, 1340, __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, 1340, __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, 1340, __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, 1340, __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, 1340, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_8, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __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, 1409, __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, 1409, __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, 1340, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __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, 1340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __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, 1409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __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, 1340, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __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, 1340, __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, 1340, __pyx_L1_error) + __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, 1409, __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, 1340, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __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, 1340, __pyx_L1_error) + __pyx_t_8 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1409, __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, 1340, __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, 1340, __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, 1340, __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, 1340, __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":1341 - * - * 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]) - */ - __pyx_t_9 = 0; - __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, 1341, __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, 1341, __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, 1341, __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, 1341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - __pyx_t_4 = 0; - } else { - __Pyx_INCREF(__pyx_t_8); - __pyx_t_2 = __pyx_t_8; - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __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, 1341, __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, 1341, __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, 1341, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __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, 1409, __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, 1409, __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, 1341, __pyx_L1_error) + if (__pyx_t_6) { + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; @@ -44802,152 +46994,210 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_collides(CYTHON_UNUSED PyObject __pyx_t_2 = __pyx_t_8; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_u, __pyx_t_8); - __pyx_t_8 = 0; - - /* "collisions.py":1342 - * 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, 1342, __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, 1342, __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, 1342, __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, 1342, __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, 1342, __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, 1342, __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, 1342, __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, 1342, __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, 1342, __pyx_L1_error) + __pyx_t_8 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1409, __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, 1409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_ix = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":1343 - * 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, Circle): + /* "collisions.py":1408 + * 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_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1343, __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, 1343, __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, 1343, __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, 1343, __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, 1343, __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, 1343, __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, 1343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "collisions.py":1410 + * 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, 1410, __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, 1410, __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, 1410, __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_8))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, 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_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; - __pyx_t_3 = PyNumber_Multiply(__pyx_v_u, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __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, 1343, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1410, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1411 + * 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, 1411, __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; + __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, 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, 1411, __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":1344 - * 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, Circle): - * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 + /* "collisions.py":1412 + * if checkShpType(othershape, ShpTyps.Arc): + * 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_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1344, __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, 1344, __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, 1344, __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, 1344, __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, 1412, __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, 1344, __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, 1412, __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, 1344, __pyx_L1_error) + __pyx_t_1 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4}; + __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, 1412, __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, 1412, __pyx_L1_error) + if (__pyx_t_6) { + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else { + __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = __pyx_t_8; + __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, 1412, __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, 1344, __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, 1412, __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_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4}; + __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, 1412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = __pyx_t_8; __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, 1344, __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, 1344, __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, 1344, __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; + __pyx_L9_bool_binop_done:; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1332 - * if checkShpType(othershape, Point): - * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< - * if not self.check_rects(othershape): - * return False + /* "collisions.py":1410 + * 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]) */ } - /* "collisions.py":1345 - * 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, Circle): # <<<<<<<<<<<<<< - * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 - * return othershape._collides(self) + /* "collisions.py":1413 + * 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, 1345, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1413, __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, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = 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_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_2)) { + __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_2); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; @@ -44955,160 +47205,116 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_collides(CYTHON_UNUSED PyObject } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_4}; - __pyx_t_3 = __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; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; + __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_3)) __PYX_ERR(0, 1345, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __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, 1345, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_7) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1413, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { - /* "collisions.py":1346 - * return (self.x - ix) ** 2 + (self.y - iy) ** 2 <= self.r ** 2 - * if checkShpType(othershape, Circle): - * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 # <<<<<<<<<<<<<< - * return othershape._collides(self) + /* "collisions.py":1414 + * 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: */ __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, 1346, __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, 1346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1346, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1414, __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_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __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, 1346, __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_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1346, __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_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __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, 1346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1346, __pyx_L1_error) + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; + } + } + #endif + { + 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, 1414, __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, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L1_error) __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, 1414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1345 - * 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, Circle): # <<<<<<<<<<<<<< - * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 - * return othershape._collides(self) - */ - } - - /* "collisions.py":1347 - * if checkShpType(othershape, Circle): - * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 - * return othershape._collides(self) # <<<<<<<<<<<<<< + /* "collisions.py":1413 + * 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()) * - * 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, 1347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __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, 1347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - /* "collisions.py":1329 + /* "collisions.py":1403 * return math.pi * self.r**2 * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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 */ /* 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_7); __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("collisions.Circle._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle._contains", __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_XDECREF(__pyx_v_ps); + __Pyx_XDECREF(__pyx_gb_10collisions_6Circle_9_contains_2generator6); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1349 - * return othershape._collides(self) +/* "collisions.py":1416 + * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + * 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 */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_9_where(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_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_6Circle_9_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_9_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_9_where(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -45127,7 +47333,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_where (wrapper)", 0); + __Pyx_RefNannySetupContext("_collides (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -45155,7 +47361,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1349, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1416, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -45163,14 +47369,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1349, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1416, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1349, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1416, __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, 1349, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 1416, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -45183,111 +47389,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, 1349, __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", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_8_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_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1355 - * 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_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--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1355, __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, 1355, __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("sign", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1355, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1416, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -45297,11 +47399,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Circle._where.sign", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle._collides", __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_pf_10collisions_6Circle_8_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -45314,94 +47416,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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":1356 - * 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, 1356, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1356, __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":1355 - * 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":1349 - * return othershape._collides(self) - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, 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_8_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; +static PyObject *__pyx_pf_10collisions_6Circle_8_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; + PyObject *__pyx_v_iy = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -45410,33 +47429,37 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_where(CYTHON_UNUSED PyObject *_ 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_t_7; + PyObject *__pyx_t_8 = NULL; + long __pyx_t_9; + long __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_where", 1); + __Pyx_RefNannySetupContext("_collides", 1); - /* "collisions.py":1350 + /* "collisions.py":1417 * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, Line): + * 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, 1350, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1417, __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, 1350, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -45444,1834 +47467,847 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_where(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + 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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) + __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, 1417, __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, 1350, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1351 - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] # <<<<<<<<<<<<<< - * if checkShpType(othershape, Line): + /* "collisions.py":1418 + * 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): * 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, 1351, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __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, 1418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __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, 1351, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __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_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, 1351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __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, 1351, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1351, __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, 1351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __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, 1418, __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 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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, 1418, __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_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1351, __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, 1351, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1351, __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_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __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, 1418, __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, 1418, __pyx_L1_error) __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, 1351, __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, 1351, __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, 1351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1351, __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, 1351, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(0, 1351, __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, 1351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 1351, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_1 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - __pyx_t_3 = 0; - } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1350 + /* "collisions.py":1417 * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, Line): + * 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): */ } - /* "collisions.py":1352 - * if checkShpType(othershape, Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< + /* "collisions.py":1419 + * 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 [] + * return False */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __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_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1419, __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_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_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_3, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_7}; - __pyx_t_1 = __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __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, 1419, __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1419, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1353 - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, Line): + /* "collisions.py":1420 + * 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 [] - * def sign(x): + * return False + * # Calculate the distance from point to the line segment */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __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_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); + 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_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) + 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, 1420, __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = (!__pyx_t_6); - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { - /* "collisions.py":1354 - * if checkShpType(othershape, Line): + /* "collisions.py":1421 + * if checkShpType(othershape, ShpTyps.Line): * if not self.check_rects(othershape): - * return [] # <<<<<<<<<<<<<< - * def sign(x): - * return -1 if x < 0 else 1 + * 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 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __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":1353 - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, Line): + /* "collisions.py":1420 + * 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 [] - * def sign(x): + * return False + * # Calculate the distance from point to the line segment */ } - /* "collisions.py":1355 - * 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":1423 + * 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_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__17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sign = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1357 - * 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, 1357, __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, 1423, __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, 1423, __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, 1357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1423, __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, 1357, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1357, __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_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, 1423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_x1 = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1358 - * 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __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, 1358, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_y1 = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1359 - * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __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, 1359, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __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, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) + __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, 1423, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_x2 = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1360 - * 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, 1360, __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, 1360, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1423, __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_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_y2 = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_line_mag = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1361 - * 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) + /* "collisions.py":1424 + * # 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 = PyNumber_Subtract(__pyx_v_x2, __pyx_v_x1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_v_dx = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_t_7 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_line_mag, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1424, __pyx_L1_error) + if (__pyx_t_7) { - /* "collisions.py":1362 - * y2 = othershape.p2[1] - self.y - * dx = x2 - x1 - * dy = y2 - y1 # <<<<<<<<<<<<<< - * dr = math.sqrt(dx*dx + dy*dy) - * if dr == 0: - */ - __pyx_t_7 = PyNumber_Subtract(__pyx_v_y2, __pyx_v_y1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_v_dy = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1363 - * 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, 1363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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, 1363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1363, __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 = 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[2] = {__pyx_t_2, __pyx_t_4}; - __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; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_v_dr = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1364 - * 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, 1364, __pyx_L1_error) - if (__pyx_t_8) { - - /* "collisions.py":1365 - * 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":1425 + * 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 # <<<<<<<<<<<<<< + * + * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __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, 1425, __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, 1365, __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, 1425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __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_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __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_t_1 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2}; - __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L0; - - /* "collisions.py":1364 - * 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":1366 - * 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_7 = PyNumber_Multiply(__pyx_v_x1, __pyx_v_y2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_x2, __pyx_v_y1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_D = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":1367 - * return self.whereCollides(Point(*othershape.p1)) - * D = x1 * y2 - x2 * y1 - * discriminant = self.r*self.r*dr*dr - D*D # <<<<<<<<<<<<<< - * if discriminant < 0: - * return [] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __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, 1367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1367, __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_t_7, __pyx_v_dr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_v_dr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_v_D, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_discriminant = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":1368 - * D = x1 * y2 - x2 * y1 - * discriminant = self.r*self.r*dr*dr - D*D - * if discriminant < 0: # <<<<<<<<<<<<<< - * return [] - * if discriminant == 0: - */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_discriminant, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_8) { - - /* "collisions.py":1369 - * 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_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":1368 - * D = x1 * y2 - x2 * y1 - * discriminant = self.r*self.r*dr*dr - D*D - * if discriminant < 0: # <<<<<<<<<<<<<< - * return [] - * if discriminant == 0: - */ - } - - /* "collisions.py":1370 - * 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, 1370, __pyx_L1_error) - if (__pyx_t_8) { - - /* "collisions.py":1371 - * 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_2 = PyNumber_Multiply(__pyx_v_D, __pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error) + __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, 1425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_xa = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1372 - * 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_7 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_7, __pyx_v_dx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __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, 1372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error) + __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_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_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, 1425, __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_v_ya = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":1373 - * 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_Subtract(__pyx_v_xa, __pyx_v_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error) + __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, 1425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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, 1425, __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_PyNumber_Divide(__pyx_t_7, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_v_ya, __pyx_v_y1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_7, __pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __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_dr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1425, __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; - __pyx_v_ta = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1374 - * 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_7 = PyObject_RichCompare(__pyx_int_0, __pyx_v_ta, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error) - if (__Pyx_PyObject_IsTrue(__pyx_t_7)) { - __Pyx_DECREF(__pyx_t_7); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_ta, __pyx_v_dr, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error) - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1374, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_8) { - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyNumber_Add(__pyx_v_xa, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Add(__pyx_v_ya, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __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, 1374, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_3 = __pyx_t_1; - __pyx_t_1 = 0; - } else { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_t_1; - __pyx_t_1 = 0; - } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 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, 1425, __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":1370 - * if discriminant < 0: - * return [] - * if discriminant == 0: # <<<<<<<<<<<<<< - * xa = (D * dy ) / (dr * dr) - * ya = (-D * dx ) / (dr * dr) - */ - } - - /* "collisions.py":1376 - * return [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] - * - * discRoot = math.sqrt(discriminant) # <<<<<<<<<<<<<< + /* "collisions.py":1424 + * # 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 * - * 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, 1376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1376, __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_discriminant}; - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_v_discRoot = __pyx_t_3; - __pyx_t_3 = 0; - /* "collisions.py":1378 - * discRoot = math.sqrt(discriminant) + /* "collisions.py":1427 + * return (self.x - othershape.p1[0]) ** 2 + (self.y - othershape.p1[1]) ** 2 <= self.r ** 2 * - * 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 + * 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_3 = PyNumber_Multiply(__pyx_v_D, __pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __pyx_pf_10collisions_6Circle_6_where_sign(__pyx_v_sign, __pyx_v_dy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1378, __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, 1378, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __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, 1427, __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, 1427, __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, 1378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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, 1427, __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_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __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_t_7 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_xa = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1379 - * - * 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_3 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_v_dx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_discRoot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __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, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __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, 1379, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1379, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_ya = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1380 - * 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_7 = PyNumber_Subtract(__pyx_v_xa, __pyx_v_x1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1380, __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, 1380, __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, 1380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __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, 1380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1380, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1427, __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_PyNumber_Divide(__pyx_t_3, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_ta = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1381 - * 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, 1381, __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, 1381, __pyx_L1_error) - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1381, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1427, __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, 1427, __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, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __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, 1381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Add(__pyx_v_xa, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1381, __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, 1381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_v_ya, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __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, 1381, __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, 1381, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1381, __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, 1381, __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, 1381, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_2; - __pyx_t_2 = 0; - } else { - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_t_2; - __pyx_t_2 = 0; - } - __pyx_v_xpt = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "collisions.py":1383 - * 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_3 = PyNumber_Multiply(__pyx_v_D, __pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_pf_10collisions_6Circle_6_where_sign(__pyx_v_sign, __pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error) + __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, 1427, __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, 1383, __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, 1427, __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, 1383, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __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, 1383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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, 1383, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); __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, 1427, __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_v_xb = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __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, 1427, __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":1384 + /* "collisions.py":1428 * - * 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 [] + * 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]) */ - __pyx_t_3 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_dx); 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_PyNumber_Absolute(__pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error) + __pyx_t_9 = 0; + __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, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_discRoot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 1428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1428, __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, 1428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = __pyx_t_8; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_8 = __pyx_t_2; __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, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1428, __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, 1428, __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, 1428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_yb = __pyx_t_2; - __pyx_t_2 = 0; + if (__pyx_t_7) { + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = __pyx_t_8; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_u, __pyx_t_8); + __pyx_t_8 = 0; - /* "collisions.py":1385 - * 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 + /* "collisions.py":1429 + * 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_2 = PyNumber_Subtract(__pyx_v_xb, __pyx_v_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __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, 1385, __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, 1385, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1429, __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, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __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, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error) + __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, 1429, __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, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 1429, __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, 1429, __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, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1429, __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, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_tb = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_ix = __pyx_t_8; + __pyx_t_8 = 0; - /* "collisions.py":1386 - * 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, Circle): + /* "collisions.py":1430 + * 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_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_tb, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __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, 1386, __pyx_L1_error) - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1386, __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, 1386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_v_xb, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __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, 1386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Add(__pyx_v_yb, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1386, __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, 1386, __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, 1386, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7)) __PYX_ERR(0, 1386, __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, 1386, __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, 1386, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_7; - __pyx_t_7 = 0; - } else { - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __pyx_t_7; - __pyx_t_7 = 0; - } - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_xpt, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1430, __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, 1430, __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, 1430, __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, 1430, __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, 1430, __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, 1430, __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, 1430, __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_DECREF_SET(__pyx_v_xpt, ((PyObject*)__pyx_t_7)); - __pyx_t_7 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_v_u, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1430, __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, 1430, __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":1387 - * 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, Circle): - * if not self.check_rects(othershape): + /* "collisions.py":1431 + * 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): + * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_xpt); - __pyx_r = __pyx_v_xpt; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1431, __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, 1431, __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, 1431, __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, 1431, __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, 1431, __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, 1431, __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, 1431, __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, 1431, __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, 1431, __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, 1431, __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":1352 - * if checkShpType(othershape, Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< + /* "collisions.py":1419 + * 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 [] + * return False */ } - /* "collisions.py":1388 - * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] - * return xpt - * if checkShpType(othershape, Circle): # <<<<<<<<<<<<<< - * if not self.check_rects(othershape): - * return [] + /* "collisions.py":1432 + * 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_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1432, __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, 1432, __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, 1432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __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_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_8))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_1}; - __pyx_t_7 = __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1388, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_8) { - - /* "collisions.py":1389 - * return xpt - * if checkShpType(othershape, Circle): - * if not self.check_rects(othershape): # <<<<<<<<<<<<<< - * return [] - * # circle 1: (x0, y0), radius r0 - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1389, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_2}; + __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, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_othershape}; - __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, 1389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1389, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_6 = (!__pyx_t_8); - if (__pyx_t_6) { - - /* "collisions.py":1390 - * if checkShpType(othershape, 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_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L0; - - /* "collisions.py":1389 - * return xpt - * if checkShpType(othershape, Circle): - * if not self.check_rects(othershape): # <<<<<<<<<<<<<< - * return [] - * # circle 1: (x0, y0), radius r0 - */ - } + __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, 1432, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_7) { - /* "collisions.py":1394 - * # circle 2: (x1, y1), radius r1 - * - * d=math.hypot(othershape.x-self.x, othershape.y-self.y) # <<<<<<<<<<<<<< + /* "collisions.py":1433 + * 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) * - * # non intersecting */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_hypot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __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, 1394, __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, 1433, __pyx_L1_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, 1394, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1433, __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, 1433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __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, 1433, __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_othershape, __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, 1433, __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, 1394, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __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, 1394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __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 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(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[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_9}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __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; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_v_d = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1397 - * - * # non intersecting - * if d > self.r + othershape.r : # <<<<<<<<<<<<<< - * return [] - * # One circle within other - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_d, __pyx_t_9, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1397, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { + __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_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_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_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, 1433, __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, 1433, __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, 1433, __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, 1433, __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":1398 - * # non intersecting - * if d > self.r + othershape.r : - * return [] # <<<<<<<<<<<<<< - * # One circle within other - * if d < abs(self.r-othershape.r): + /* "collisions.py":1432 + * 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_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } - /* "collisions.py":1397 + /* "collisions.py":1434 + * 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) # <<<<<<<<<<<<<< * - * # non intersecting - * if d > self.r + othershape.r : # <<<<<<<<<<<<<< - * return [] - * # One circle within other + * 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, 1434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; } + } + #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, 1434, __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":1400 - * return [] - * # One circle within other - * if d < abs(self.r-othershape.r): # <<<<<<<<<<<<<< - * return [] - * # coincident circles + /* "collisions.py":1416 + * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyNumber_Absolute(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_v_d, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1400, __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, 1400, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_6) { - /* "collisions.py":1401 - * # 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_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_r = __pyx_t_7; - __pyx_t_7 = 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_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":1400 - * return [] - * # One circle within other - * if d < abs(self.r-othershape.r): # <<<<<<<<<<<<<< - * return [] - * # coincident circles +/* "collisions.py":1436 + * 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":1403 - * 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, 1403, __pyx_L1_error) - if (__pyx_t_8) { +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_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_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, +#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, 1436, __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, 1436, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1436, __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, 1436, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; } else { - __pyx_t_6 = __pyx_t_8; - goto __pyx_L14_bool_binop_done; + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1403, __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, 1403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1403, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __pyx_t_8; - __pyx_L14_bool_binop_done:; - if (__pyx_t_6) { - - /* "collisions.py":1404 - * # coincident circles - * if d == 0 and self.r == othershape.r: - * return [] # <<<<<<<<<<<<<< - * else: - * r2 = self.r**2 - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __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, 1436, __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", __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); - /* "collisions.py":1403 - * return [] - * # coincident circles - * if d == 0 and self.r == othershape.r: # <<<<<<<<<<<<<< - * return [] - * else: - */ + /* 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":1406 +/* "collisions.py":1442 + * if not self.check_rects(othershape): * return [] - * else: - * r2 = self.r**2 # <<<<<<<<<<<<<< - * a=(r2-othershape.r**2+d**2)/(2*d) - * h=math.sqrt(r2-a**2) - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_r2 = __pyx_t_9; - __pyx_t_9 = 0; - - /* "collisions.py":1407 - * 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, 1407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_v_r2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_v_d, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_v_d, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_a = __pyx_t_9; - __pyx_t_9 = 0; - - /* "collisions.py":1408 - * 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_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_v_a, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_v_r2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1408, __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_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_t_4}; - __pyx_t_9 = __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; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_v_h = __pyx_t_9; - __pyx_t_9 = 0; - - /* "collisions.py":1409 - * 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, 1409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __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 = PyNumber_Multiply(__pyx_v_a, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __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_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_x2 = __pyx_t_4; - __pyx_t_4 = 0; - - /* "collisions.py":1410 - * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1410, __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, 1410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_a, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_v_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_y2 = __pyx_t_9; - __pyx_t_9 = 0; - - /* "collisions.py":1411 - * 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, 1411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Multiply(__pyx_v_h, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_v_x2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_x3 = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1412 - * 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Multiply(__pyx_v_h, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_v_y2, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_y3 = __pyx_t_4; - __pyx_t_4 = 0; - - /* "collisions.py":1414 - * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1414, __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, 1414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_h, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_v_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_v_x2, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_x4 = __pyx_t_9; - __pyx_t_9 = 0; - - /* "collisions.py":1415 - * - * 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, 1415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Multiply(__pyx_v_h, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_v_y2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_y4 = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1417 - * y4=y2+h*(othershape.x-self.x)/d - * - * return [[x3, y3], [x4, y4]] # <<<<<<<<<<<<<< - * return othershape._where(self) - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_v_x3); - __Pyx_GIVEREF(__pyx_v_x3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_x3)) __PYX_ERR(0, 1417, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_y3); - __Pyx_GIVEREF(__pyx_v_y3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_y3)) __PYX_ERR(0, 1417, __pyx_L1_error); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_x4); - __Pyx_GIVEREF(__pyx_v_x4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_x4)) __PYX_ERR(0, 1417, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_y4); - __Pyx_GIVEREF(__pyx_v_y4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_y4)) __PYX_ERR(0, 1417, __pyx_L1_error); - __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_7)) __PYX_ERR(0, 1417, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_4 = 0; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L0; - } - - /* "collisions.py":1388 - * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] - * return xpt - * if checkShpType(othershape, Circle): # <<<<<<<<<<<<<< - * if not self.check_rects(othershape): - * return [] - */ - } - - /* "collisions.py":1418 - * - * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __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_self}; - __pyx_t_9 = __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_9)) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L0; - - /* "collisions.py":1349 - * return othershape._collides(self) - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, 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":1420 - * 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_11closestPointTo(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_10closestPointTo, "\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_11closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_11closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_10closestPointTo}; -static PyObject *__pyx_pw_10collisions_6Circle_11closestPointTo(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, 1420, __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, 1420, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1420, __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, 1420, __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, 1420, __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, 1420, __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_10closestPointTo(__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":1451 - * 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 + * def sign(x): # <<<<<<<<<<<<<< + * return -1 if x < 0 else 1 + * x1 = othershape.p1[0] - self.x */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_lambda13(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_14closestPointTo_lambda13 = {"lambda13", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_14closestPointTo_lambda13, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_lambda13(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_p = 0; + PyObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -47282,7 +48318,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda13 (wrapper)", 0); + __Pyx_RefNannySetupContext("sign (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -47292,7 +48328,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -47304,27 +48340,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_p)) != 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, 1451, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1442, __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, "lambda13") < 0)) __PYX_ERR(0, 1451, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sign") < 0)) __PYX_ERR(0, 1442, __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]; + __pyx_v_x = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda13", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1451, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sign", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1442, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -47334,11 +48370,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda13", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle._where.sign", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda13(__pyx_self, __pyx_v_p); + __pyx_r = __pyx_pf_10collisions_6Circle_6_where_sign(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -47351,76 +48387,52 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda13(PyObject *__pyx_self, PyObject *__pyx_v_p) { - struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *__pyx_outer_scope; +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; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda13", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; + __Pyx_RefNannySetupContext("sign", 1); + + /* "collisions.py":1443 + * 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); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __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, 1451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 1443, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1443, __pyx_L1_error) __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, 1451, __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; + 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":1442 + * 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_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda13", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle._where.sign", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -47428,193 +48440,41 @@ static PyObject *__pyx_lambda_funcdef_lambda13(PyObject *__pyx_self, PyObject *_ return __pyx_r; } -/* "collisions.py":1464 - * 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":1436 + * 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_14closestPointTo_1lambda14(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_1lambda14 = {"lambda14", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_14closestPointTo_1lambda14, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_1lambda14(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("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_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, 1464, __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, 1464, __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("lambda14", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1464, __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_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_lambda14(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_9_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("lambda14", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_9_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, 1464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1464, __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, 1464, __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, 1464, __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, 1464, __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, 1464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1464, __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, 1464, __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, 1464, __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, 1464, __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, 1464, __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.lambda14", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1420 - * 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_10closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { - struct __pyx_obj_10collisions___pyx_scope_struct_9_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_9genexpr21__pyx_v_p = NULL; +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; @@ -47624,49 +48484,35 @@ static PyObject *__pyx_pf_10collisions_6Circle_10closestPointTo(CYTHON_UNUSED Py unsigned int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; + int __pyx_t_8; 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_9_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_9_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1420, __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("_where", 1); - /* "collisions.py":1431 - * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape - * """ - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< - * x, y = othershape.x - self.x, othershape.y - self.y - * #if abs(x)**2 + abs(y)**2 < self.r**2: + /* "collisions.py":1437 + * + * 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, 1431, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __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, 1431, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -47674,979 +48520,1131 @@ static PyObject *__pyx_pf_10collisions_6Circle_10closestPointTo(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + 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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __pyx_L1_error) + __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, 1437, __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, 1431, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1437, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1432 - * """ - * if checkShpType(othershape, Point): - * x, y = othershape.x - self.x, othershape.y - self.y # <<<<<<<<<<<<<< - * #if abs(x)**2 + abs(y)**2 < self.r**2: - * # return othershape + /* "collisions.py":1438 + * 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1432, __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, 1432, __pyx_L1_error) + __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, 1438, __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, 1432, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __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, 1438, __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_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error) + __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, 1438, __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, 1438, __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, 1438, __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, 1438, __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, 1438, __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, 1432, __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, 1432, __pyx_L1_error) + __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, 1438, __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, 1438, __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, 1438, __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_x = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_y = __pyx_t_4; - __pyx_t_4 = 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, 1438, __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, 1438, __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, 1438, __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, 1438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1438, __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, 1438, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(0, 1438, __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, 1438, __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, 1438, __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, 1438, __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":1435 - * #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":1437 * + * 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_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __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, 1435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __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, 1435, __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, 1435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + } + + /* "collisions.py":1439 + * 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, 1439, __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, 1439, __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, 1439, __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, 1439, __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, 1439, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1440 + * 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, 1440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = 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(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_7); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_y, __pyx_v_x}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + 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_3)) __PYX_ERR(0, 1435, __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_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_t_1)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; - __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __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_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (!__pyx_t_6); + if (__pyx_t_8) { + + /* "collisions.py":1441 + * 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, 1441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":1440 + * 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_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) + + /* "collisions.py":1442 + * 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, 1442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sign = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1444 + * 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, 1444, __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, 1444, __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, 1444, __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, 1444, __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_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_x1 = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1445 + * 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, 1445, __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, 1445, __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, 1445, __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, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_phi = __pyx_t_4; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_y1 = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1436 - * # 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":1446 + * 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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1446, __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, 1446, __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, 1446, __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, 1446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1436, __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_v_x2 = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1447 + * 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, 1447, __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, 1447, __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_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_phi}; - __pyx_t_4 = __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_4)) __PYX_ERR(0, 1436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_v_angle = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __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, 1447, __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":1438 - * angle = math.radians(phi) - * - * qx = self.x - math.sin(angle) * self.r # <<<<<<<<<<<<<< - * qy = self.y + math.cos(angle) * self.r - * if returnAll: + /* "collisions.py":1448 + * 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, 1448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_dx = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1449 + * 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, 1449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_dy = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1450 + * dx = x2 - x1 + * dy = y2 - y1 + * dr = math.sqrt(dx*dx + dy*dy) # <<<<<<<<<<<<<< + * if dr == 0: + * return self.whereCollides(Point(*othershape.p1)) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __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, 1450, __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, 1438, __pyx_L1_error) + __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, 1450, __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, 1438, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1450, __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, 1450, __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_7); __pyx_t_7 = 0; + __pyx_t_7 = 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 (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_7, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_angle}; - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + 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, 1450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 1438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __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_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1438, __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_qx = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1439 - * - * 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, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __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_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_v_angle}; - __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, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __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, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __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_Add(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __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; - __pyx_v_qy = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_dr = __pyx_t_2; + __pyx_t_2 = 0; - /* "collisions.py":1440 - * 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":1451 + * 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1440, __pyx_L1_error) - if (__pyx_t_6) { + __pyx_t_8 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_dr, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1451, __pyx_L1_error) + if (__pyx_t_8) { - /* "collisions.py":1441 - * qy = self.y + math.cos(angle) * self.r - * if returnAll: - * return [[qx, qy]] # <<<<<<<<<<<<<< - * return qx, qy - * elif checkShpType(othershape, Line): + /* "collisions.py":1452 + * 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_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_qx); - __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_qx)) __PYX_ERR(0, 1441, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_qy); - __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_qy)) __PYX_ERR(0, 1441, __pyx_L1_error); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1441, __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, 1441, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "collisions.py":1440 - * 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":1442 - * if returnAll: - * return [[qx, qy]] - * return qx, qy # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Line): - * if self._collides(othershape): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_qx); - __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_qx)) __PYX_ERR(0, 1442, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_qy); - __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_qy)) __PYX_ERR(0, 1442, __pyx_L1_error); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "collisions.py":1431 - * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape - * """ - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< - * x, y = othershape.x - self.x, othershape.y - self.y - * #if abs(x)**2 + abs(y)**2 < self.r**2: - */ - } - - /* "collisions.py":1443 - * return [[qx, qy]] - * return qx, qy - * elif checkShpType(othershape, Line): # <<<<<<<<<<<<<< - * if self._collides(othershape): - * wheres = self._where(othershape) - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = NULL; - __pyx_t_5 = 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)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_othershape, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __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_4)) __PYX_ERR(0, 1443, __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, 1443, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - - /* "collisions.py":1444 - * return qx, qy - * elif checkShpType(othershape, Line): - * if self._collides(othershape): # <<<<<<<<<<<<<< - * wheres = self._where(othershape) - * if wheres != []: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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[2] = {__pyx_t_7, __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, 1444, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __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, 1444, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - - /* "collisions.py":1445 - * elif checkShpType(othershape, Line): - * if self._collides(othershape): - * wheres = self._where(othershape) # <<<<<<<<<<<<<< - * if wheres != []: - * if returnAll: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1452, __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, 1452, __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, 1452, __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_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); + 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_3, 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_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, 1445, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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, 1452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_v_wheres = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":1446 - * if self._collides(othershape): - * wheres = self._where(othershape) - * if wheres != []: # <<<<<<<<<<<<<< - * if returnAll: - * return wheres + /* "collisions.py":1451 + * 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_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1446, __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, 1446, __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, 1446, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { + } - /* "collisions.py":1447 - * wheres = self._where(othershape) - * if wheres != []: - * if returnAll: # <<<<<<<<<<<<<< - * return wheres - * return wheres[0] + /* "collisions.py":1453 + * 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1447, __pyx_L1_error) - if (__pyx_t_6) { + __pyx_t_2 = PyNumber_Multiply(__pyx_v_x1, __pyx_v_y2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __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, 1453, __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, 1453, __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":1448 - * if wheres != []: - * if returnAll: - * return wheres # <<<<<<<<<<<<<< - * return wheres[0] - * sort = sorted([othershape.p1, othershape.p2], + /* "collisions.py":1454 + * return self.whereCollides(Point(*othershape.p1)) + * D = x1 * y2 - x2 * y1 + * discriminant = self.r*self.r*dr*dr - D*D # <<<<<<<<<<<<<< + * if discriminant < 0: + * return [] */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_wheres); - __pyx_r = __pyx_v_wheres; - goto __pyx_L0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1454, __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, 1454, __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, 1454, __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, 1454, __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, 1454, __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, 1454, __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, 1454, __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":1447 - * wheres = self._where(othershape) - * if wheres != []: - * if returnAll: # <<<<<<<<<<<<<< - * return wheres - * return wheres[0] + /* "collisions.py":1455 + * D = x1 * y2 - x2 * y1 + * discriminant = self.r*self.r*dr*dr - D*D + * if discriminant < 0: # <<<<<<<<<<<<<< + * return [] + * 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, 1455, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { - /* "collisions.py":1449 - * 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":1456 + * 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_3 = __Pyx_GetItemInt(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; - /* "collisions.py":1446 - * if self._collides(othershape): - * wheres = self._where(othershape) - * if wheres != []: # <<<<<<<<<<<<<< - * if returnAll: - * return wheres + /* "collisions.py":1455 + * D = x1 * y2 - x2 * y1 + * discriminant = self.r*self.r*dr*dr - D*D + * if discriminant < 0: # <<<<<<<<<<<<<< + * return [] + * if discriminant == 0: */ - } + } - /* "collisions.py":1450 - * 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":1457 + * if discriminant < 0: + * return [] + * if discriminant == 0: # <<<<<<<<<<<<<< + * xa = (D * dy ) / (dr * dr) + * ya = (-D * dx ) / (dr * dr) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1450, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_discriminant, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1457, __pyx_L1_error) + if (__pyx_t_8) { + + /* "collisions.py":1458 + * 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, 1458, __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, 1450, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __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, 1450, __pyx_L1_error); - __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __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":1451 - * 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 + /* "collisions.py":1459 + * 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_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1451, __pyx_L1_error) + __pyx_t_2 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __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, 1459, __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, 1459, __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, 1459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_14closestPointTo_lambda13, 0, __pyx_n_s_Circle_closestPointTo_locals_lam, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 1451, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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":1450 - * 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":1460 + * 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_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyNumber_Subtract(__pyx_v_xa, __pyx_v_x1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __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, 1460, __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, 1460, __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, 1460, __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, 1460, __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, 1460, __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, 1460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_sort = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1452 - * 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, 1452, __pyx_L1_error) - if (__pyx_t_6) { - - /* "collisions.py":1453 - * 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; - - /* "collisions.py":1452 - * 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_ta = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1454 - * if returnAll: - * return sort - * return sort[0] # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) - * elif checkShpType(othershape, Circle): + /* "collisions.py":1461 + * 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_3 = __Pyx_GetItemInt(__pyx_v_sort, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __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, 1461, __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, 1461, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1461, __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, 1461, __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, 1461, __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, 1461, __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, 1461, __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, 1461, __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, 1461, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1461, __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, 1461, __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, 1461, __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, 1461, __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":1444 - * return qx, qy - * elif checkShpType(othershape, Line): - * if self._collides(othershape): # <<<<<<<<<<<<<< - * wheres = self._where(othershape) - * if wheres != []: + /* "collisions.py":1457 + * if discriminant < 0: + * return [] + * if discriminant == 0: # <<<<<<<<<<<<<< + * xa = (D * dy ) / (dr * dr) + * ya = (-D * dx ) / (dr * dr) */ } - /* "collisions.py":1455 - * return sort - * return sort[0] - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + /* "collisions.py":1463 + * 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_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, 1455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __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, 1463, __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, 1455, __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, 1455, __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, 1455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = 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_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); + 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_9, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #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, 1455, __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; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; - __pyx_t_1 = __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_1)) __PYX_ERR(0, 1455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + 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, 1463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error) + __pyx_v_discRoot = __pyx_t_4; + __pyx_t_4 = 0; + + /* "collisions.py":1465 + * 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, 1465, __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, 1465, __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, 1465, __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, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __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 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __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_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_5 = 1; - } + __pyx_t_2 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1465, __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, 1465, __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":1466 + * + * 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, 1466, __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, 1466, __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, 1466, __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, 1466, __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, 1466, __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, 1466, __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, 1466, __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; + + /* "collisions.py":1467 + * 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, 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 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_dr); 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_Subtract(__pyx_v_ya, __pyx_v_y1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __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, 1467, __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, 1467, __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, 1467, __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":1468 + * 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, 1468, __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, 1468, __pyx_L1_error) } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_1, __pyx_v_returnAll}; - __pyx_t_3 = __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; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1468, __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, 1468, __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, 1468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __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, 1468, __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, 1468, __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, 1468, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7)) __PYX_ERR(0, 1468, __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, 1468, __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, 1468, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __pyx_t_7; + __pyx_t_7 = 0; } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_v_xpt = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "collisions.py":1443 - * return [[qx, qy]] - * return qx, qy - * elif checkShpType(othershape, Line): # <<<<<<<<<<<<<< - * if self._collides(othershape): - * wheres = self._where(othershape) + /* "collisions.py":1470 + * 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, 1470, __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, 1470, __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, 1470, __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, 1470, __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, 1470, __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, 1470, __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, 1470, __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":1456 - * return sort[0] - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) - * elif checkShpType(othershape, Circle): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + /* "collisions.py":1471 + * + * 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_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 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)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_1}; - __pyx_t_3 = __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; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __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, 1471, __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, 1471, __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, 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_7, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __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_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1456, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { + __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, 1471, __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, 1471, __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":1457 - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) - * elif checkShpType(othershape, Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Arc): - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) + /* "collisions.py":1472 + * 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_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, 1457, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_v_xb, __pyx_v_x1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1457, __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, 1457, __pyx_L1_error) + __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 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_dr); 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_v_yb, __pyx_v_y1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __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, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1457, __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_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; - } + __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, 1472, __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, 1472, __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":1473 + * 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, 1473, __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, 1473, __pyx_L1_error) } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_4, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1473, __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, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __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_7))) { - __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_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_1, __pyx_v_returnAll}; - __pyx_t_3 = __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; + __pyx_t_7 = PyNumber_Add(__pyx_v_xb, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __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, 1473, __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, 1473, __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, 1473, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1473, __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, 1473, __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, 1473, __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, 1473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __pyx_t_2; + __pyx_t_2 = 0; } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_xpt, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1473, __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":1474 + * 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":1456 - * return sort[0] - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) - * elif checkShpType(othershape, Circle): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + /* "collisions.py":1439 + * 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 [] */ } - /* "collisions.py":1458 - * elif checkShpType(othershape, Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) - * else: + /* "collisions.py":1475 + * 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_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Arc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __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, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); 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 = 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)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_2); + 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_7, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_1}; - __pyx_t_3 = __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; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 1475, __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_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1458, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1475, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_8) { - /* "collisions.py":1459 - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) # <<<<<<<<<<<<<< - * else: - * ps = [] + /* "collisions.py":1476 + * return xpt + * if checkShpType(othershape, ShpTyps.Circle): + * if not self.check_rects(othershape): # <<<<<<<<<<<<<< + * return [] + * # circle 1: (x0, y0), radius r0 */ - __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, 1459, __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, 1459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1476, __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_8))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_4); + 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_8, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __pyx_L1_error) + 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, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 1459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __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 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_2, __pyx_v_returnAll}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_3)) __PYX_ERR(0, 1459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_t_6 = (!__pyx_t_8); + if (__pyx_t_6) { - /* "collisions.py":1458 - * elif checkShpType(othershape, Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) - * else: + /* "collisions.py":1477 + * 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, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":1461 - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) - * else: - * ps = [] # <<<<<<<<<<<<<< - * for ln in othershape.toLines(): - * ps.append(ln.closestPointTo(self)) + /* "collisions.py":1476 + * return xpt + * if checkShpType(othershape, ShpTyps.Circle): + * if not self.check_rects(othershape): # <<<<<<<<<<<<<< + * return [] + * # circle 1: (x0, y0), radius r0 */ - /*else*/ { - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_ps = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + } - /* "collisions.py":1462 - * 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":1481 + * # circle 2: (x1, y1), radius r1 + * + * d=math.hypot(othershape.x-self.x, othershape.y-self.y) # <<<<<<<<<<<<<< + * + * # non intersecting */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1462, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1481, __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, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = NULL; + __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, 1481, __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, 1481, __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, 1481, __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, 1481, __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, 1481, __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, 1481, __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_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_2)) { + 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_2); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; @@ -48654,86 +49652,229 @@ static PyObject *__pyx_pf_10collisions_6Circle_10closestPointTo(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __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, 1462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 1481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - 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_13 = 0; - __pyx_t_14 = NULL; - } else { - __pyx_t_13 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1462, __pyx_L1_error) + __pyx_v_d = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1484 + * + * # 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, 1484, __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, 1484, __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, 1484, __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, 1484, __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, 1484, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1485 + * # 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, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1462, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_7))) { - { - 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, 1462, __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_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1462, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_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, 1462, __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_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1462, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_14(__pyx_t_7); - 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, 1462, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; - /* "collisions.py":1463 - * 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: + /* "collisions.py":1484 + * + * # non intersecting + * if d > self.r + othershape.r : # <<<<<<<<<<<<<< + * return [] + * # One circle within other + */ + } + + /* "collisions.py":1487 + * 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, 1487, __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, 1487, __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, 1487, __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, 1487, __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, 1487, __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, 1487, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1488 + * # One circle within other + * if d < abs(self.r-othershape.r): + * return [] # <<<<<<<<<<<<<< + * # coincident circles + * if d == 0 and self.r == othershape.r: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1463, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = NULL; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "collisions.py":1487 + * return [] + * # One circle within other + * if d < abs(self.r-othershape.r): # <<<<<<<<<<<<<< + * return [] + * # coincident circles + */ + } + + /* "collisions.py":1490 + * 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, 1490, __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, 1490, __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, 1490, __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, 1490, __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, 1490, __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":1491 + * # 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, 1491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "collisions.py":1490 + * return [] + * # coincident circles + * if d == 0 and self.r == othershape.r: # <<<<<<<<<<<<<< + * return [] + * else: + */ + } + + /* "collisions.py":1493 + * 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, 1493, __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, 1493, __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":1494 + * 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, 1494, __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, 1494, __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, 1494, __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, 1494, __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, 1494, __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, 1494, __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, 1494, __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":1495 + * 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, 1495, __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, 1495, __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, 1495, __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, 1495, __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 (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_8)) { + 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_8); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; @@ -48741,198 +49882,273 @@ static PyObject *__pyx_pf_10collisions_6Circle_10closestPointTo(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_self}; - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 1495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_ps, __pyx_t_3); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1463, __pyx_L1_error) + __pyx_v_h = __pyx_t_9; + __pyx_t_9 = 0; + + /* "collisions.py":1496 + * 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, 1496, __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, 1496, __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, 1496, __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, 1496, __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, 1496, __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, 1496, __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, 1496, __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 - * 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":1497 + * 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_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __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, 1497, __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, 1497, __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, 1497, __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, 1497, __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, 1497, __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, 1497, __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; - /* "collisions.py":1464 - * 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":1498 + * 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 = __Pyx_PyObject_GetAttrStr(__pyx_v_ps, __pyx_n_s_sort); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_14closestPointTo_1lambda14, 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, 1464, __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, 1464, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __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; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); 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_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __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, 1498, __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, 1498, __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, 1498, __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, 1498, __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":1465 - * 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":1499 + * 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1465, __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, 1499, __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, 1499, __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, 1499, __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, 1499, __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, 1499, __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, 1499, __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":1466 - * 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":1501 + * 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, 1501, __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, 1501, __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, 1501, __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, 1501, __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, 1501, __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, 1501, __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":1502 + * + * 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, 1502, __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, 1502, __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, 1502, __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, 1502, __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, 1502, __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, 1502, __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":1504 + * y4=y2+h*(othershape.x-self.x)/d + * + * return [[x3, y3], [x4, y4]] # <<<<<<<<<<<<<< + * return othershape._where(self) * */ __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1466, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_3); - __pyx_t_13 = 0; - for (;;) { - { - 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, 1466, __pyx_L15_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_7); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1466, __pyx_L15_error) - #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1466, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_p, __pyx_t_7); - __pyx_t_7 = 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, 1466, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1466, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_9genexpr21__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1466, __pyx_L15_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, 1466, __pyx_L15_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_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9}; - __pyx_t_7 = __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1466, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1466, __pyx_L15_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_p); __pyx_9genexpr21__pyx_v_p = 0; - goto __pyx_L19_exit_scope; - __pyx_L15_error:; - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_p); __pyx_9genexpr21__pyx_v_p = 0; - goto __pyx_L1_error; - __pyx_L19_exit_scope:; - } /* exit inner scope */ - __pyx_r = __pyx_t_2; + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __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, 1504, __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, 1504, __pyx_L1_error); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __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, 1504, __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, 1504, __pyx_L1_error); + __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1504, __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, 1504, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 1504, __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":1465 - * 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":1475 + * 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":1467 - * if returnAll: - * return [self.closestPointTo(Point(*p)) for p in ps] - * return self.closestPointTo(Point(*ps[0])) # <<<<<<<<<<<<<< + /* "collisions.py":1505 * - * def handleCollisionsPos(self, + * 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_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1467, __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, 1467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __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, 1467, __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, 1467, __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_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1467, __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_5 = 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_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; - __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; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 1505, __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; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; } + #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, 1505, __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":1420 - * return othershape._where(self) + /* "collisions.py":1436 + * return othershape._collides(self) * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< - * """ - * Find the closest point ON this object TO another object. + * 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 */ @@ -48942,114 +50158,60 @@ static PyObject *__pyx_pf_10collisions_6Circle_10closestPointTo(CYTHON_UNUSED Py __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_9genexpr21__pyx_v_p); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1469 - * 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":1476 - * 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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __pyx_L1_error); - - /* "collisions.py":1469 - * 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, 1469, __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, 1469, __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, 1469, __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._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":1507 + * 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_13handleCollisionsPos(PyObject *__pyx_self, +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_12handleCollisionsPos, "\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_13handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_13handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_12handleCollisionsPos}; -static PyObject *__pyx_pw_10collisions_6Circle_13handleCollisionsPos(PyObject *__pyx_self, +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 @@ -49057,24 +50219,19 @@ 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; + 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[8] = {0,0,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("handleCollisionsPos (wrapper)", 0); + __Pyx_RefNannySetupContext("closestPointTo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -49084,25 +50241,11 @@ 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_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))); + 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 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); @@ -49119,101 +50262,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1469, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1507, __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)) { + 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, 1469, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1507, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 1469, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1507, __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, 1469, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 1469, __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, 1469, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __pyx_L3_error) + 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, 1507, __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, 1469, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 1507, __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); + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); 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); + 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_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]; + __pyx_v_othershape = values[1]; + __pyx_v_returnAll = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 1469, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1507, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -49223,11 +50312,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Circle.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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_12handleCollisionsPos(__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); + __pyx_r = __pyx_pf_10collisions_6Circle_12closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); /* function exit code */ { @@ -49240,24 +50329,205 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1525 - * return oldCir, [0, 0], [True] - * return oldCir, [0, 0] - * 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] +/* "collisions.py":1538 + * 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 + */ + +/* 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, 1538, __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, 1538, __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, 1538, __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); + + /* 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_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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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, 1538, __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; + + /* 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":1551 + * 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] */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos_lambda15(PyObject *__pyx_self, +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_19handleCollisionsPos_lambda15 = {"lambda15", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_19handleCollisionsPos_lambda15, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos_lambda15(PyObject *__pyx_self, +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 @@ -49301,12 +50571,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1525, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1551, __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, 1525, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda15") < 0)) __PYX_ERR(0, 1551, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -49317,7 +50587,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda15", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1525, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda15", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1551, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -49327,7 +50597,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Circle.handleCollisionsPos.lambda15", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda15", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -49345,8 +50615,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_lambda_funcdef_lambda15(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *__pyx_outer_scope; + 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; @@ -49357,51 +50627,39 @@ static PyObject *__pyx_lambda_funcdef_lambda15(PyObject *__pyx_self, PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda15", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *) __Pyx_CyFunction_GetClosure(__pyx_self); + __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, 1525, __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, 1551, __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, 1525, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1551, __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, 1551, __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, 1525, __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, 1525, __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, 1525, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1551, __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, 1525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 1551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __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, 1525, __pyx_L1_error) + __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, 1551, __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, 1525, __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, 1525, __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, 1525, __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, 1525, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1551, __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, 1551, __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, 1525, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __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_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __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, 1525, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __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_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __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_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; /* function exit code */ @@ -49410,7 +50668,7 @@ static PyObject *__pyx_lambda_funcdef_lambda15(PyObject *__pyx_self, PyObject *_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Circle.handleCollisionsPos.lambda15", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda15", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -49418,1478 +50676,2062 @@ static PyObject *__pyx_lambda_funcdef_lambda15(PyObject *__pyx_self, PyObject *_ return __pyx_r; } -/* "collisions.py":1469 - * return self.closestPointTo(Point(*ps[0])) +/* "collisions.py":1507 + * return othershape._where(self) * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldCir: 'Circle', - * newCir: 'Circle', + * 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_12handleCollisionsPos(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_10_handleCollisionsPos *__pyx_cur_scope; - PyObject *__pyx_v_velphi = NULL; - 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_ThisClosestP = NULL; +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_diff = NULL; - PyObject *__pyx_v_pos = NULL; - PyObject *__pyx_v_smallness = NULL; - PyObject *__pyx_v_out = NULL; - PyObject *__pyx_v_outvel = NULL; - PyObject *__pyx_9genexpr22__pyx_v_j = NULL; - PyObject *__pyx_9genexpr22__pyx_v_i = NULL; - CYTHON_UNUSED Py_ssize_t __pyx_9genexpr23__pyx_v__; + 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; - PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; + 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; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - 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; - 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_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("handleCollisionsPos", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *)__pyx_tp_new_10collisions___pyx_scope_struct_10_handleCollisionsPos(__pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos, __pyx_empty_tuple, NULL); + __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_10_handleCollisionsPos *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1469, __pyx_L1_error) + __PYX_ERR(0, 1507, __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_INCREF(__pyx_v_vel); + __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":1502 - * DidReflect (bool): Whether the line reflected off of something + /* "collisions.py":1518 + * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape * """ - * velphi = math.atan2(vel[1], vel[0]) # <<<<<<<<<<<<<< - * quart = math.pi/2 - * mvement = Shapes(oldCir, Polygon( + * 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_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1518, __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, 1502, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1518, __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, 1502, __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, 1502, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; + __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_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); + 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_3, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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, 1502, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __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_velphi = __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, 1518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "collisions.py":1503 + /* "collisions.py":1519 * """ - * 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)), + * 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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1503, __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, 1503, __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, 1503, __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; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1519, __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, 1519, __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, 1519, __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, 1519, __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, 1519, __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, 1519, __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":1504 - * 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)), + /* "collisions.py":1522 + * #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) + * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __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, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "collisions.py":1505 - * 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, 1505, __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, 1505, __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, 1505, __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, 1505, __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, 1505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_6 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __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, 1522, __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, 1522, __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, 1522, __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_2 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_5 = 1; + } } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; - __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, 1505, __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, 1505, __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, 1505, __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, 1505, __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, 1505, __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, 1505, __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, 1505, __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, 1505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_6 = 1; + #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, 1522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_9}; - __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, 1505, __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, 1505, __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, 1505, __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, 1505, __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, 1505, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(0, 1505, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_7 = 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, 1522, __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, 1522, __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, 1522, __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":1506 - * 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)) + /* "collisions.py":1523 + * # 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1506, __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, 1506, __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, 1506, __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, 1506, __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, 1506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = NULL; - __pyx_t_6 = 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_6 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __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, 1523, __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_12, __pyx_t_5}; - __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, 1506, __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, 1506, __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, 1506, __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, 1506, __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, 1506, __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, 1506, __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, 1506, __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, 1506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_13 = NULL; - __pyx_t_6 = 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_6 = 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, 1523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_5}; - __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, 1506, __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, 1506, __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, 1506, __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, 1506, __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, 1506, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8)) __PYX_ERR(0, 1506, __pyx_L1_error); - __pyx_t_10 = 0; - __pyx_t_8 = 0; + __pyx_v_angle = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1507 - * (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) + /* "collisions.py":1525 + * angle = math.radians(phi) + * + * qx = self.x - math.sin(angle) * self.r # <<<<<<<<<<<<<< + * qy = self.y + math.cos(angle) * self.r + * if returnAll: */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1507, __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, 1507, __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, 1507, __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, 1507, __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, 1507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_13 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_13); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 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, 1525, __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, 1525, __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, 1525, __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_13, __pyx_t_7}; - __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, 1507, __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, 1507, __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, 1507, __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, 1507, __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, 1507, __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, 1507, __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, 1507, __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, 1507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_13))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_13, function); - __pyx_t_6 = 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, 1525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_7}; - __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_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1525, __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, 1525, __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; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1507, __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, 1507, __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, 1507, __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, 1507, __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, 1507, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10)) __PYX_ERR(0, 1507, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_10 = 0; + __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1525, __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":1508 - * (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) - * if not mvement.collides(objs): + /* "collisions.py":1526 + * + * qx = self.x - math.sin(angle) * self.r + * qy = self.y + math.cos(angle) * self.r # <<<<<<<<<<<<<< + * if returnAll: + * return [[qx, qy]] */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1508, __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, 1508, __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, 1508, __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, 1508, __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, 1508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_6 = 1; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1526, __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, 1526, __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, 1526, __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_14, __pyx_t_8}; - __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, 1508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + #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, 1526, __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, 1526, __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, 1526, __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, 1526, __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":1527 + * 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, 1527, __pyx_L1_error) + if (__pyx_t_6) { + + /* "collisions.py":1528 + * 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, 1528, __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, 1528, __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, 1528, __pyx_L1_error); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1528, __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, 1528, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":1527 + * 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":1529 + * 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, 1529, __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, 1529, __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, 1529, __pyx_L1_error); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":1518 + * 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_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1508, __pyx_L1_error) + + /* "collisions.py":1530 + * return [[qx, qy]] + * return qx, qy + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * if self._collides(othershape): + * wheres = self._where(othershape) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __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, 1530, __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, 1508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1530, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __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, 1508, __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, 1508, __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, 1508, __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, 1508, __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, 1508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_15 = NULL; - __pyx_t_6 = 0; + __pyx_t_7 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_14))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); - if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); - __Pyx_INCREF(__pyx_t_15); + 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_14, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_8}; - __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, 1508, __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, 1508, __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, 1508, __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, 1508, __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, 1508, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_9)) __PYX_ERR(0, 1508, __pyx_L1_error); - __pyx_t_5 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = NULL; - __pyx_t_6 = 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_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __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, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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, 1530, __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, 1530, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { - /* "collisions.py":1509 - * (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) # <<<<<<<<<<<<<< - * if not mvement.collides(objs): - * if verbose: + /* "collisions.py":1531 + * return qx, qy + * elif checkShpType(othershape, ShpTyps.Line): + * if self._collides(othershape): # <<<<<<<<<<<<<< + * wheres = self._where(othershape) + * if wheres != []: */ - __pyx_t_2 = NULL; - __pyx_t_6 = 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_6 = 1; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1531, __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[4] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_oldCir, __pyx_t_4, __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, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_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, 1531, __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, 1531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_v_mvement = __pyx_t_1; - __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "collisions.py":1510 - * (newCir.x + newCir.r * math.cos(velphi+quart), newCir.y + newCir.r * math.sin(velphi+quart)) - * ), newCir) - * if not mvement.collides(objs): # <<<<<<<<<<<<<< - * if verbose: - * return newCir, vel, [False] + /* "collisions.py":1532 + * elif checkShpType(othershape, ShpTyps.Line): + * if self._collides(othershape): + * wheres = self._where(othershape) # <<<<<<<<<<<<<< + * if wheres != []: + * if returnAll: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1510, __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, 1510, __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, 1510, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_17 = (!__pyx_t_16); - if (__pyx_t_17) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1532, __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, 1532, __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":1511 - * ), newCir) - * if not mvement.collides(objs): - * if verbose: # <<<<<<<<<<<<<< - * return newCir, vel, [False] - * return newCir, vel + /* "collisions.py":1533 + * if self._collides(othershape): + * wheres = self._where(othershape) + * if wheres != []: # <<<<<<<<<<<<<< + * if returnAll: + * return wheres */ - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1511, __pyx_L1_error) - if (__pyx_t_17) { + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1533, __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, 1533, __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, 1533, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { - /* "collisions.py":1512 - * if not mvement.collides(objs): - * if verbose: - * return newCir, vel, [False] # <<<<<<<<<<<<<< - * return newCir, vel - * points = [] + /* "collisions.py":1534 + * wheres = self._where(othershape) + * if wheres != []: + * if returnAll: # <<<<<<<<<<<<<< + * return wheres + * return wheres[0] */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1534, __pyx_L1_error) + if (__pyx_t_6) { + + /* "collisions.py":1535 + * 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":1534 + * wheres = self._where(othershape) + * if wheres != []: + * if returnAll: # <<<<<<<<<<<<<< + * return wheres + * return wheres[0] + */ + } + + /* "collisions.py":1536 + * 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, 1536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1533 + * if self._collides(othershape): + * wheres = self._where(othershape) + * if wheres != []: # <<<<<<<<<<<<<< + * if returnAll: + * return wheres + */ + } + + /* "collisions.py":1537 + * 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, 1537, __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, 1537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __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, 1512, __pyx_L1_error); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1512, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 1537, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 1537, __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, 1537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_newCir); - __Pyx_GIVEREF(__pyx_v_newCir); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newCir)) __PYX_ERR(0, 1512, __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, 1512, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_r = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; - /* "collisions.py":1511 - * ), newCir) - * if not mvement.collides(objs): - * if verbose: # <<<<<<<<<<<<<< - * return newCir, vel, [False] - * return newCir, vel + /* "collisions.py":1538 + * 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, 1538, __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, 1538, __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, 1538, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1513 - * if verbose: - * return newCir, vel, [False] - * return newCir, vel # <<<<<<<<<<<<<< - * points = [] - * for o in objs: + /* "collisions.py":1537 + * 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_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_newCir); - __Pyx_GIVEREF(__pyx_v_newCir); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newCir)) __PYX_ERR(0, 1513, __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, 1513, __pyx_L1_error); - __pyx_r = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1537, __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":1510 - * (newCir.x + newCir.r * math.cos(velphi+quart), newCir.y + newCir.r * math.sin(velphi+quart)) - * ), newCir) - * if not mvement.collides(objs): # <<<<<<<<<<<<<< - * if verbose: - * return newCir, vel, [False] + /* "collisions.py":1539 + * 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, 1539, __pyx_L1_error) + if (__pyx_t_6) { - /* "collisions.py":1514 - * return newCir, vel, [False] - * return newCir, vel - * points = [] # <<<<<<<<<<<<<< - * for o in objs: - * cs = o.whereCollides(mvement) + /* "collisions.py":1540 + * 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_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_points = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_sort); + __pyx_r = __pyx_v_sort; + goto __pyx_L0; - /* "collisions.py":1515 - * return newCir, vel - * points = [] - * for o in objs: # <<<<<<<<<<<<<< - * cs = o.whereCollides(mvement) - * if cs != []: + /* "collisions.py":1539 + * 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] */ - 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_18 = 0; - __pyx_t_19 = NULL; - } else { - __pyx_t_18 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_19 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1515, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_19)) { - 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, 1515, __pyx_L1_error) - #endif - if (__pyx_t_18 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_18); __Pyx_INCREF(__pyx_t_1); __pyx_t_18++; if (unlikely((0 < 0))) __PYX_ERR(0, 1515, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __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, 1515, __pyx_L1_error) - #endif - if (__pyx_t_18 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_18); __Pyx_INCREF(__pyx_t_1); __pyx_t_18++; if (unlikely((0 < 0))) __PYX_ERR(0, 1515, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif } - } else { - __pyx_t_1 = __pyx_t_19(__pyx_t_3); - 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, 1515, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); + + /* "collisions.py":1541 + * 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, 1541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1531 + * return qx, qy + * elif checkShpType(othershape, ShpTyps.Line): + * if self._collides(othershape): # <<<<<<<<<<<<<< + * wheres = self._where(othershape) + * if wheres != []: + */ } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_1); - __pyx_t_1 = 0; - /* "collisions.py":1516 - * 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)]) + /* "collisions.py":1542 + * 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_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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, 1542, __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, 1542, __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, 1542, __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, 1542, __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, 1542, __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, 1542, __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; + } + } + #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, 1542, __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; + } + } + #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, 1542, __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, 1542, __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, 1542, __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_6 = 0; + __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(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_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_mvement}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + 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; - 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_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_XDECREF_SET(__pyx_v_cs, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "collisions.py":1517 - * 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)]) - * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) + /* "collisions.py":1530 + * return [[qx, qy]] + * return qx, qy + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * if self._collides(othershape): + * wheres = self._where(othershape) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_cs, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1517, __pyx_L1_error) + } + + /* "collisions.py":1543 + * 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_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __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, 1543, __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, 1543, __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))) { + __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[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, 1543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1517, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_17) { + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1543, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { - /* "collisions.py":1518 - * 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))]))) - * # Don't let you move when you're in a wall + /* "collisions.py":1544 + * 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cs, __pyx_n_s_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __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, 1518, __pyx_L10_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, 1518, __pyx_L10_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, 1518, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1518, __pyx_L10_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, 1518, __pyx_L10_error); - __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13)) __PYX_ERR(0, 1518, __pyx_L10_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_DECREF(__pyx_t_12); __pyx_t_12 = 0; - for (;;) { - if (__pyx_t_20 >= 2) break; + __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_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1544, __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, 1544, __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, 1544, __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, 1544, __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; + } + } + #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, 1544, __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":1543 + * 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): + */ + } + + /* "collisions.py":1545 + * 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, 1545, __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, 1545, __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, 1545, __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, 1545, __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, 1545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1546 + * 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_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_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1546, __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, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1546, __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, 1546, __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, 1546, __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":1545 + * 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":1548 + * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) + * else: + * ps = [] # <<<<<<<<<<<<<< + * for ln in othershape.toLines(): + * ps.append(ln.closestPointTo(self)) + */ + /*else*/ { + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_ps = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "collisions.py":1549 + * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __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, 1549, __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, 1549, __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, 1549, __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, 1549, __pyx_L1_error) + #endif + if (__pyx_t_13 >= __pyx_temp) 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, 1518, __pyx_L10_error) + __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, 1549, __pyx_L1_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, 1518, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_12); - #endif - __Pyx_XDECREF_SET(__pyx_9genexpr22__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, 1518, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_14))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_14); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_14, function); - __pyx_t_6 = 1; - } - } + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif + } else { { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_9genexpr22__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, 1518, __pyx_L10_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; - } else { - __pyx_t_21 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1518, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_22 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1518, __pyx_L10_error) - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - for (;;) { - if (likely(!__pyx_t_22)) { - 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, 1518, __pyx_L10_error) - #endif - if (__pyx_t_21 >= __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, 1518, __pyx_L10_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, 1518, __pyx_L10_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, 1518, __pyx_L10_error) - #endif - if (__pyx_t_21 >= __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, 1518, __pyx_L10_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, 1518, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_12); - #endif - } - } else { - __pyx_t_12 = __pyx_t_22(__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, 1518, __pyx_L10_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_12); - } - __Pyx_XDECREF_SET(__pyx_9genexpr22__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, 1518, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_9genexpr22__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1518, __pyx_L10_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, 1518, __pyx_L10_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, 1518, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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; - } - } + 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, 1549, __pyx_L1_error) #endif - { - 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, 1518, __pyx_L10_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, 1518, __pyx_L10_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__pyx_t_17) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr22__pyx_v_i))) __PYX_ERR(0, 1518, __pyx_L10_error) - } + if (__pyx_t_13 >= __pyx_temp) break; } - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + #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, 1549, __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, 1549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif } - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_i); __pyx_9genexpr22__pyx_v_i = 0; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_j); __pyx_9genexpr22__pyx_v_j = 0; - goto __pyx_L18_exit_scope; - __pyx_L10_error:; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_i); __pyx_9genexpr22__pyx_v_i = 0; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_j); __pyx_9genexpr22__pyx_v_j = 0; - goto __pyx_L1_error; - __pyx_L18_exit_scope:; - } /* exit inner scope */ - __pyx_t_13 = NULL; - __pyx_t_6 = 0; + } 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, 1549, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_4); + __pyx_t_4 = 0; + + /* "collisions.py":1550 + * 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, 1550, __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_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); + 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_1, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_2}; - __pyx_t_4 = __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_4)) __PYX_ERR(0, 1518, __pyx_L1_error) + 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, 1550, __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_15 = __Pyx_PyList_Append(__pyx_v_ps, __pyx_t_4); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1519 - * 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))]))) # <<<<<<<<<<<<<< - * # Don't let you move when you're in a wall - * if points == []: + /* "collisions.py":1549 + * 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) */ - { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_20 = PyObject_Length(__pyx_v_cs); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1519, __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_9genexpr23__pyx_v__ = __pyx_t_23; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_o))) __PYX_ERR(0, 1519, __pyx_L1_error) - } - } /* exit inner scope */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1519, __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_1, 0, __pyx_v_cs)) __PYX_ERR(0, 1519, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1519, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_24 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 1519, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1517 - * 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)]) - * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) + /* "collisions.py":1551 + * 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, 1551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __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, 1551, __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, 1551, __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, 1551, __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":1515 - * return newCir, vel - * points = [] - * for o in objs: # <<<<<<<<<<<<<< - * cs = o.whereCollides(mvement) - * if cs != []: + /* "collisions.py":1552 + * 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1552, __pyx_L1_error) + if (__pyx_t_6) { - /* "collisions.py":1521 - * 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 oldCir, [0, 0], [True] + /* "collisions.py":1553 + * 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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_points, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __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, 1521, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_17) { + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __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, 1553, __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, 1553, __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, 1553, __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, 1553, __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, 1553, __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, 1553, __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, 1553, __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, 1553, __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, 1553, __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":1522 - * # Don't let you move when you're in a wall - * if points == []: - * if verbose: # <<<<<<<<<<<<<< - * return oldCir, [0, 0], [True] - * return oldCir, [0, 0] + /* "collisions.py":1552 + * 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_17 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1522, __pyx_L1_error) - if (__pyx_t_17) { + } - /* "collisions.py":1523 - * if points == []: - * if verbose: - * return oldCir, [0, 0], [True] # <<<<<<<<<<<<<< - * return oldCir, [0, 0] - * points.sort(key=lambda x: abs(x[0][0]-oldCir[0])**2+abs(x[0][1]-oldCir[1])**2) + /* "collisions.py":1554 + * 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_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __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, 1523, __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, 1523, __pyx_L1_error); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_True)) __PYX_ERR(0, 1523, __pyx_L1_error); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1523, __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, 1523, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 1523, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_r = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L0; + __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, 1554, __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, 1554, __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, 1554, __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, 1554, __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, 1554, __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, 1554, __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":1522 - * # Don't let you move when you're in a wall - * if points == []: - * if verbose: # <<<<<<<<<<<<<< - * return oldCir, [0, 0], [True] - * return oldCir, [0, 0] + /* "collisions.py":1507 + * 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":1524 - * if verbose: - * return oldCir, [0, 0], [True] - * return oldCir, [0, 0] # <<<<<<<<<<<<<< - * points.sort(key=lambda x: abs(x[0][0]-oldCir[0])**2+abs(x[0][1]-oldCir[1])**2) - * closestP = points[0][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":1556 + * return self.closestPointTo(Point(*ps[0])) + * + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldCir: 'Circle', + * newCir: 'Circle', */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __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, 1524, __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, 1524, __pyx_L1_error); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __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_3, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1524, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_r = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; - /* "collisions.py":1521 - * 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 oldCir, [0, 0], [True] +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":1563 + * 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, 1556, __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, 1556, __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, 1556, __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, 1556, __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, 1556, __pyx_L1_error); + + /* "collisions.py":1556 + * 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, 1556, __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, 1556, __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, 1556, __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_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, 1556, __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, 1556, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 1556, __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, 1556, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 1556, __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, 1556, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 1556, __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, 1556, __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, 1556, __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, 1556, __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, 1556, __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, 1556, __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, 1556, __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); - /* "collisions.py":1525 - * return oldCir, [0, 0], [True] - * return oldCir, [0, 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":1613 + * 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] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_19handleCollisionsPos_lambda15, 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, 1525, __pyx_L1_error) + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos_lambda16(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, +#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("lambda16 (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, 1613, __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, 1613, __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("lambda16", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1613, __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.lambda16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda16(__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_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; + 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("lambda16", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_12_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, 1613, __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, 1613, __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, 1613, __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, 1613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_1) < 0) __PYX_ERR(0, 1525, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __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_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); 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; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "collisions.py":1526 - * return oldCir, [0, 0] - * 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, 1526, __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, 1613, __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, 1526, __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, 1613, __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, 1613, __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, 1613, __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, 1613, __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_closestP = __pyx_t_4; - __pyx_t_4 = 0; - - /* "collisions.py":1527 - * 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 - */ - __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, 1527, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __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, 1613, __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, 1527, __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, 1613, __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_closestObj = __pyx_t_1; + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":1528 - * 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)), + /* 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.handleCollisionsPos.lambda16", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1556 + * return self.closestPointTo(Point(*ps[0])) + * + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldCir: 'Circle', + * 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; + 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_ThisClosestP = 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; + PyObject *__pyx_9genexpr24__pyx_v_j = NULL; + PyObject *__pyx_9genexpr24__pyx_v_i = NULL; + CYTHON_UNUSED Py_ssize_t __pyx_9genexpr25__pyx_v__; + 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; + 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; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + 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; + 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 *); + 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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1556, __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_INCREF(__pyx_v_vel); + + /* "collisions.py":1589 + * 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_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1528, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __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, 1589, __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, 1589, __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, 1589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; + __pyx_t_5 = NULL; __pyx_t_6 = 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); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_closestP, __pyx_v_vel}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __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); + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __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, 1589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_v_t = __pyx_t_1; + __pyx_v_velphi = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1529 - * 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":1590 + * """ + * 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_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_t, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_normal = __pyx_t_1; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1590, __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, 1590, __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":1530 - * 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":1591 + * 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_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1530, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1591, __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, 1530, __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, 1530, __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, 1530, __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, 1530, __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, 1530, __pyx_L1_error) + + /* "collisions.py":1592 + * 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, 1592, __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, 1530, __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, 1530, __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, 1530, __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, 1592, __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, 1592, __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, 1530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __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, 1530, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1592, __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, 1530, __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, 1530, __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, 1530, __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, 1530, __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, 1530, __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, 1530, __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 (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); + __Pyx_DECREF_SET(__pyx_t_10, 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); + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; + __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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1530, __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, 1530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1592, __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, 1592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1530, __pyx_L1_error) + __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, 1592, __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, 1592, __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, 1530, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_13)) __PYX_ERR(0, 1530, __pyx_L1_error); - __pyx_t_14 = 0; - __pyx_t_13 = 0; - - /* "collisions.py":1531 - * 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 = ( - */ - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1531, __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, 1531, __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, 1531, __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, 1531, __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; - } - } - #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, 1531, __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, 1531, __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, 1531, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1592, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; + __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, 1592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = 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)) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_6 = 1; @@ -50897,134 +52739,157 @@ static PyObject *__pyx_pf_10collisions_6Circle_12handleCollisionsPos(CYTHON_UNUS } #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, 1531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_9}; + __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, 1592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __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, 1531, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1592, __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, 1531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __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, 1592, __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, 1531, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1592, __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, 1531, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_14); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_14)) __PYX_ERR(0, 1531, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_14 = 0; - __pyx_t_14 = NULL; + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8)) __PYX_ERR(0, 1592, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(0, 1592, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_7 = 0; + + /* "collisions.py":1593 + * 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, 1593, __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, 1593, __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, 1593, __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, 1593, __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, 1593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = 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); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_5, __pyx_t_11}; - __pyx_t_4 = __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; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_5}; + __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; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - - /* "collisions.py":1532 - * 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]) - \ - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_closestPointTo); 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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_PySequence_Tuple(__pyx_v_closestP); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1532, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1593, __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, 1593, __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, 1593, __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, 1593, __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, 1593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = NULL; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sin); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1593, __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, 1593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = NULL; __pyx_t_6 = 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); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_5}; - __pyx_t_1 = __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; + PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_5}; + __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_1)) __PYX_ERR(0, 1532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - __pyx_v_cpoMvemnt = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_12 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1593, __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, 1593, __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, 1593, __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, 1593, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8)) __PYX_ERR(0, 1593, __pyx_L1_error); + __pyx_t_10 = 0; + __pyx_t_8 = 0; - /* "collisions.py":1534 - * ).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":1594 + * (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_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_hypot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1534, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1594, __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, 1594, __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, 1594, __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, 1594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __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, 1534, __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, 1534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1534, __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, 1534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = PyNumber_Subtract(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __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 = PyNumber_Subtract(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = 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)) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; @@ -51032,459 +52897,372 @@ static PyObject *__pyx_pf_10collisions_6Circle_12handleCollisionsPos(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_7}; + __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, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - - /* "collisions.py":1535 - * 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) - * ) - */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_math); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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, 1535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = PyNumber_Power(__pyx_t_14, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3)) __PYX_ERR(0, 1535, __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, 1535, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - - /* "collisions.py":1536 - * 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) # <<<<<<<<<<<<<< - * ) - * ) - */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_math); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1536, __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, 1536, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1594, __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, 1594, __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, 1536, __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, 1536, __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, 1536, __pyx_L1_error) + __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, 1594, __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, 1594, __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, 1594, __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, 1594, __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, 1536, __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, 1536, __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, 1536, __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_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, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_14 = 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); + if (unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_6 = 1; } } #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; + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_7}; + __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, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1536, __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, 1536, __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, 1536, __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, 1536, __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, 1536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_13 = PyNumber_Multiply(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1594, __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, 1594, __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, 1594, __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, 1594, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10)) __PYX_ERR(0, 1594, __pyx_L1_error); + __pyx_t_9 = 0; + __pyx_t_10 = 0; - /* "collisions.py":1535 - * 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":1595 + * (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_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1535, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1595, __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, 1595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1595, __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, 1595, __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, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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 (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_9}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_8}; + __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - - /* "collisions.py":1534 - * ).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) - */ - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1595, __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; - - /* "collisions.py":1539 - * ) - * ) - * ) * closestObj.bounciness # <<<<<<<<<<<<<< - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1539, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_dist_left = __pyx_t_1; - __pyx_t_1 = 0; + __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, 1595, __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, 1595, __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, 1595, __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, 1595, __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, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_15 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_8}; + __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, 1595, __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, 1595, __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, 1595, __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, 1595, __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, 1595, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_9)) __PYX_ERR(0, 1595, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_6 = 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_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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, 1591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } - /* "collisions.py":1540 - * ) - * ) * closestObj.bounciness - * dist_to = math.hypot(vel[0], vel[1])-dist_left # <<<<<<<<<<<<<< - * if dist_left == 0: - * if verbose: + /* "collisions.py":1596 + * (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 + * if oldCir.collides(objs): */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_hypot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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, 1540, __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, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = NULL; + __pyx_t_2 = 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); + 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_4, 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_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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_oldCir, __pyx_t_4, __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, 1591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_v_dist_left); 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_v_dist_to = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_mvement = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1541 - * ) * closestObj.bounciness - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: # <<<<<<<<<<<<<< + /* "collisions.py":1598 + * ), newCir) + * # Don't let you move when you're in a wall + * if oldCir.collides(objs): # <<<<<<<<<<<<<< * 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, 1541, __pyx_L1_error) - if (__pyx_t_17) { + __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, 1598, __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, 1598, __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, 1598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_16) { - /* "collisions.py":1542 - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: + /* "collisions.py":1599 + * # Don't let you move when you're in a wall + * if oldCir.collides(objs): * 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, 1542, __pyx_L1_error) - if (__pyx_t_17) { + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1599, __pyx_L1_error) + if (__pyx_t_16) { - /* "collisions.py":1543 - * if dist_left == 0: + /* "collisions.py":1600 + * if oldCir.collides(objs): * 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)) + * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1600, __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_4, 0, __pyx_int_0)) __PYX_ERR(0, 1543, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 1600, __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, 1543, __pyx_L1_error); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 1600, __pyx_L1_error); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_True)) __PYX_ERR(0, 1543, __pyx_L1_error); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_True)) __PYX_ERR(0, 1600, __pyx_L1_error); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1600, __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_9, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1543, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1600, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error); - __pyx_t_4 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 1600, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_r = ((PyObject*)__pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_3 = 0; + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1542 - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: + /* "collisions.py":1599 + * # Don't let you move when you're in a wall + * if oldCir.collides(objs): * if verbose: # <<<<<<<<<<<<<< * return oldCir, [0, 0], [True] * return oldCir, [0, 0] */ } - /* "collisions.py":1544 + /* "collisions.py":1601 * 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] + * + * if not mvement.collides(objs): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1601, __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_9, 0, __pyx_int_0)) __PYX_ERR(0, 1544, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0)) __PYX_ERR(0, 1601, __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, 1544, __pyx_L1_error); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(0, 1601, __pyx_L1_error); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1601, __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_1, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1544, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9)) __PYX_ERR(0, 1544, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1601, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1601, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1541 - * ) * closestObj.bounciness - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: # <<<<<<<<<<<<<< + /* "collisions.py":1598 + * ), newCir) + * # Don't let you move when you're in a wall + * if oldCir.collides(objs): # <<<<<<<<<<<<<< * if verbose: * return oldCir, [0, 0], [True] */ } - /* "collisions.py":1545 - * 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 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __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, 1545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __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; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_t_5 = PyNumber_Multiply(__pyx_v_dist_to, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1545, __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, 1545, __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, 1545, __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, 1545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __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_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); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_14, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } - __pyx_t_14 = PyNumber_Multiply(__pyx_v_dist_to, __pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1545, __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, 1545, __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, 1545, __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, 1545, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_1 = 0; - __pyx_v_ThisClosestP = ((PyObject*)__pyx_t_14); - __pyx_t_14 = 0; - - /* "collisions.py":1546 + /* "collisions.py":1603 * 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, 1546, __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, 1546, __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, 1546, __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, 1546, __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, 1546, __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, 1546, __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":1547 - * 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 - * if diff > 180: + * + * if not mvement.collides(objs): # <<<<<<<<<<<<<< + * if verbose: + * return newCir, vel, [False] */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1547, __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, 1547, __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, 1547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1547, __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, 1603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __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_4))) { + 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); @@ -51496,261 +53274,530 @@ static PyObject *__pyx_pf_10collisions_6Circle_12handleCollisionsPos(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_y, __pyx_v_x}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + 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_9)) __PYX_ERR(0, 1547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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_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); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_14, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1547, __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, 1547, __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_16 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1603, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_17 = (!__pyx_t_16); + if (__pyx_t_17) { - /* "collisions.py":1548 - * x, y = oldCir[0] - ThisClosestP[0], oldCir[1] - ThisClosestP[1] - * phi = math.degrees(math.atan2(y, x))+90 - * diff = (phi-normal) % 360 # <<<<<<<<<<<<<< - * if diff > 180: - * diff = diff - 360 + /* "collisions.py":1604 + * + * if not mvement.collides(objs): + * if verbose: # <<<<<<<<<<<<<< + * return newCir, vel, [False] + * return newCir, vel */ - __pyx_t_14 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1548, __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, 1548, __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_17 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1604, __pyx_L1_error) + if (__pyx_t_17) { - /* "collisions.py":1549 - * phi = math.degrees(math.atan2(y, x))+90 - * diff = (phi-normal) % 360 - * if diff > 180: # <<<<<<<<<<<<<< - * diff = diff - 360 - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) + /* "collisions.py":1605 + * if not mvement.collides(objs): + * if verbose: + * return newCir, vel, [False] # <<<<<<<<<<<<<< + * return newCir, vel + * points = [] */ - __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, 1549, __pyx_L1_error) - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1549, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_17) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_False)) __PYX_ERR(0, 1605, __pyx_L1_error); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1605, __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, 1605, __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, 1605, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 1605, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; - /* "collisions.py":1550 - * 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)) + /* "collisions.py":1604 + * + * if not mvement.collides(objs): + * if verbose: # <<<<<<<<<<<<<< + * return newCir, vel, [False] + * return newCir, vel */ - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_5); - __pyx_t_5 = 0; + } - /* "collisions.py":1549 - * phi = math.degrees(math.atan2(y, x))+90 - * diff = (phi-normal) % 360 - * if diff > 180: # <<<<<<<<<<<<<< - * diff = diff - 360 - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) + /* "collisions.py":1606 + * if verbose: + * return newCir, vel, [False] + * return newCir, vel # <<<<<<<<<<<<<< + * points = [] + * for o in objs: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1606, __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, 1606, __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, 1606, __pyx_L1_error); + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1603 + * return oldCir, [0, 0] + * + * if not mvement.collides(objs): # <<<<<<<<<<<<<< + * if verbose: + * return newCir, vel, [False] */ } - /* "collisions.py":1551 - * 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)) - * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] + /* "collisions.py":1607 + * return newCir, vel, [False] + * return newCir, vel + * points = [] # <<<<<<<<<<<<<< + * for o in objs: + * cs = o.whereCollides(mvement) */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_rotate); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1551, __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, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_ThisClosestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_dist_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_9)) __PYX_ERR(0, 1551, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1551, __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, 1551, __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, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = 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); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_14, function); - __pyx_t_6 = 1; - } + __pyx_v_points = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "collisions.py":1608 + * return newCir, vel + * points = [] + * for o in objs: # <<<<<<<<<<<<<< + * cs = o.whereCollides(mvement) + * if cs != []: + */ + 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; + } else { + __pyx_t_18 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1608, __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, 1608, __pyx_L1_error) } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_ThisClosestP, __pyx_t_4, __pyx_t_3}; - __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; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_19)) { + 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, 1608, __pyx_L1_error) + #endif + if (__pyx_t_18 >= __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, 1608, __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, 1608, __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, 1608, __pyx_L1_error) + #endif + if (__pyx_t_18 >= __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, 1608, __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, 1608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_19(__pyx_t_4); + 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, 1608, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); + __pyx_t_3 = 0; + + /* "collisions.py":1609 + * 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)]) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1609, __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_mvement}; + __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, 1609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_cs, __pyx_t_3); + __pyx_t_3 = 0; + + /* "collisions.py":1610 + * 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)]) + * 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, 1610, __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, 1610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1551, __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_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1610, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_17) { - /* "collisions.py":1552 - * diff = diff - 360 - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) - * vel = list(rotateBy0(vel, 180-diff*2)) # <<<<<<<<<<<<<< - * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] - * # HACK + /* "collisions.py":1611 + * 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, 1611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1611, __pyx_L12_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, 1611, __pyx_L12_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, 1611, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1611, __pyx_L12_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, 1611, __pyx_L12_error); + __Pyx_GIVEREF(__pyx_t_13); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13)) __PYX_ERR(0, 1611, __pyx_L12_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_DECREF(__pyx_t_12); __pyx_t_12 = 0; + for (;;) { + if (__pyx_t_20 >= 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, 1611, __pyx_L12_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, 1611, __pyx_L12_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, 1611, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_11 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + __pyx_t_6 = 1; + } + } + #endif + { + 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, 1611, __pyx_L12_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; + } else { + __pyx_t_21 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1611, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_22 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1611, __pyx_L12_error) + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + for (;;) { + if (likely(!__pyx_t_22)) { + 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, 1611, __pyx_L12_error) + #endif + if (__pyx_t_21 >= __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, 1611, __pyx_L12_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, 1611, __pyx_L12_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, 1611, __pyx_L12_error) + #endif + if (__pyx_t_21 >= __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, 1611, __pyx_L12_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, 1611, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + } + } else { + __pyx_t_12 = __pyx_t_22(__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, 1611, __pyx_L12_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_12); + } + __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, 1611, __pyx_L12_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, 1611, __pyx_L12_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, 1611, __pyx_L12_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, 1611, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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_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, 1611, __pyx_L12_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, 1611, __pyx_L12_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, 1611, __pyx_L12_error) + } + } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + __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:; + __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:; + } /* 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(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, 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_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, 1611, __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":1612 + * 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) + * closestP = points[0][0] + */ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1612, __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, 1612, __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, 1612, __pyx_L1_error) + } + } /* exit inner scope */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __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, 1612, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1612, __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, 1612, __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, 1612, __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, 1612, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":1610 + * 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)]) + * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_SubtractCObj(__pyx_int_180, __pyx_t_3, 0xB4, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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; } + + /* "collisions.py":1608 + * return newCir, vel + * points = [] + * for o in objs: # <<<<<<<<<<<<<< + * cs = o.whereCollides(mvement) + * if cs != []: + */ } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_vel, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1552, __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, 1552, __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(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1553 - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[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) + /* "collisions.py":1613 + * 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] */ - __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, 1553, __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, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_14, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1553, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __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, 1553, __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, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __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, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_t_4)) __PYX_ERR(0, 1553, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error); - __pyx_t_4 = 0; + __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, 1613, __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, 1613, __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, 1613, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":1614 + * 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, 1614, __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, 1614, __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; - __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_14); - __pyx_t_14 = 0; - /* "collisions.py":1555 - * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] - * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) # <<<<<<<<<<<<<< - * out, outvel = self.handleCollisionsPos(Circle(ThisClosestP[0]+smallness[0], ThisClosestP[1]+smallness[1], newCir.r), - * Circle(*pos, oldCir.r), objs, vel, False, precision) + /* "collisions.py":1615 + * 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 */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1555, __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, 1615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1555, __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, 1555, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 1555, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1555, __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, 1615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_closestObj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1616 + * 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)), + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_9)) { + 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_9); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; @@ -51758,807 +53805,1363 @@ static PyObject *__pyx_pf_10collisions_6Circle_12handleCollisionsPos(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_1}; - __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_3, __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; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_closestP, __pyx_v_vel}; + __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, 1616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_v_smallness = __pyx_t_14; - __pyx_t_14 = 0; + __pyx_v_t = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1556 - * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) - * 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: + /* "collisions.py":1617 + * 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)) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Circle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1556, __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, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __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, 1556, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_t, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_normal = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1618 + * 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)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Add(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_ThisClosestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1556, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 1556, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1618, __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, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = NULL; + __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, 1618, __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, 1618, __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, 1618, __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_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); + 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_5, function); + __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_4, __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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + 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, 1618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - - /* "collisions.py":1557 - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) - * 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] - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Circle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1557, __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, 1557, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1618, __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, 1557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __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, 1557, __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, 1557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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, 1618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); __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, 1557, __pyx_L1_error) + __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, 1618, __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, 1618, __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_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1618, __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, 1618, __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, 1618, __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, 1618, __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, 1618, __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 (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_13); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_5, 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_3, __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, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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, 1618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { - PyObject* sequence = __pyx_t_14; - 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, 1556, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1618, __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, 1618, __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, 1618, __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, 1618, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_13); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_13)) __PYX_ERR(0, 1618, __pyx_L1_error); + __pyx_t_14 = 0; + __pyx_t_13 = 0; + + /* "collisions.py":1619 + * 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 = ( + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1619, __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, 1619, __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, 1619, __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, 1619, __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; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 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, 1619, __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, 1619, __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, 1619, __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, 1619, __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, 1619, __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, 1619, __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, 1619, __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; } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1556, __pyx_L1_error) + } + #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, 1619, __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, 1619, __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, 1619, __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, 1619, __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, 1619, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_14); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_14)) __PYX_ERR(0, 1619, __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; + } + } + #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, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1556, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "collisions.py":1620 + * 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]) - \ + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1620, __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, 1620, __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, 1620, __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, 1620, __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, 1620, __pyx_L1_error) __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_3 = __pyx_t_25(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L27_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - 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, 1556, __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_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1556, __pyx_L1_error) - __pyx_L28_unpacking_done:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } + __pyx_v_cpoMvemnt = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1556 - * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) - * 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: + /* "collisions.py":1622 + * ).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) */ - __pyx_v_out = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_outvel = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1622, __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, 1622, __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, 1622, __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, 1622, __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, 1622, __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, 1622, __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, 1622, __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, 1622, __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; + } + } + #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; + __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, 1622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } - /* "collisions.py":1558 - * 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] - * if verbose: + /* "collisions.py":1623 + * 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) + * ) */ - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1558, __pyx_L1_error) - if (__pyx_t_17) { + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_math); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1623, __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, 1623, __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, 1623, __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, 1623, __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, 1623, __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, 1623, __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, 1623, __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, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "collisions.py":1559 - * Circle(*pos, oldCir.r), objs, vel, False, precision) - * if replaceSelf: - * self.x, self.y = out[0][0], out[0][1] # <<<<<<<<<<<<<< - * if verbose: - * return out, outvel, [True] + /* "collisions.py":1624 + * 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) # <<<<<<<<<<<<<< + * ) + * ) */ - __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, 1559, __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, 1559, __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, 1559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __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, 1559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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, 1559, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_math); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1624, __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, 1624, __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, 1624, __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, 1624, __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, 1624, __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, 1624, __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, 1624, __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, 1624, __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; + } + } + #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_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, 1559, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1624, __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, 1624, __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, 1624, __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, 1624, __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, 1624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":1558 - * 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] - * if verbose: + /* "collisions.py":1623 + * 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) + * ) */ + __pyx_t_9 = PyNumber_Subtract(__pyx_t_4, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1623, __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; + } + } + #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, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "collisions.py":1560 - * if replaceSelf: - * self.x, self.y = out[0][0], out[0][1] - * if verbose: # <<<<<<<<<<<<<< - * return out, outvel, [True] - * return out, outvel + /* "collisions.py":1622 + * ).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) */ - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1560, __pyx_L1_error) - if (__pyx_t_17) { + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1622, __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; - /* "collisions.py":1561 - * self.x, self.y = out[0][0], out[0][1] - * if verbose: - * return out, outvel, [True] # <<<<<<<<<<<<<< - * return out, outvel - * + /* "collisions.py":1627 + * ) + * ) + * ) * closestObj.bounciness # <<<<<<<<<<<<<< + * dist_to = math.hypot(vel[0], vel[1])-dist_left + * if dist_left == 0: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_True)) __PYX_ERR(0, 1561, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1561, __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, 1561, __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, 1561, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_r = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1627, __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, 1627, __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; - /* "collisions.py":1560 - * if replaceSelf: - * self.x, self.y = out[0][0], out[0][1] - * if verbose: # <<<<<<<<<<<<<< - * return out, outvel, [True] - * return out, outvel + /* "collisions.py":1628 + * ) + * ) * closestObj.bounciness + * dist_to = math.hypot(vel[0], vel[1])-dist_left # <<<<<<<<<<<<<< + * if dist_left == 0: + * if verbose: */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1628, __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, 1628, __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, 1628, __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, 1628, __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, 1628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_v_dist_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1628, __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; - /* "collisions.py":1562 - * if verbose: - * return out, outvel, [True] - * return out, outvel # <<<<<<<<<<<<<< - * - * def handleCollisionsVel(self, + /* "collisions.py":1629 + * ) * closestObj.bounciness + * dist_to = math.hypot(vel[0], vel[1])-dist_left + * if dist_left == 0: # <<<<<<<<<<<<<< + * if verbose: + * return oldCir, [0, 0], [True] */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1562, __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, 1562, __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, 1562, __pyx_L1_error); - __pyx_r = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_t_17 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_dist_left, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1629, __pyx_L1_error) + if (__pyx_t_17) { - /* "collisions.py":1469 - * return self.closestPointTo(Point(*ps[0])) - * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldCir: 'Circle', - * newCir: 'Circle', + /* "collisions.py":1630 + * dist_to = math.hypot(vel[0], vel[1])-dist_left + * 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, 1630, __pyx_L1_error) + if (__pyx_t_17) { - /* 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_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_XDECREF(__pyx_t_13); - __Pyx_XDECREF(__pyx_t_14); - __Pyx_XDECREF(__pyx_t_15); - __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_ThisClosestP); - __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_9genexpr22__pyx_v_j); - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_i); - __Pyx_XDECREF(__pyx_v_vel); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1564 - * return out, outvel - * - * def handleCollisionsVel(self, # <<<<<<<<<<<<<< - * vel: pointLike, - * objs: Union[Shapes,Iterable[Shape]], + /* "collisions.py":1631 + * 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)) */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __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, 1631, __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, 1631, __pyx_L1_error); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1631, __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, 1631, __pyx_L1_error); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __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, 1631, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1)) __PYX_ERR(0, 1631, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_r = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L0; -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":1569 - * replaceSelf: bool = True, - * precision: Number = BASEPRECISION, - * verbose: bool = False # <<<<<<<<<<<<<< - * ) -> tuple['Circle', pointLike, verboseOutput]: - * """ + /* "collisions.py":1630 + * dist_to = math.hypot(vel[0], vel[1])-dist_left + * if dist_left == 0: + * if verbose: # <<<<<<<<<<<<<< + * return oldCir, [0, 0], [True] + * return oldCir, [0, 0] */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1564, __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, 1564, __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, 1564, __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, 1564, __pyx_L1_error); + } - /* "collisions.py":1564 - * return out, outvel - * - * def handleCollisionsVel(self, # <<<<<<<<<<<<<< - * vel: pointLike, - * objs: Union[Shapes,Iterable[Shape]], + /* "collisions.py":1632 + * 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] */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1564, __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, 1564, __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, 1564, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __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, 1632, __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, 1632, __pyx_L1_error); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1632, __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_1, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1632, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9)) __PYX_ERR(0, 1632, __pyx_L1_error); + __pyx_t_9 = 0; + __pyx_r = ((PyObject*)__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; -} + /* "collisions.py":1629 + * ) * closestObj.bounciness + * dist_to = math.hypot(vel[0], vel[1])-dist_left + * if dist_left == 0: # <<<<<<<<<<<<<< + * if verbose: + * return oldCir, [0, 0], [True] + */ + } -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_15handleCollisionsVel(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_14handleCollisionsVel, "\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_15handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_15handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_14handleCollisionsVel}; -static PyObject *__pyx_pw_10collisions_6Circle_15handleCollisionsVel(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_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[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("handleCollisionsVel (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_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); - 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); - 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, 1564, __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)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1564, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 1564, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - 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, 1564, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 1564, __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, 1564, __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, 1564, __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, 1564, __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, 1564, __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); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + /* "collisions.py":1633 + * 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 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1633, __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, 1633, __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, 1633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __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_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); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_6 = 1; } - __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]; } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 1564, __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[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, 1633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyNumber_Multiply(__pyx_v_dist_to, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1633, __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, 1633, __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, 1633, __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, 1633, __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, 1633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __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; } } - __Pyx_AddTraceback("collisions.Circle.handleCollisionsVel", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_14handleCollisionsVel(__pyx_self, __pyx_v_self, __pyx_v_vel, __pyx_v_objs, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); - - /* 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_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, 1633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsVel(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; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - unsigned int __pyx_t_9; - int __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("handleCollisionsVel", 1); + __pyx_t_14 = PyNumber_Multiply(__pyx_v_dist_to, __pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1633, __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, 1633, __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, 1633, __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, 1633, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_1)) __PYX_ERR(0, 1633, __pyx_L1_error); + __pyx_t_9 = 0; + __pyx_t_1 = 0; + __pyx_v_ThisClosestP = ((PyObject*)__pyx_t_14); + __pyx_t_14 = 0; - /* "collisions.py":1587 - * 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) # <<<<<<<<<<<<<< - * if replaceSelf: - * self.x, self.y = o[0][0], o[0][1] + /* "collisions.py":1634 + * 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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1587, __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, 1587, __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, 1587, __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, 1587, __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, 1587, __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, 1587, __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, 1587, __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, 1587, __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, 1587, __pyx_L1_error) + __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, 1634, __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, 1634, __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, 1634, __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, 1634, __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, 1634, __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, 1634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; + __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":1635 + * 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 + * if diff > 180: + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1635, __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, 1635, __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, 1635, __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, 1635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_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 (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_9 = 1; + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); - __Pyx_XDECREF(__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; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + 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, 1635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_4 = NULL; - __pyx_t_9 = 0; + __pyx_t_3 = 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); + 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_2, function); - __pyx_t_9 = 1; + __Pyx_DECREF_SET(__pyx_t_14, function); + __pyx_t_6 = 1; } } #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); - __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, 1587, __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_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, 1635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - __pyx_v_o = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1635, __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; - /* "collisions.py":1588 - * """ - * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, False, precision, verbose) - * if replaceSelf: # <<<<<<<<<<<<<< - * self.x, self.y = o[0][0], o[0][1] - * if verbose: + /* "collisions.py":1636 + * x, y = oldCir[0] - ThisClosestP[0], oldCir[1] - ThisClosestP[1] + * phi = math.degrees(math.atan2(y, x))+90 + * diff = (phi-normal) % 360 # <<<<<<<<<<<<<< + * if diff > 180: + * diff = diff - 360 */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1588, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_14 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1636, __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, 1636, __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; - /* "collisions.py":1589 - * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, False, precision, verbose) - * if replaceSelf: - * self.x, self.y = o[0][0], o[0][1] # <<<<<<<<<<<<<< - * if verbose: - * return o[0], o[1], o[2] + /* "collisions.py":1637 + * phi = math.degrees(math.atan2(y, x))+90 + * diff = (phi-normal) % 360 + * if diff > 180: # <<<<<<<<<<<<<< + * diff = diff - 360 + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*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, 1589, __pyx_L1_error) + __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, 1637, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1637, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_17) { + + /* "collisions.py":1638 + * 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)) + */ + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __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_SET(__pyx_v_diff, __pyx_t_5); + __pyx_t_5 = 0; + + /* "collisions.py":1637 + * phi = math.degrees(math.atan2(y, x))+90 + * diff = (phi-normal) % 360 + * if diff > 180: # <<<<<<<<<<<<<< + * diff = diff - 360 + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) + */ + } + + /* "collisions.py":1639 + * 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)) + * 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, 1639, __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, 1639, __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, 1639, __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, 1639, __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, 1639, __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, 1639, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1639, __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, 1639, __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, 1639, __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, 1639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = 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); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, 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; + __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, 1639, __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; + + /* "collisions.py":1640 + * diff = diff - 360 + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[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_14, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1640, __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, 1640, __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, 1640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_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); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, 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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1640, __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, 1640, __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; + + /* "collisions.py":1641 + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[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_14 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1641, __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, 1641, __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, 1641, __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, 1641, __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, 1641, __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, 1641, __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, 1641, __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, 1641, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_4)) __PYX_ERR(0, 1641, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_14); + __pyx_t_14 = 0; + + /* "collisions.py":1643 + * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] + * # HACK + * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) # <<<<<<<<<<<<<< + * 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, 1643, __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, 1643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1643, __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, 1643, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 1643, __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, 1643, __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, 1643, __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, 1643, __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_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); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, 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; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1643, __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; + + /* "collisions.py":1644 + * # HACK + * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + * 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, 1644, __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, 1644, __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, 1644, __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, 1644, __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, 1644, __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, 1644, __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, 1644, __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, 1644, __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, 1644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = 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); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, 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; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1644, __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, 1589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "collisions.py":1645 + * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + * 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] + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Circle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1645, __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, 1645, __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, 1645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __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, 1645, __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, 1645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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, 1645, __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_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); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, 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_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, 1589, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { + PyObject* sequence = __pyx_t_14; + 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, 1644, __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); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 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, 1644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1644, __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, 1589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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; + __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, 1644, __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; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 1589, __pyx_L1_error) + __pyx_t_25 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1644, __pyx_L1_error) + __pyx_L28_unpacking_done:; + } + + /* "collisions.py":1644 + * # HACK + * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + * 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_t_4 = 0; + __pyx_v_outvel = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1646 + * 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] + * if verbose: + */ + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1646, __pyx_L1_error) + if (__pyx_t_17) { + + /* "collisions.py":1647 + * Circle(*pos, oldCir.r), objs, vel, False, precision) + * if replaceSelf: + * self.x, self.y = out[0][0], out[0][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, 1647, __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, 1647, __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, 1647, __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, 1647, __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, 1647, __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, 1589, __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_4) < 0) __PYX_ERR(0, 1647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1588 - * """ - * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, False, precision, verbose) + /* "collisions.py":1646 + * 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 = o[0][0], o[0][1] + * self.x, self.y = out[0][0], out[0][1] * if verbose: */ } - /* "collisions.py":1590 + /* "collisions.py":1648 * if replaceSelf: - * self.x, self.y = o[0][0], o[0][1] + * self.x, self.y = out[0][0], out[0][1] * if verbose: # <<<<<<<<<<<<<< - * return o[0], o[1], o[2] - * return o[0], o[1] + * return out, outvel, [True] + * return out, outvel */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1590, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1648, __pyx_L1_error) + if (__pyx_t_17) { - /* "collisions.py":1591 - * self.x, self.y = o[0][0], o[0][1] + /* "collisions.py":1649 + * self.x, self.y = out[0][0], out[0][1] * if verbose: - * return o[0], o[1], o[2] # <<<<<<<<<<<<<< - * return o[0], o[1] + * return out, outvel, [True] # <<<<<<<<<<<<<< + * return out, outvel * */ __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, 1591, __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, 1591, __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, 1591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1591, __pyx_L1_error) + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1649, __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, 1591, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1591, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - __pyx_t_1 = 0; - __pyx_r = ((PyObject*)__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, 1649, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __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, 1649, __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, 1649, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4)) __PYX_ERR(0, 1649, __pyx_L1_error); __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1590 + /* "collisions.py":1648 * if replaceSelf: - * self.x, self.y = o[0][0], o[0][1] + * self.x, self.y = out[0][0], out[0][1] * if verbose: # <<<<<<<<<<<<<< - * return o[0], o[1], o[2] - * return o[0], o[1] + * return out, outvel, [True] + * return out, outvel */ } - /* "collisions.py":1592 + /* "collisions.py":1650 * if verbose: - * return o[0], o[1], o[2] - * return o[0], o[1] # <<<<<<<<<<<<<< + * return out, outvel, [True] + * return out, outvel # <<<<<<<<<<<<<< * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: + * def handleCollisionsVel(self, */ __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, 1592, __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, 1592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1650, __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, 1592, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_1 = 0; + __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, 1650, __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, 1650, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1564 - * return out, outvel + /* "collisions.py":1556 + * return self.closestPointTo(Point(*ps[0])) * - * def handleCollisionsVel(self, # <<<<<<<<<<<<<< - * vel: pointLike, - * objs: Union[Shapes,Iterable[Shape]], + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldCir: 'Circle', + * newCir: 'Circle', */ /* function exit code */ @@ -52568,27 +55171,58 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsVel(CYTHON_UNUS __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.Circle.handleCollisionsVel", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __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_ThisClosestP); + __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_9genexpr24__pyx_v_j); + __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_i); + __Pyx_XDECREF(__pyx_v_vel); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1594 - * return o[0], o[1] +/* "collisions.py":1652 + * return out, outvel * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< - * """ - * Finds whether a point is on a corner of this shape. + * def handleCollisionsVel(self, # <<<<<<<<<<<<<< + * vel: pointLike, + * objs: Union[Shapes,Iterable[Shape]], */ -static PyObject *__pyx_pf_10collisions_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -52598,18 +55232,40 @@ 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, 1594, __pyx_L1_error) + + /* "collisions.py":1657 + * replaceSelf: bool = True, + * precision: Number = BASEPRECISION, + * verbose: bool = False # <<<<<<<<<<<<<< + * ) -> tuple['Circle', pointLike, verboseOutput]: + * """ + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __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, 1594, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1594, __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, 1652, __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, 1652, __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, 1652, __pyx_L1_error); + + /* "collisions.py":1652 + * 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, 1652, __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, 1594, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1652, __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, 1594, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1652, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -52628,36 +55284,39 @@ static PyObject *__pyx_pf_10collisions_48__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_17isCorner(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_17handleCollisionsVel(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_16isCorner, "\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_6Circle_17isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_17isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_16isCorner}; -static PyObject *__pyx_pw_10collisions_6Circle_17isCorner(PyObject *__pyx_self, +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, #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_point = 0; - CYTHON_UNUSED PyObject *__pyx_v_precision = 0; + PyObject *__pyx_v_self = 0; + 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[3] = {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("isCorner (wrapper)", 0); + __Pyx_RefNannySetupContext("handleCollisionsVel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -52667,12 +55326,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_point,&__pyx_n_s_precision,0}; - __pyx_defaults15 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self); - values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); + 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); + 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); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); @@ -52689,32 +55356,479 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1594, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1652, __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_vel)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1594, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1594, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 1652, __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, 1594, __pyx_L3_error) + 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--; } - } - 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, 1594, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 1652, __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, 1652, __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, 1652, __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, 1652, __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, 1652, __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); + 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_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("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 1652, __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.handleCollisionsVel", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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); + + /* 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_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) { + 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; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + unsigned int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("handleCollisionsVel", 1); + + /* "collisions.py":1675 + * 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) # <<<<<<<<<<<<<< + * 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, 1675, __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, 1675, __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, 1675, __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, 1675, __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, 1675, __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, 1675, __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, 1675, __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, 1675, __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, 1675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_9 = 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_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); + __Pyx_XDECREF(__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; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = NULL; + __pyx_t_9 = 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_9 = 1; + } + } + #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); + __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, 1675, __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":1676 + * """ + * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, 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, 1676, __pyx_L1_error) + if (__pyx_t_10) { + + /* "collisions.py":1677 + * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, 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, 1677, __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, 1677, __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, 1677, __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, 1677, __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, 1677, __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, 1677, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":1676 + * """ + * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, False, precision, verbose) + * if replaceSelf: # <<<<<<<<<<<<<< + * self.x, self.y = o[0][0], o[0][1] + * if verbose: + */ + } + + /* "collisions.py":1678 + * 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, 1678, __pyx_L1_error) + if (__pyx_t_10) { + + /* "collisions.py":1679 + * 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_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, 1679, __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, 1679, __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, 1679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1679, __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, 1679, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 1679, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_r = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1678 + * 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] + */ + } + + /* "collisions.py":1680 + * if verbose: + * return o[0], o[1], o[2] + * return o[0], o[1] # <<<<<<<<<<<<<< + * + * 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, 1680, __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, 1680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1680, __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, 1680, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1680, __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":1652 + * 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_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("collisions.Circle.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":1682 + * 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. + */ + +static PyObject *__pyx_pf_10collisions_48__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, 1682, __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, 1682, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __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, 1682, __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, 1682, __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_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_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, +#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_point = 0; + CYTHON_UNUSED 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_defaults15 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults15, __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, 1682, __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, 1682, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1682, __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, 1682, __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, 1682, __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); @@ -52729,7 +55843,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, 1594, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1682, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -52743,7 +55857,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_16isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); + __pyx_r = __pyx_pf_10collisions_6Circle_18isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); /* function exit code */ { @@ -52756,12 +55870,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_16isCorner(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_18isCorner(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":1605 + /* "collisions.py":1693 * bool: Whether the point is on a corner of this shape * """ * return False # <<<<<<<<<<<<<< @@ -52773,12 +55887,12 @@ static PyObject *__pyx_pf_10collisions_6Circle_16isCorner(CYTHON_UNUSED PyObject __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1594 + /* "collisions.py":1682 * 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. + * Finds whether a point is on a corner of this shape. But because circles don't have any corners, this will return False. */ /* function exit code */ @@ -52788,7 +55902,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_16isCorner(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1607 +/* "collisions.py":1695 * return False * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -52797,16 +55911,16 @@ static PyObject *__pyx_pf_10collisions_6Circle_16isCorner(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_19tangent(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_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_6Circle_18tangent, "\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_19tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_19tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_18tangent}; -static PyObject *__pyx_pw_10collisions_6Circle_19tangent(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -52856,7 +55970,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1607, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1695, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -52864,9 +55978,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1607, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1695, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 1607, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 1695, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -52874,14 +55988,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1607, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1695, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 1607, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 1695, __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, 1607, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 1695, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -52896,7 +56010,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, 1607, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1695, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -52910,7 +56024,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_18tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); + __pyx_r = __pyx_pf_10collisions_6Circle_20tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); /* function exit code */ { @@ -52923,7 +56037,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_18tangent(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_20tangent(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; @@ -52941,25 +56055,25 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tangent", 1); - /* "collisions.py":1618 + /* "collisions.py":1706 * 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, 1618, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1706, __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, 1618, __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, 1706, __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, 1618, __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, 1706, __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, 1618, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "collisions.py":1619 + /* "collisions.py":1707 * """ * if self.x == point[0]: * return 90 # <<<<<<<<<<<<<< @@ -52971,7 +56085,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(CYTHON_UNUSED PyObject __pyx_r = __pyx_int_90; goto __pyx_L0; - /* "collisions.py":1618 + /* "collisions.py":1706 * Number: The tangent of the circle at the point. You can -90 to get the normal. * """ * if self.x == point[0]: # <<<<<<<<<<<<<< @@ -52980,7 +56094,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1620 + /* "collisions.py":1708 * 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) # <<<<<<<<<<<<<< @@ -52988,33 +56102,33 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(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, 1620, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1708, __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, 1620, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __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, 1620, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1708, __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, 1620, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_atan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1708, __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, 1620, __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, 1708, __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, 1620, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1708, __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, 1620, __pyx_L1_error) + __pyx_t_8 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1708, __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, 1620, __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, 1708, __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, 1620, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1708, __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, 1620, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1708, __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, 1620, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1708, __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; @@ -53037,7 +56151,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(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, 1620, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -53060,18 +56174,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(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, 1620, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __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, 1620, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1708, __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, 1620, __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, 1708, __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, 1620, __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, 1708, __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, 1620, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1708, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { __Pyx_INCREF(__pyx_int_0); @@ -53080,7 +56194,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(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, 1620, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1708, __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; @@ -53088,7 +56202,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(CYTHON_UNUSED PyObject __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":1607 + /* "collisions.py":1695 * return False * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -53114,7 +56228,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1622 +/* "collisions.py":1710 * 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': # <<<<<<<<<<<<<< @@ -53123,16 +56237,16 @@ static PyObject *__pyx_pf_10collisions_6Circle_18tangent(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_21copy(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_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_6Circle_20copy, "\n Make a replica of this object with the same object.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_21copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_21copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_20copy}; -static PyObject *__pyx_pw_10collisions_6Circle_21copy(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -53176,12 +56290,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1622, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1710, __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, 1622, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 1710, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -53192,7 +56306,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, 1622, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1710, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -53206,7 +56320,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_20copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Circle_22copy(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -53219,7 +56333,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_20copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Circle_22copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -53235,7 +56349,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20copy(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":1626 + /* "collisions.py":1714 * Make a replica of this object with the same object. * """ * return Circle(self.x, self.y, self.r, self.bounciness) # <<<<<<<<<<<<<< @@ -53243,15 +56357,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_20copy(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, 1626, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1714, __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, 1626, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1714, __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, 1626, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1714, __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, 1626, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1714, __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, 1626, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -53275,7 +56389,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20copy(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, 1626, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -53283,7 +56397,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20copy(CYTHON_UNUSED PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1622 + /* "collisions.py":1710 * 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': # <<<<<<<<<<<<<< @@ -53308,7 +56422,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20copy(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":1628 +/* "collisions.py":1716 * return Circle(self.x, self.y, self.r, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< @@ -53317,15 +56431,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_20copy(CYTHON_UNUSED PyObject *__ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_23__getitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_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_6Circle_23__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_23__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_23__getitem__(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -53372,7 +56486,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1628, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1716, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -53380,14 +56494,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1628, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1716, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1628, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1716, __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, 1628, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1716, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -53400,7 +56514,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, 1628, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1716, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -53414,8 +56528,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, 1628, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_6Circle_22__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, 1716, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Circle_24__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); /* function exit code */ goto __pyx_L0; @@ -53432,7 +56546,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_22__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) { +static PyObject *__pyx_pf_10collisions_6Circle_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; @@ -53443,19 +56557,19 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__getitem__(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":1629 + /* "collisions.py":1717 * * 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, 1629, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1629, __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, 1717, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1630 + /* "collisions.py":1718 * def __getitem__(self, item: int) -> Number: * if item == 0: * return self.x # <<<<<<<<<<<<<< @@ -53463,13 +56577,13 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__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, 1630, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1629 + /* "collisions.py":1717 * * def __getitem__(self, item: int) -> Number: * if item == 0: # <<<<<<<<<<<<<< @@ -53478,19 +56592,19 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__getitem__(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1631 + /* "collisions.py":1719 * 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, 1631, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1631, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1632 + /* "collisions.py":1720 * return self.x * elif item == 1: * return self.y # <<<<<<<<<<<<<< @@ -53498,13 +56612,13 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__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, 1632, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1631 + /* "collisions.py":1719 * if item == 0: * return self.x * elif item == 1: # <<<<<<<<<<<<<< @@ -53513,19 +56627,19 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__getitem__(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1633 + /* "collisions.py":1721 * 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, 1633, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1633, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1634 + /* "collisions.py":1722 * return self.y * elif item == 2: * return self.r # <<<<<<<<<<<<<< @@ -53533,13 +56647,13 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__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, 1634, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1633 + /* "collisions.py":1721 * elif item == 1: * return self.y * elif item == 2: # <<<<<<<<<<<<<< @@ -53548,7 +56662,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__getitem__(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1636 + /* "collisions.py":1724 * return self.r * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -53557,35 +56671,35 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__getitem__(CYTHON_UNUSED PyObj */ /*else*/ { - /* "collisions.py":1637 + /* "collisions.py":1725 * 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, 1637, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1725, __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, 1637, __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, 1725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1636 + /* "collisions.py":1724 * 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, 1636, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __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, 1636, __pyx_L1_error) + __PYX_ERR(0, 1724, __pyx_L1_error) } - /* "collisions.py":1628 + /* "collisions.py":1716 * return Circle(self.x, self.y, self.r, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< @@ -53605,7 +56719,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__getitem__(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":1640 +/* "collisions.py":1728 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< @@ -53614,15 +56728,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_22__getitem__(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_25__setitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_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_6Circle_25__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_25__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_25__setitem__(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -53672,7 +56786,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1728, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -53680,9 +56794,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1728, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 1640, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 1728, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -53690,14 +56804,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1728, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 1640, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 1728, __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, 1640, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 1728, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -53712,7 +56826,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, 1640, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1728, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -53726,8 +56840,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, 1640, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_6Circle_24__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, 1728, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Circle_26__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); /* function exit code */ goto __pyx_L0; @@ -53744,7 +56858,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_24__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new) { +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) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -53755,28 +56869,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__setitem__(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":1641 + /* "collisions.py":1729 * * 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, 1641, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1641, __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, 1729, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1642 + /* "collisions.py":1730 * 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, 1642, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_new) < 0) __PYX_ERR(0, 1730, __pyx_L1_error) - /* "collisions.py":1641 + /* "collisions.py":1729 * * def __setitem__(self, item: int, new: Number) -> None: * if item == 0: # <<<<<<<<<<<<<< @@ -53786,28 +56900,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__setitem__(CYTHON_UNUSED PyObj goto __pyx_L3; } - /* "collisions.py":1643 + /* "collisions.py":1731 * 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, 1643, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1643, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1644 + /* "collisions.py":1732 * 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, 1644, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_new) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) - /* "collisions.py":1643 + /* "collisions.py":1731 * if item == 0: * self.x = new * elif item == 1: # <<<<<<<<<<<<<< @@ -53817,28 +56931,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__setitem__(CYTHON_UNUSED PyObj goto __pyx_L3; } - /* "collisions.py":1645 + /* "collisions.py":1733 * 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, 1645, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1645, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1646 + /* "collisions.py":1734 * 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, 1646, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_v_new) < 0) __PYX_ERR(0, 1734, __pyx_L1_error) - /* "collisions.py":1645 + /* "collisions.py":1733 * elif item == 1: * self.y = new * elif item == 2: # <<<<<<<<<<<<<< @@ -53848,7 +56962,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__setitem__(CYTHON_UNUSED PyObj goto __pyx_L3; } - /* "collisions.py":1648 + /* "collisions.py":1736 * self.r = new * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -53857,36 +56971,36 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__setitem__(CYTHON_UNUSED PyObj */ /*else*/ { - /* "collisions.py":1649 + /* "collisions.py":1737 * 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, 1649, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1737, __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, 1649, __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, 1737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1648 + /* "collisions.py":1736 * 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, 1648, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1736, __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, 1648, __pyx_L1_error) + __PYX_ERR(0, 1736, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":1640 + /* "collisions.py":1728 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< @@ -53908,7 +57022,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__setitem__(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":1652 +/* "collisions.py":1740 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -53917,15 +57031,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__setitem__(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_27__iter__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_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_6Circle_27__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_27__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_27__iter__(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -53969,12 +57083,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1740, __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, 1652, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 1740, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -53985,7 +57099,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, 1652, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1740, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -53999,7 +57113,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_26__iter__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Circle_28__iter__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -54012,7 +57126,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_26__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Circle_28__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -54024,7 +57138,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__iter__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":1653 + /* "collisions.py":1741 * * def __iter__(self): * return iter((self.x, self.y, self.r)) # <<<<<<<<<<<<<< @@ -54032,31 +57146,31 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__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, 1653, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1741, __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, 1653, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1741, __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, 1653, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1653, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1741, __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, 1653, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1741, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1653, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1741, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 1653, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 1741, __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, 1653, __pyx_L1_error) + __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1741, __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":1652 + /* "collisions.py":1740 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -54078,7 +57192,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__iter__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1655 +/* "collisions.py":1743 * return iter((self.x, self.y, self.r)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -54087,15 +57201,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__iter__(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_29__str__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_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_6Circle_29__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_29__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_29__str__(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -54139,12 +57253,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1655, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1743, __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, 1655, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 1743, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -54155,7 +57269,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, 1655, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1743, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -54169,7 +57283,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_28__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Circle_30__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -54182,7 +57296,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_28__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -54195,7 +57309,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__str__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":1656 + /* "collisions.py":1744 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -54203,7 +57317,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__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, 1656, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -54211,9 +57325,9 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__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, 1656, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1744, __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, 1656, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1744, __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; @@ -54221,13 +57335,13 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__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__3); + __Pyx_INCREF(__pyx_kp_u__6); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__3); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1656, __pyx_L1_error) + __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, 1744, __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, 1656, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1744, __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; @@ -54239,9 +57353,9 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__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, 1656, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1744, __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, 1656, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1744, __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; @@ -54249,18 +57363,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__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__16); + __Pyx_INCREF(__pyx_kp_u__5); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__16); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__16); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1656, __pyx_L1_error) + __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, 1744, __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":1655 + /* "collisions.py":1743 * return iter((self.x, self.y, self.r)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -54281,9 +57395,9 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__str__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1664 - * **ANGLES ARE MEASURED IN DEGREES.**""" - * GROUPS = [ShpGroups.LINES] +/* "collisions.py":1753 + * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} + * TYPE = ShpTyps.Arc * def __init__(self, # <<<<<<<<<<<<<< * x: Number, * y: Number, @@ -54299,23 +57413,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, 1664, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1664, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1753, __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, 1664, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1753, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1664, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1664, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __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, 1664, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1753, __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, 1664, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 1753, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -54410,7 +57524,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1664, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -54418,9 +57532,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1664, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 1); __PYX_ERR(0, 1664, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 1); __PYX_ERR(0, 1753, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -54428,9 +57542,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1664, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 2); __PYX_ERR(0, 1664, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 2); __PYX_ERR(0, 1753, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -54438,9 +57552,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1664, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 3); __PYX_ERR(0, 1664, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 3); __PYX_ERR(0, 1753, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -54448,9 +57562,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1664, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 4); __PYX_ERR(0, 1664, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 4); __PYX_ERR(0, 1753, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: @@ -54458,28 +57572,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1664, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 5); __PYX_ERR(0, 1664, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 5); __PYX_ERR(0, 1753, __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, 1664, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1753, __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, 1664, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1753, __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, 1664, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 1753, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -54505,14 +57619,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, 1671, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1760, __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, 1664, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, __pyx_nargs); __PYX_ERR(0, 1753, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -54550,7 +57664,7 @@ static PyObject *__pyx_pf_10collisions_3Arc___init__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":1685 + /* "collisions.py":1774 * 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 # <<<<<<<<<<<<<< @@ -54563,14 +57677,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, 1685, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 1774, __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, 1685, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 1774, __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, 1685, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_t_3) < 0) __PYX_ERR(0, 1774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1686 + /* "collisions.py":1775 * """ * self.x, self.y, self.r = x, y, rad * self.startAng, self.endAng = startAngle, endAngle # <<<<<<<<<<<<<< @@ -54581,35 +57695,35 @@ 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, 1686, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_3) < 0) __PYX_ERR(0, 1775, __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, 1686, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_2) < 0) __PYX_ERR(0, 1775, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1687 + /* "collisions.py":1776 * 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, 1687, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_precision, __pyx_v_precision) < 0) __PYX_ERR(0, 1776, __pyx_L1_error) - /* "collisions.py":1688 + /* "collisions.py":1777 * 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, 1688, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1777, __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, 1688, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bounciness, __pyx_t_2) < 0) __PYX_ERR(0, 1777, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1664 - * **ANGLES ARE MEASURED IN DEGREES.**""" - * GROUPS = [ShpGroups.LINES] + /* "collisions.py":1753 + * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} + * TYPE = ShpTyps.Arc * def __init__(self, # <<<<<<<<<<<<<< * x: Number, * y: Number, @@ -54630,7 +57744,7 @@ static PyObject *__pyx_pf_10collisions_3Arc___init__(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":1690 +/* "collisions.py":1779 * self.bounciness = bounciness * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -54692,12 +57806,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1690, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1779, __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, 1690, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 1779, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -54708,7 +57822,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, 1690, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1779, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -54748,46 +57862,46 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":1697 + /* "collisions.py":1786 * 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, 1697, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __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, 1697, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1786, __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, 1697, __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, 1786, __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, 1697, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "collisions.py":1698 + /* "collisions.py":1787 * """ * 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, 1698, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1787, __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, 1698, __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, 1787, __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, 1698, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1787, __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, 1698, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1787, __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":1697 + /* "collisions.py":1786 * Number: The length of the arc. * """ * if self.endAng < self.startAng: # <<<<<<<<<<<<<< @@ -54797,7 +57911,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L3; } - /* "collisions.py":1700 + /* "collisions.py":1789 * diff = 360 - self.startAng + self.endAng * else: * diff = self.endAng - self.startAng # <<<<<<<<<<<<<< @@ -54805,11 +57919,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, 1700, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __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, 1700, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1700, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1789, __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; @@ -54818,7 +57932,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ } __pyx_L3:; - /* "collisions.py":1701 + /* "collisions.py":1790 * else: * diff = self.endAng - self.startAng * return (diff/360) * 2*math.pi * self.r # <<<<<<<<<<<<<< @@ -54826,23 +57940,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, 1701, __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, 1790, __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, 1701, __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, 1790, __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, 1701, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1790, __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, 1701, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1790, __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, 1701, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1790, __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, 1701, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1790, __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, 1701, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1790, __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; @@ -54850,7 +57964,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1690 + /* "collisions.py":1779 * self.bounciness = bounciness * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -54872,11 +57986,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "collisions.py":1703 +/* "collisions.py":1792 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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): */ @@ -54936,7 +58050,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1703, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1792, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -54944,14 +58058,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1703, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1792, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1703, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1792, __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, 1703, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 1792, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -54964,7 +58078,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, 1703, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1792, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -54990,40 +58104,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +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":1711 - * if checkShpType(othershape, (Line, Circle)): - * if checkShpType(othershape, Circle): +/* "collisions.py":1800 + * 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) */ static PyObject *__pyx_pf_10collisions_3Arc_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_14_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_12_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_12_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_12_genexpr, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1711, __pyx_L1_error) + __PYX_ERR(0, 1800, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_13__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_2generator6, 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, 1711, __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, 1800, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -55039,9 +58153,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_9_collides_genexpr(PyObject *__pyx_s return __pyx_r; } -static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -55065,16 +58179,16 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator6(__pyx_Corouti return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1711, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1711, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1800, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1800, __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, 1711, __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, 1800, __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, 1711, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1800, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -55082,28 +58196,28 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator6(__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, 1711, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1800, __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, 1711, __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, 1800, __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, 1711, __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, 1800, __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, 1711, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1800, __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, 1711, __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, 1800, __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, 1711, __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, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -55113,7 +58227,7 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator6(__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, 1711, __pyx_L1_error) + else __PYX_ERR(0, 1800, __pyx_L1_error) } break; } @@ -55123,14 +58237,14 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator6(__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, 1711, __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, 1711, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 1800, __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, 1800, __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, 1711, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1800, __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, 1711, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1800, __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, 1711, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1800, __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; @@ -55153,11 +58267,11 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator6(__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, 1711, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1800, __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, 1711, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_10) { __Pyx_XDECREF(__pyx_r); @@ -55198,21 +58312,21 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator6(__pyx_Corouti return __pyx_r; } -/* "collisions.py":1703 +/* "collisions.py":1792 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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): */ 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_11__collides *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *__pyx_cur_scope; PyObject *__pyx_v_angle = NULL; PyObject *__pyx_v_intersections = NULL; PyObject *__pyx_v_pt = NULL; PyObject *__pyx_v_p = NULL; - PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator6 = 0; + PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -55232,11 +58346,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_11__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_11__collides(__pyx_ptype_10collisions___pyx_scope_struct_11__collides, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1703, __pyx_L1_error) + __PYX_ERR(0, 1792, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -55244,25 +58358,28 @@ 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":1704 + /* "collisions.py":1793 * * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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, 1704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __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, 1704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1793, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -55270,91 +58387,91 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1704, __pyx_L1_error) + __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, 1793, __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, 1704, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1705 + /* "collisions.py":1794 * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): + * 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, 1705, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __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, 1705, __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, 1794, __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, 1705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __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_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __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_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __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, 1705, __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, 1794, __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, 1705, __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, 1794, __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, 1794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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, 1705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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, 1794, __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, 1794, __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, 1705, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_precision); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __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, 1705, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1794, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error); - __pyx_t_4 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1794, __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, 1705, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __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, 1705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __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, 1705, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __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, 1705, __pyx_L1_error); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1794, __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, 1794, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error); - __pyx_t_4 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error); + __pyx_t_3 = 0; __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, 1705, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error) + __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, 1794, __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_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1705, __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, 1794, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1706 - * if checkShpType(othershape, Point): + /* "collisions.py":1795 + * 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)) @@ -55365,56 +58482,56 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1705 + /* "collisions.py":1794 * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): + * 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)) */ } - /* "collisions.py":1707 + /* "collisions.py":1796 * 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, (Line, Circle)): + * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1707, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __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, 1707, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __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, 1707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1707, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __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, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1707, __pyx_L1_error) + __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, 1796, __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, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1707, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1796, __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; __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, 1707, __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, 1796, __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, 1707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyNumber_Subtract(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1707, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __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, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = 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_7))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_4)) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; @@ -55422,12 +58539,12 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_9, __pyx_t_10}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_9, __pyx_t_10}; __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_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, 1707, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -55447,25 +58564,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_3)) __PYX_ERR(0, 1707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_v_angle = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_angle = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1708 + /* "collisions.py":1797 * return False * angle = math.degrees(math.atan2(othershape.y - self.y, othershape.x - self.x)) * return self.angleInRange(angle) # <<<<<<<<<<<<<< - * if checkShpType(othershape, (Line, Circle)): - * if checkShpType(othershape, Circle): + * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): + * 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, 1708, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -55483,54 +58600,52 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_angle}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_3)) __PYX_ERR(0, 1708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1704 + /* "collisions.py":1793 * * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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 */ } - /* "collisions.py":1709 + /* "collisions.py":1798 * angle = math.degrees(math.atan2(othershape.y - self.y, othershape.x - self.x)) * return self.angleInRange(angle) - * if checkShpType(othershape, (Line, Circle)): # <<<<<<<<<<<<<< - * if checkShpType(othershape, Circle): + * 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, 1709, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1709, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1709, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1709, __pyx_L1_error) + __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, 1798, __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, 1798, __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, 1709, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7)) __PYX_ERR(0, 1709, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = NULL; + __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_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { + __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_7); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -55538,37 +58653,41 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_10}; - __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; + PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_7, __pyx_t_10}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __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_3)) __PYX_ERR(0, 1709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1798, __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_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1709, __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, 1798, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1710 + /* "collisions.py":1799 * return self.angleInRange(angle) - * if checkShpType(othershape, (Line, Circle)): - * if checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * 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, 1710, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Circle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1710, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __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_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -55576,35 +58695,35 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_10}; - __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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_cur_scope->__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_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1799, __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_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1710, __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, 1799, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1711 - * if checkShpType(othershape, (Line, Circle)): - * if checkShpType(othershape, Circle): + /* "collisions.py":1800 + * 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, 1711, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = NULL; + __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { + __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_10); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -55612,25 +58731,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 1800, __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_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1711, __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, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1711, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1800, __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_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1711, __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, 1800, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1712 - * if checkShpType(othershape, Circle): + /* "collisions.py":1801 + * 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) @@ -55641,93 +58760,93 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":1711 - * if checkShpType(othershape, (Line, Circle)): - * if checkShpType(othershape, Circle): + /* "collisions.py":1800 + * 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) */ } - /* "collisions.py":1710 + /* "collisions.py":1799 * return self.angleInRange(angle) - * if checkShpType(othershape, (Line, Circle)): - * if checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * 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 */ } - /* "collisions.py":1713 + /* "collisions.py":1802 * 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_10, __pyx_n_s_Circle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1713, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1713, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1802, __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, 1802, __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, 1713, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = NULL; + __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_4); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_7, __pyx_t_2, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __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; + PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_10, __pyx_t_2, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__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; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1713, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1802, __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 (likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(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_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_othershape}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_3)) __PYX_ERR(0, 1713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_v_intersections = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_intersections = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1714 + /* "collisions.py":1803 * return True * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: # <<<<<<<<<<<<<< @@ -55735,75 +58854,75 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ * return True */ if (likely(PyList_CheckExact(__pyx_v_intersections)) || PyTuple_CheckExact(__pyx_v_intersections)) { - __pyx_t_3 = __pyx_v_intersections; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_intersections; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1714, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1803, __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, 1803, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 1714, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1803, __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_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1714, __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, 1803, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 1714, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1803, __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_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1714, __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, 1803, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1714, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif } } else { - __pyx_t_10 = __pyx_t_12(__pyx_t_3); - if (unlikely(!__pyx_t_10)) { + __pyx_t_7 = __pyx_t_12(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1714, __pyx_L1_error) + else __PYX_ERR(0, 1803, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_10); - __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_7); + __pyx_t_7 = 0; - /* "collisions.py":1715 + /* "collisions.py":1804 * 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, 1715, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __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, 1715, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1804, __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, 1715, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_pt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1804, __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; __pyx_t_2 = NULL; @@ -55821,32 +58940,32 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10}; + __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1715, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1804, __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_10); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1715, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1804, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { - /* "collisions.py":1716 + /* "collisions.py":1805 * for pt in intersections: * if self._collides(Point(*pt)): * return True # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1715 + /* "collisions.py":1804 * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: * if self._collides(Point(*pt)): # <<<<<<<<<<<<<< @@ -55855,7 +58974,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1714 + /* "collisions.py":1803 * return True * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: # <<<<<<<<<<<<<< @@ -55863,13 +58982,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ * return True */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1717 + /* "collisions.py":1806 * if self._collides(Point(*pt)): * return True * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); @@ -55877,270 +58996,273 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1709 + /* "collisions.py":1798 * angle = math.degrees(math.atan2(othershape.y - self.y, othershape.x - self.x)) * return self.angleInRange(angle) - * if checkShpType(othershape, (Line, Circle)): # <<<<<<<<<<<<<< - * if checkShpType(othershape, Circle): + * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Circle): * if any(othershape._collides(Point(*i)) for i in self.endPoints()): */ } - /* "collisions.py":1718 + /* "collisions.py":1807 * return True * return False - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Arc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1807, __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, 1807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = NULL; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Arc); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __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_10))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_7); + 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_10, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __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, 1718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_10}; + __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, 1807, __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_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1718, __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, 1807, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1719 + /* "collisions.py":1808 * return False - * if checkShpType(othershape, Arc): + * 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_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Circle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1808, __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, 1808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1719, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1808, __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, 1719, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = NULL; + __pyx_t_3 = 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); + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_7, __pyx_t_2, __pyx_t_9}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_1, __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; + PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_1, __pyx_t_2, __pyx_t_9}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__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; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = NULL; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __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_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); + if (likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + 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, 1808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_v_intersections = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_intersections = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1720 - * if checkShpType(othershape, Arc): + /* "collisions.py":1809 + * if checkShpType(othershape, ShpTyps.Arc): * 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): */ if (likely(PyList_CheckExact(__pyx_v_intersections)) || PyTuple_CheckExact(__pyx_v_intersections)) { - __pyx_t_3 = __pyx_v_intersections; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_intersections; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1720, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1809, __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, 1809, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 1720, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1809, __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_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1720, __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, 1809, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 1720, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1809, __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_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1720, __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, 1809, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); #endif } } else { - __pyx_t_1 = __pyx_t_12(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __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, 1720, __pyx_L1_error) + else __PYX_ERR(0, 1809, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_10); } - __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_10); + __pyx_t_10 = 0; - /* "collisions.py":1721 + /* "collisions.py":1810 * 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_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_v_pt); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1721, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1721, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_pt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1810, __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, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __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":1722 + /* "collisions.py":1811 * for pt in intersections: * p = Point(*pt) * if self._collides(p) and othershape._collides(p): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1722, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = 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); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_p}; - __pyx_t_9 = __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_9)) __PYX_ERR(0, 1722, __pyx_L1_error) + 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, 1811, __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_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1722, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1811, __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_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1722, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = 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); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_p}; - __pyx_t_9 = __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_9)) __PYX_ERR(0, 1722, __pyx_L1_error) + 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, 1811, __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_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1722, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1811, __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":1723 + /* "collisions.py":1812 * p = Point(*pt) * if self._collides(p) and othershape._collides(p): * return True # <<<<<<<<<<<<<< @@ -56150,10 +59272,10 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1722 + /* "collisions.py":1811 * for pt in intersections: * p = Point(*pt) * if self._collides(p) and othershape._collides(p): # <<<<<<<<<<<<<< @@ -56162,17 +59284,17 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1720 - * if checkShpType(othershape, Arc): + /* "collisions.py":1809 + * if checkShpType(othershape, ShpTyps.Arc): * 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): */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1724 + /* "collisions.py":1813 * if self._collides(p) and othershape._collides(p): * return True * return False # <<<<<<<<<<<<<< @@ -56184,16 +59306,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1718 + /* "collisions.py":1807 * return True * return False - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: */ } - /* "collisions.py":1725 + /* "collisions.py":1814 * return True * return False * return othershape._collides(self) # <<<<<<<<<<<<<< @@ -56201,16 +59323,16 @@ 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, 1725, __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, 1814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = NULL; + __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { + __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_10); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; @@ -56218,22 +59340,22 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_self}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 1814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1703 + /* "collisions.py":1792 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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): */ @@ -56254,14 +59376,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_v_intersections); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XDECREF(__pyx_v_p); - __Pyx_XDECREF(__pyx_gb_10collisions_3Arc_9_collides_2generator6); + __Pyx_XDECREF(__pyx_gb_10collisions_3Arc_9_collides_2generator7); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1727 +/* "collisions.py":1816 * return othershape._collides(self) * * def flip(self): # <<<<<<<<<<<<<< @@ -56323,12 +59445,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1727, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1816, __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, 1727, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "flip") < 0)) __PYX_ERR(0, 1816, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -56339,7 +59461,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, 1727, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("flip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1816, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -56376,23 +59498,23 @@ static PyObject *__pyx_pf_10collisions_3Arc_6flip(CYTHON_UNUSED PyObject *__pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 1); - /* "collisions.py":1731 + /* "collisions.py":1820 * 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 _where(self, othershape: Shape) -> Iterable[pointLike]: + * 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, 1731, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __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, 1731, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __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, 1731, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_1) < 0) __PYX_ERR(0, 1820, __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, 1731, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_2) < 0) __PYX_ERR(0, 1820, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1727 + /* "collisions.py":1816 * return othershape._collides(self) * * def flip(self): # <<<<<<<<<<<<<< @@ -56414,24 +59536,175 @@ static PyObject *__pyx_pf_10collisions_3Arc_6flip(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "collisions.py":1733 +/* "collisions.py":1822 + * self.startAng, self.endAng = self.endAng, self.startAng + * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * return False + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_3Arc_9_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_3Arc_9_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_9_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_3Arc_9_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_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, 1822, __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, 1822, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 1822, __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, 1822, __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("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1822, __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.Arc._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_3Arc_8_contains(__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; +} + +static PyObject *__pyx_pf_10collisions_3Arc_8_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":1823 + * + * def _contains(self, othershape: Shape) -> bool: + * return False # <<<<<<<<<<<<<< + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "collisions.py":1822 * self.startAng, self.endAng = self.endAng, self.startAng * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * return False + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1825 + * return False + * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_9_where(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_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_3Arc_9_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_9_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_3Arc_9_where(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_3Arc_11_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_11_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_3Arc_11_where(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -56478,7 +59751,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1733, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1825, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -56486,14 +59759,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1733, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1825, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1733, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1825, __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, 1733, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 1825, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -56506,7 +59779,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, 1733, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1825, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -56520,7 +59793,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_3Arc_8_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_3Arc_10_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -56533,10 +59806,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { +static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { PyObject *__pyx_v_intersections = NULL; - PyObject *__pyx_9genexpr25__pyx_v_pt = NULL; - PyObject *__pyx_9genexpr26__pyx_v_pt = NULL; + PyObject *__pyx_9genexpr27__pyx_v_pt = NULL; + PyObject *__pyx_9genexpr28__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -56556,25 +59829,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":1734 + /* "collisions.py":1826 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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, 1734, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1826, __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, 1734, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1826, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -56582,35 +59858,35 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + 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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1734, __pyx_L1_error) + __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, 1826, __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, 1734, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1735 + /* "collisions.py":1827 * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): + * 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, 1735, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; + __pyx_t_4 = 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)) { + __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; @@ -56618,140 +59894,139 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1827, __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, 1735, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1736 - * if checkShpType(othershape, Point): + /* "collisions.py":1828 + * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): * return [(othershape.x, othershape.y)] # <<<<<<<<<<<<<< * return [] - * if checkShpType(othershape, (Line, Circle)): + * 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, 1736, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1828, __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, 1736, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1736, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1828, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1828, __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, 1736, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1736, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1828, __pyx_L1_error); + __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1735 + /* "collisions.py":1827 * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): # <<<<<<<<<<<<<< * return [(othershape.x, othershape.y)] * return [] */ } - /* "collisions.py":1737 + /* "collisions.py":1829 * if self._collides(othershape): * return [(othershape.x, othershape.y)] * return [] # <<<<<<<<<<<<<< - * if checkShpType(othershape, (Line, Circle)): + * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): * 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, 1737, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1734 + /* "collisions.py":1826 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * if self._collides(othershape): * return [(othershape.x, othershape.y)] */ } - /* "collisions.py":1738 + /* "collisions.py":1830 * return [(othershape.x, othershape.y)] * return [] - * if checkShpType(othershape, (Line, Circle)): # <<<<<<<<<<<<<< + * 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_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1738, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __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, 1830, __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, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1738, __pyx_L1_error) + __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, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1738, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 1738, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(0, 1738, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = 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_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 (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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_v_othershape, __pyx_t_3, __pyx_t_7}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __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, 1738, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1830, __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1738, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1739 + /* "collisions.py":1831 * return [] - * if checkShpType(othershape, (Line, Circle)): + * 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, Arc): + * if checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1739, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1739, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1739, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1831, __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, 1831, __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, 1739, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -56768,27 +60043,27 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_4, __pyx_t_1, __pyx_t_8}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_3, __pyx_t_1, __pyx_t_8}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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_3)) __PYX_ERR(0, 1739, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1831, __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_3, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1739, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __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 (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_3)) { + __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_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; @@ -56796,35 +60071,35 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1739, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1831, __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":1740 - * if checkShpType(othershape, (Line, Circle)): + /* "collisions.py":1832 + * 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, Arc): + * if checkShpType(othershape, ShpTyps.Arc): * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1740, __pyx_L8_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1832, __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, 1740, __pyx_L8_error) + __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1832, __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, 1740, __pyx_L8_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1832, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_11)) { @@ -56832,63 +60107,63 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py { 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, 1740, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1832, __pyx_L8_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_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1740, __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, 1832, __pyx_L8_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1740, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1832, __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, 1740, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1832, __pyx_L8_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_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1740, __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, 1832, __pyx_L8_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1740, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1832, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_4); #endif } } else { - __pyx_t_3 = __pyx_t_11(__pyx_t_7); - if (unlikely(!__pyx_t_3)) { + __pyx_t_4 = __pyx_t_11(__pyx_t_7); + 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, 1740, __pyx_L8_error) + else __PYX_ERR(0, 1832, __pyx_L8_error) } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_pt, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1740, __pyx_L8_error) + __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, 1832, __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, 1740, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_9genexpr25__pyx_v_pt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1740, __pyx_L8_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, 1740, __pyx_L8_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_9genexpr27__pyx_v_pt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1832, __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, 1832, __pyx_L8_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_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_4 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_4)) { + __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_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; @@ -56896,25 +60171,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9}; - __pyx_t_3 = __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; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9}; + __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_3)) __PYX_ERR(0, 1740, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1832, __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_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1740, __pyx_L8_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, 1832, __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_9genexpr25__pyx_v_pt))) __PYX_ERR(0, 1740, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_pt))) __PYX_ERR(0, 1832, __pyx_L8_error) } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_pt); __pyx_9genexpr25__pyx_v_pt = 0; + __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_pt); __pyx_9genexpr27__pyx_v_pt = 0; goto __pyx_L13_exit_scope; __pyx_L8_error:; - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_pt); __pyx_9genexpr25__pyx_v_pt = 0; + __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_pt); __pyx_9genexpr27__pyx_v_pt = 0; goto __pyx_L1_error; __pyx_L13_exit_scope:; } /* exit inner scope */ @@ -56922,34 +60197,37 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1738 + /* "collisions.py":1830 * return [(othershape.x, othershape.y)] * return [] - * if checkShpType(othershape, (Line, Circle)): # <<<<<<<<<<<<<< + * 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))] */ } - /* "collisions.py":1741 + /* "collisions.py":1833 * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * return [pt for pt in intersections if self._collides(Point(*pt))] - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * 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, 1741, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1741, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1833, __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, 1833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { + __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_8); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; @@ -56957,88 +60235,88 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __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_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1741, __pyx_L1_error) + __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, 1833, __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, 1741, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1742 + /* "collisions.py":1834 * return [pt for pt in intersections if self._collides(Point(*pt))] - * if checkShpType(othershape, Arc): + * 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_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1742, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1742, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __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, 1834, __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, 1834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + 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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_8, __pyx_t_9, __pyx_t_4}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_4, __pyx_t_9, __pyx_t_3}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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, 1834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1834, __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 CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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, 1742, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1834, __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_v_intersections = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1743 - * if checkShpType(othershape, Arc): + /* "collisions.py":1835 + * 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) @@ -57046,148 +60324,148 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1743, __pyx_L17_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1835, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_intersections)) || PyTuple_CheckExact(__pyx_v_intersections)) { - __pyx_t_3 = __pyx_v_intersections; __Pyx_INCREF(__pyx_t_3); + __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_3 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1743, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1743, __pyx_L17_error) + __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1835, __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, 1835, __pyx_L17_error) } for (;;) { if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 1743, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1835, __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_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1743, __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, 1835, __pyx_L17_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1743, __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, 1835, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 1743, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1835, __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_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1743, __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, 1835, __pyx_L17_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1743, __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, 1835, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { - __pyx_t_7 = __pyx_t_11(__pyx_t_3); + __pyx_t_7 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1743, __pyx_L17_error) + else __PYX_ERR(0, 1835, __pyx_L17_error) } break; } __Pyx_GOTREF(__pyx_t_7); } - __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_pt, __pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_pt, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1743, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1743, __pyx_L17_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1835, __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, 1835, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_9genexpr26__pyx_v_pt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1743, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1743, __pyx_L17_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_9genexpr28__pyx_v_pt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1835, __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, 1835, __pyx_L17_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_t_8 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = 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); + 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_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1}; - __pyx_t_7 = __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; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1}; + __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, 1743, __pyx_L17_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1835, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 1743, __pyx_L17_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1835, __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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1743, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1743, __pyx_L17_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1835, __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, 1835, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_9genexpr26__pyx_v_pt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1743, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1743, __pyx_L17_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_9genexpr28__pyx_v_pt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1835, __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, 1835, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = 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); + 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_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; - __pyx_t_7 = __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; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9}; + __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, 1743, __pyx_L17_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1835, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 1743, __pyx_L17_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1835, __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_9genexpr26__pyx_v_pt))) __PYX_ERR(0, 1743, __pyx_L17_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_pt))) __PYX_ERR(0, 1835, __pyx_L17_error) } } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_pt); __pyx_9genexpr26__pyx_v_pt = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_pt); __pyx_9genexpr28__pyx_v_pt = 0; goto __pyx_L24_exit_scope; __pyx_L17_error:; - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_pt); __pyx_9genexpr26__pyx_v_pt = 0; + __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_pt); __pyx_9genexpr28__pyx_v_pt = 0; goto __pyx_L1_error; __pyx_L24_exit_scope:; } /* exit inner scope */ @@ -57195,16 +60473,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1741 + /* "collisions.py":1833 * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * return [pt for pt in intersections if self._collides(Point(*pt))] - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * 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))] */ } - /* "collisions.py":1744 + /* "collisions.py":1836 * 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) # <<<<<<<<<<<<<< @@ -57212,39 +60490,39 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> 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, 1744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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(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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_self}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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, 1744, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1836, __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_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1733 - * self.startAng, self.endAng = self.endAng, self.startAng + /* "collisions.py":1825 + * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): */ @@ -57261,14 +60539,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_intersections); - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_pt); - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_pt); + __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_pt); + __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1746 +/* "collisions.py":1838 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -57277,16 +60555,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_where(CYTHON_UNUSED PyObject *__py */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_11closestPointTo(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_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_3Arc_10closestPointTo, "\n Finds the closest point ON THIS OBJECT **TO** the other object\n\n Args:\n othershape (Shape): The other shape to find the closest point to\n returnAll (bool, optional): Whether to return *all* the potential closest points sorted in order of closeness or just **the** closest. Defaults to False (only the closest).\n\n Returns:\n 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.\n "); -static PyMethodDef __pyx_mdef_10collisions_3Arc_11closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_11closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_10closestPointTo}; -static PyObject *__pyx_pw_10collisions_3Arc_11closestPointTo(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_3Arc_12closestPointTo, "\n Finds the closest point ON THIS OBJECT **TO** the other object\n\n Args:\n othershape (Shape): The other shape to find the closest point to\n returnAll (bool, optional): Whether to return *all* the potential closest points sorted in order of closeness or just **the** closest. Defaults to False (only the closest).\n\n Returns:\n 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.\n "); +static PyMethodDef __pyx_mdef_10collisions_3Arc_13closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_13closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_12closestPointTo}; +static PyObject *__pyx_pw_10collisions_3Arc_13closestPointTo(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -57337,7 +60615,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1746, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1838, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -57345,21 +60623,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1746, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1838, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1746, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1838, __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, 1746, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1838, __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, 1746, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 1838, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -57377,7 +60655,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, 1746, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1838, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -57391,7 +60669,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_3Arc_10closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); + __pyx_r = __pyx_pf_10collisions_3Arc_12closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); /* function exit code */ { @@ -57404,7 +60682,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1773 +/* "collisions.py":1865 * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): * def checkP(p, this): # <<<<<<<<<<<<<< @@ -57468,7 +60746,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1773, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1865, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -57476,14 +60754,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1773, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1865, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("checkP", 1, 2, 2, 1); __PYX_ERR(0, 1773, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkP", 1, 2, 2, 1); __PYX_ERR(0, 1865, __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, 1773, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "checkP") < 0)) __PYX_ERR(0, 1865, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -57496,7 +60774,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, 1773, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkP", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1865, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -57524,8 +60802,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_13_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *__pyx_outer_scope; PyObject *__pyx_v_op = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -57541,36 +60819,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_13_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_INCREF(__pyx_v_p); - /* "collisions.py":1774 + /* "collisions.py":1866 * 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, 1774, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_this); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1866, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "collisions.py":1775 + /* "collisions.py":1867 * 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, 1775, __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, 1775, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1867, __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, 1867, __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, 1775, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1867, __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, 1775, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1867, __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, 1775, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1867, __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; @@ -57593,14 +60871,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, 1775, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1867, __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":1774 + /* "collisions.py":1866 * if cirO.collides(othershape): * def checkP(p, this): * if not this: # <<<<<<<<<<<<<< @@ -57609,21 +60887,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__ */ } - /* "collisions.py":1776 + /* "collisions.py":1868 * 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, 1776, __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, 1776, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 1868, __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, 1868, __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, 1776, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1868, __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, 1776, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1868, __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, 1776, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1868, __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; @@ -57646,14 +60924,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, 1776, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1868, __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":1777 + /* "collisions.py":1869 * p = self.closestPointTo(Point(*p)) * op = othershape.closestPointTo(Point(*p)) * return (p, (op[0]-p[0])**2+(op[1]-p[1])**2) # <<<<<<<<<<<<<< @@ -57661,45 +60939,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, 1777, __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, 1869, __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, 1777, __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, 1869, __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, 1777, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1869, __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, 1777, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1869, __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, 1777, __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, 1869, __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, 1777, __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, 1869, __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, 1777, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1869, __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, 1777, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1869, __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, 1777, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1869, __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, 1777, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1869, __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, 1777, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p)) __PYX_ERR(0, 1869, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 1777, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 1869, __pyx_L1_error); __pyx_t_6 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1773 + /* "collisions.py":1865 * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): * def checkP(p, this): # <<<<<<<<<<<<<< @@ -57724,7 +61002,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__ return __pyx_r; } -/* "collisions.py":1785 +/* "collisions.py":1877 * checkP(i, False) for i in cirO.whereCollides(othershape) * ] * alls.sort(key=lambda i: i[1]) # <<<<<<<<<<<<<< @@ -57733,15 +61011,15 @@ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_14closestPointTo_2lambda17(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_14closestPointTo_2lambda18(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_3Arc_14closestPointTo_2lambda17 = {"lambda17", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_14closestPointTo_2lambda17, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_3Arc_14closestPointTo_2lambda17(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_3Arc_14closestPointTo_2lambda18 = {"lambda18", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_14closestPointTo_2lambda18, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_3Arc_14closestPointTo_2lambda18(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -57759,7 +61037,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda17 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda18 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -57785,12 +61063,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1785, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1877, __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, "lambda17") < 0)) __PYX_ERR(0, 1785, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda18") < 0)) __PYX_ERR(0, 1877, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -57801,7 +61079,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda17", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1785, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda18", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1877, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -57811,11 +61089,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Arc.closestPointTo.lambda17", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Arc.closestPointTo.lambda18", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda17(__pyx_self, __pyx_v_i); + __pyx_r = __pyx_lambda_funcdef_lambda18(__pyx_self, __pyx_v_i); /* function exit code */ { @@ -57828,16 +61106,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda17(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_lambda_funcdef_lambda18(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_i) { 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("lambda17", 1); + __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, 1785, __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, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -57846,7 +61124,7 @@ static PyObject *__pyx_lambda_funcdef_lambda17(CYTHON_UNUSED PyObject *__pyx_sel /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Arc.closestPointTo.lambda17", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Arc.closestPointTo.lambda18", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -57854,7 +61132,7 @@ static PyObject *__pyx_lambda_funcdef_lambda17(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":1823 +/* "collisions.py":1915 * d = (cp[0]-ocp[0])**2+(cp[1]-ocp[1])**2 * closests.append((cp, d)) * closests.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< @@ -57863,15 +61141,15 @@ static PyObject *__pyx_lambda_funcdef_lambda17(CYTHON_UNUSED PyObject *__pyx_sel */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_14closestPointTo_3lambda18(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_14closestPointTo_3lambda19(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_3Arc_14closestPointTo_3lambda18 = {"lambda18", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_14closestPointTo_3lambda18, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_3Arc_14closestPointTo_3lambda18(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_3Arc_14closestPointTo_3lambda19 = {"lambda19", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_14closestPointTo_3lambda19, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_3Arc_14closestPointTo_3lambda19(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -57889,7 +61167,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda18 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda19 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -57915,12 +61193,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1823, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1915, __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, 1823, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda19") < 0)) __PYX_ERR(0, 1915, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -57931,7 +61209,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, 1823, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda19", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1915, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -57941,11 +61219,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Arc.closestPointTo.lambda18", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Arc.closestPointTo.lambda19", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda18(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda19(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -57958,16 +61236,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda18(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_lambda_funcdef_lambda19(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("lambda18", 1); + __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, 1823, __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, 1915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -57976,7 +61254,7 @@ static PyObject *__pyx_lambda_funcdef_lambda18(CYTHON_UNUSED PyObject *__pyx_sel /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Arc.closestPointTo.lambda18", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Arc.closestPointTo.lambda19", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -57984,7 +61262,7 @@ static PyObject *__pyx_lambda_funcdef_lambda18(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":1746 +/* "collisions.py":1838 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -57992,8 +61270,8 @@ static PyObject *__pyx_lambda_funcdef_lambda18(CYTHON_UNUSED PyObject *__pyx_sel * Finds the closest point ON THIS OBJECT **TO** the other object */ -static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { - struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *__pyx_cur_scope; +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; PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_phi = NULL; @@ -58009,11 +61287,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_v_cp = NULL; PyObject *__pyx_v_ocp = NULL; PyObject *__pyx_v_d = NULL; - PyObject *__pyx_9genexpr27__pyx_v_i = NULL; - PyObject *__pyx_9genexpr28__pyx_v_i = NULL; PyObject *__pyx_9genexpr29__pyx_v_i = NULL; PyObject *__pyx_9genexpr30__pyx_v_i = NULL; PyObject *__pyx_9genexpr31__pyx_v_i = NULL; + PyObject *__pyx_9genexpr32__pyx_v_i = NULL; + PyObject *__pyx_9genexpr33__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -58032,11 +61310,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(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_13_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_13_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1746, __pyx_L1_error) + __PYX_ERR(0, 1838, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -58047,25 +61325,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_cur_scope->__pyx_v_othershape); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_othershape); - /* "collisions.py":1757 + /* "collisions.py":1849 * 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, Point): # <<<<<<<<<<<<<< + * 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, 1757, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1849, __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, 1757, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -58073,63 +61354,63 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __pyx_L1_error) + __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, 1849, __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, 1757, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1758 + /* "collisions.py":1850 * """ - * if checkShpType(othershape, Point): + * 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, 1758, __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, 1850, __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, 1758, __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, 1850, __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, 1758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1850, __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, 1758, __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, 1850, __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, 1758, __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, 1850, __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, 1758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1850, __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_3; - __pyx_t_3 = 0; - __pyx_v_y = __pyx_t_4; + __pyx_v_x = __pyx_t_4; __pyx_t_4 = 0; + __pyx_v_y = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1761 + /* "collisions.py":1853 * #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_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_constrainAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1761, __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, 1761, __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, 1853, __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, 1853, __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, 1761, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1853, __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, 1761, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1853, __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, 1761, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atan2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -58150,7 +61431,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(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, 1761, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -58173,50 +61454,50 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(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, 1761, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1853, __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_7 = PyMethod_GET_SELF(__pyx_t_3); + 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_3); + 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_7, __pyx_t_1}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_4)) __PYX_ERR(0, 1761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_v_phi = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_phi = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1763 + /* "collisions.py":1855 * 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_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1763, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1855, __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, 1855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS @@ -58232,39 +61513,39 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_v_angle = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_angle = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1765 + /* "collisions.py":1857 * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __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, 1857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1765, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1857, __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, 1857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __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_7))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_3)) { + __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_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; @@ -58272,48 +61553,48 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_angle}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1765, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __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, 1765, __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, 1857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1857, __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_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1765, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __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":1766 + /* "collisions.py":1858 * * 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, 1766, __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, 1858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1858, __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, 1858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = 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_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { + __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_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -58321,62 +61602,62 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_angle}; - __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, 1766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 1858, __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, 1766, __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, 1858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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, 1858, __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_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_qy = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1767 + /* "collisions.py":1859 * 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, 1767, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1859, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1768 + /* "collisions.py":1860 * qy = self.y + math.cos(angle) * self.r * if returnAll: * return [[qx, qy]] # <<<<<<<<<<<<<< * return qx, qy - * elif checkShpType(othershape, Line): + * elif checkShpType(othershape, ShpTyps.Line): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1860, __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, 1768, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_qx)) __PYX_ERR(0, 1860, __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, 1768, __pyx_L1_error); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1768, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_qy)) __PYX_ERR(0, 1860, __pyx_L1_error); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1860, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1767 + /* "collisions.py":1859 * qx = self.x - math.sin(angle) * self.r * qy = self.y + math.cos(angle) * self.r * if returnAll: # <<<<<<<<<<<<<< @@ -58385,54 +61666,57 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1769 + /* "collisions.py":1861 * if returnAll: * return [[qx, qy]] * return qx, qy # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Line): + * elif checkShpType(othershape, ShpTyps.Line): * cirO = Circle(self.x, self.y, self.r) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1769, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1861, __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_4, 0, __pyx_v_qx)) __PYX_ERR(0, 1769, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_qx)) __PYX_ERR(0, 1861, __pyx_L1_error); __Pyx_INCREF(__pyx_v_qy); __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_qy)) __PYX_ERR(0, 1769, __pyx_L1_error); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_qy)) __PYX_ERR(0, 1861, __pyx_L1_error); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1757 + /* "collisions.py":1849 * 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, Point): # <<<<<<<<<<<<<< + * 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":1770 + /* "collisions.py":1862 * return [[qx, qy]] * return qx, qy - * elif checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * 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, 1770, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1770, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { + __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_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -58440,32 +61724,32 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_4}; + __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, 1862, __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_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1770, __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, 1862, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":1771 + /* "collisions.py":1863 * return qx, qy - * elif checkShpType(othershape, Line): + * 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, 1771, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1771, __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, 1863, __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, 1863, __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, 1771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1771, __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, 1863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -58482,27 +61766,27 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_7, __pyx_t_3, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_4, __pyx_t_7, __pyx_t_2}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_v_cirO = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_cirO = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1772 - * elif checkShpType(othershape, Line): + /* "collisions.py":1864 + * 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, 1772, __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, 1864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -58520,29 +61804,29 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_othershape}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_4)) __PYX_ERR(0, 1772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1864, __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_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1772, __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, 1864, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":1773 + /* "collisions.py":1865 * 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_4 = __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__19)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_checkP = __pyx_t_4; - __pyx_t_4 = 0; + __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, 1865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_checkP = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1782 + /* "collisions.py":1874 * ] + [ * checkP(i, False) for i in othershape.toPoints() * ] + [ # <<<<<<<<<<<<<< @@ -58551,33 +61835,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ { /* enter inner scope */ - /* "collisions.py":1778 + /* "collisions.py":1870 * 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_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1778, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1870, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); - /* "collisions.py":1779 + /* "collisions.py":1871 * 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, 1779, __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, 1871, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; + __pyx_t_7 = 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)) { + __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_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; @@ -58585,10 +61869,10 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1779, __pyx_L8_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1871, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -58597,9 +61881,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(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, 1779, __pyx_L8_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1871, __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, 1779, __pyx_L8_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1871, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -58608,28 +61892,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(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, 1779, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1871, __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, 1779, __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, 1871, __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, 1779, __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, 1871, __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, 1779, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1871, __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, 1779, __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, 1871, __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, 1779, __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, 1871, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -58639,179 +61923,179 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(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, 1779, __pyx_L8_error) + else __PYX_ERR(0, 1871, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_i, __pyx_t_1); + __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_9genexpr27__pyx_v_i, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1779, __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, 1871, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1778, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1870, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_i); __pyx_9genexpr27__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_i); __pyx_9genexpr29__pyx_v_i = 0; goto __pyx_L12_exit_scope; __pyx_L8_error:; - __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_i); __pyx_9genexpr27__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_i); __pyx_9genexpr29__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ { /* enter inner scope */ - /* "collisions.py":1780 + /* "collisions.py":1872 * 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, 1780, __pyx_L15_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1872, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":1781 + /* "collisions.py":1873 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1781, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1873, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = 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); + if (likely(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_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __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, 1781, __pyx_L15_error) + 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, 1873, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } 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_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __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, 1781, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1781, __pyx_L15_error) + __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1873, __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, 1873, __pyx_L15_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 1781, __pyx_L15_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1873, __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_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1781, __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, 1873, __pyx_L15_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, 1781, __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, 1873, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 1781, __pyx_L15_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1873, __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_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1781, __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, 1873, __pyx_L15_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, 1781, __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, 1873, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_1 = __pyx_t_11(__pyx_t_3); + __pyx_t_1 = __pyx_t_11(__pyx_t_7); 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, 1781, __pyx_L15_error) + else __PYX_ERR(0, 1873, __pyx_L15_error) } break; } __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_i, __pyx_t_1); + __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_9genexpr28__pyx_v_i, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1781, __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, 1873, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1780, __pyx_L15_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1872, __pyx_L15_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_i); __pyx_9genexpr28__pyx_v_i = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_i); __pyx_9genexpr30__pyx_v_i = 0; goto __pyx_L19_exit_scope; __pyx_L15_error:; - __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_i); __pyx_9genexpr28__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_i); __pyx_9genexpr30__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L19_exit_scope:; } /* exit inner scope */ - /* "collisions.py":1780 + /* "collisions.py":1872 * alls = [ * checkP(i, True) for i in self.endPoints() * ] + [ # <<<<<<<<<<<<<< * checkP(i, False) for i in othershape.toPoints() * ] + [ */ - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1872, __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":1782 + /* "collisions.py":1874 * ] + [ * 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, 1782, __pyx_L22_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":1783 + /* "collisions.py":1875 * 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, 1783, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cirO, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = NULL; + __pyx_t_4 = 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)) { + __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_7); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; @@ -58819,128 +62103,128 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape}; - __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; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1783, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_4); + 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, 1875, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_3); __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); + 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_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1783, __pyx_L22_error) + __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __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, 1783, __pyx_L22_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1875, __pyx_L22_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_11)) { 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, 1783, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1875, __pyx_L22_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, 1783, __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, 1875, __pyx_L22_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, 1783, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1875, __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, 1783, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1875, __pyx_L22_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_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1783, __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, 1875, __pyx_L22_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, 1783, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1875, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_3); #endif } } else { - __pyx_t_4 = __pyx_t_11(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __pyx_t_3 = __pyx_t_11(__pyx_t_1); + 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, 1783, __pyx_L22_error) + else __PYX_ERR(0, 1875, __pyx_L22_error) } break; } - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_i, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __pyx_pf_10collisions_3Arc_14closestPointTo_checkP(__pyx_v_checkP, __pyx_9genexpr29__pyx_v_i, Py_False); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1783, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1782, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 1875, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1874, __pyx_L22_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_i); __pyx_9genexpr29__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_i); __pyx_9genexpr31__pyx_v_i = 0; goto __pyx_L26_exit_scope; __pyx_L22_error:; - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_i); __pyx_9genexpr29__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_i); __pyx_9genexpr31__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L26_exit_scope:; } /* exit inner scope */ - /* "collisions.py":1782 + /* "collisions.py":1874 * ] + [ * checkP(i, False) for i in othershape.toPoints() * ] + [ # <<<<<<<<<<<<<< * checkP(i, False) for i in cirO.whereCollides(othershape) * ] */ - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1782, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1874, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_alls = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1785 + /* "collisions.py":1877 * 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, 1785, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_alls, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1785, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_14closestPointTo_2lambda17, 0, __pyx_n_s_Arc_closestPointTo_locals_lambda, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1785, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 1785, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1785, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1877, __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, 1877, __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, 1877, __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1786 + /* "collisions.py":1878 * ] * 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, 1786, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1878, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1787 + /* "collisions.py":1879 * alls.sort(key=lambda i: i[1]) * if returnAll: * return [i[0] for i in alls] # <<<<<<<<<<<<<< @@ -58949,44 +62233,44 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1787, __pyx_L30_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1879, __pyx_L30_error) + __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __pyx_v_alls; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 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, 1787, __pyx_L30_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1879, __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, 1787, __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, 1879, __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, 1787, __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, 1879, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_1); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_i, __pyx_t_1); + __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr30__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1787, __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, 1879, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1787, __pyx_L30_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1879, __pyx_L30_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_i); __pyx_9genexpr30__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_i); __pyx_9genexpr32__pyx_v_i = 0; goto __pyx_L34_exit_scope; __pyx_L30_error:; - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_i); __pyx_9genexpr30__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_i); __pyx_9genexpr32__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L34_exit_scope:; } /* exit inner scope */ - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1786 + /* "collisions.py":1878 * ] * alls.sort(key=lambda i: i[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -58995,25 +62279,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1788 + /* "collisions.py":1880 * if returnAll: * return [i[0] for i in alls] * return alls[0][0] # <<<<<<<<<<<<<< * return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) - * elif checkShpType(othershape, Circle): + * elif checkShpType(othershape, ShpTyps.Circle): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_alls, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1788, __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, 1788, __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, 1880, __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, 1880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1772 - * elif checkShpType(othershape, Line): + /* "collisions.py":1864 + * elif checkShpType(othershape, ShpTyps.Line): * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): # <<<<<<<<<<<<<< * def checkP(p, this): @@ -59021,297 +62305,303 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1789 + /* "collisions.py":1881 * return [i[0] for i in alls] * return alls[0][0] * return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Circle): + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) */ __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, 1789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cirO, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1789, __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, 1881, __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, 1881, __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, 1881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); + 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_7); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __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_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_4)) __PYX_ERR(0, 1789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1789, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_3); 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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1881, __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 (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); + if (likely(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_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_4, __pyx_v_returnAll}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __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_2)) __PYX_ERR(0, 1789, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_returnAll}; + __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, 1881, __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":1770 + /* "collisions.py":1862 * return [[qx, qy]] * return qx, qy - * elif checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): */ } - /* "collisions.py":1790 + /* "collisions.py":1882 * return alls[0][0] * return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) - * elif checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1790, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1882, __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, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1790, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = 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_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); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_4}; + __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, 1790, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 1790, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1791 + /* "collisions.py":1883 * return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) - * elif checkShpType(othershape, Circle): + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): * wheres = self.whereCollides(othershape) */ __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, 1791, __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, 1791, __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, 1883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1791, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1883, __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, 1883, __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, 1791, __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, 1883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + 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_7); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_9}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __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_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1791, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1883, __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_t_7 = NULL; + __pyx_t_3 = 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); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_4, __pyx_v_returnAll}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_v_returnAll}; + __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, 1791, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1790 + /* "collisions.py":1882 * return alls[0][0] * return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) - * elif checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): */ } - /* "collisions.py":1792 - * elif checkShpType(othershape, Circle): + /* "collisions.py":1884 + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * wheres = self.whereCollides(othershape) * if wheres != []: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1792, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Arc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1792, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1884, __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, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = NULL; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1884, __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_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); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __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_2)) __PYX_ERR(0, 1792, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_3}; + __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, 1884, __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, 1792, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1793 + /* "collisions.py":1885 * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): * wheres = self.whereCollides(othershape) # <<<<<<<<<<<<<< * if wheres != []: * if returnAll: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1793, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = 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); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __pyx_L1_error) + 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, 1885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_wheres = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1794 - * elif checkShpType(othershape, Arc): + /* "collisions.py":1886 + * 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, 1794, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_wheres, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __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, 1886, __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, 1794, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1886, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { - /* "collisions.py":1795 + /* "collisions.py":1887 * 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, 1795, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1887, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1796 + /* "collisions.py":1888 * if wheres != []: * if returnAll: * return wheres # <<<<<<<<<<<<<< @@ -59323,7 +62613,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_wheres; goto __pyx_L0; - /* "collisions.py":1795 + /* "collisions.py":1887 * wheres = self.whereCollides(othershape) * if wheres != []: * if returnAll: # <<<<<<<<<<<<<< @@ -59332,7 +62622,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1797 + /* "collisions.py":1889 * if returnAll: * return wheres * return wheres[0] # <<<<<<<<<<<<<< @@ -59340,14 +62630,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj * phi = (math.degrees(math.atan2(y, x))) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __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, 1889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1794 - * elif checkShpType(othershape, Arc): + /* "collisions.py":1886 + * elif checkShpType(othershape, ShpTyps.Arc): * wheres = self.whereCollides(othershape) * if wheres != []: # <<<<<<<<<<<<<< * if returnAll: @@ -59355,49 +62645,49 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1798 + /* "collisions.py":1890 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1798, __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, 1890, __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, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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, 1890, __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, 1798, __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, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __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_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1798, __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, 1890, __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, 1890, __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_x = __pyx_t_4; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_x = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_y = __pyx_t_4; __pyx_t_4 = 0; - __pyx_v_y = __pyx_t_7; - __pyx_t_7 = 0; - /* "collisions.py":1799 + /* "collisions.py":1891 * 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_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1799, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __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, 1799, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1891, __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, 1891, __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, 1799, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -59416,120 +62706,120 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_y, __pyx_v_x}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __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_4)) __PYX_ERR(0, 1799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1891, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + 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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_3}; + __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1891, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_v_phi = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_phi = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1800 + /* "collisions.py":1892 * 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_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1800, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1800, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1892, __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, 1892, __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, 1800, __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, 1892, __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, 1800, __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, 1892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + 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_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_9, __pyx_t_2, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __pyx_t_7 = __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_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_3)) __PYX_ERR(0, 1800, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1892, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1800, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1892, __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 (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); + 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_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_othershape}; - __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; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1800, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + 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, 1892, __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_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1800, __pyx_L1_error) - __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, 1892, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1801 + /* "collisions.py":1893 * 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_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_4); + __pyx_t_4 = 0; - /* "collisions.py":1800 + /* "collisions.py":1892 * 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): # <<<<<<<<<<<<<< @@ -59538,21 +62828,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1802 + /* "collisions.py":1894 * 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_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1802, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 1802, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1894, __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, 1894, __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, 1802, __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, 1894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -59570,177 +62860,177 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_4)) __PYX_ERR(0, 1802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1894, __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_4, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __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, 1894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = 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_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 (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1}; - __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; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1}; + __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_7)) __PYX_ERR(0, 1802, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_v_angle = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_angle = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1804 + /* "collisions.py":1896 * 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1804, __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, 1896, __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, 1896, __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, 1896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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 (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_angle}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_3)) __PYX_ERR(0, 1804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1804, __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, 1804, __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, 1896, __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, 1896, __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, 1896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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, 1804, __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_qx = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_qx = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1805 + /* "collisions.py":1897 * * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1805, __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, 1897, __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, 1897, __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, 1805, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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_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); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_angle}; - __pyx_t_1 = __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_1)) __PYX_ERR(0, 1805, __pyx_L1_error) + 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, 1897, __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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1805, __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, 1897, __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, 1897, __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, 1897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1805, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_qy = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_qy = __pyx_t_7; + __pyx_t_7 = 0; - /* "collisions.py":1807 + /* "collisions.py":1899 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Subtract(__pyx_v_qx, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1807, __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, 1899, __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_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Subtract(__pyx_v_qy, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1807, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_v_qx, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_7); - __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_y, __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, 1899, __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, 1899, __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); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":1808 + /* "collisions.py":1900 * * 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_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1808, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1900, __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, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1808, __pyx_L1_error) + __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, 1900, __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, 1808, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -59759,54 +63049,54 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_y, __pyx_v_x}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __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_7)) __PYX_ERR(0, 1808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __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 (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; + __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, 1900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_4, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyInt_RemainderObjC(__pyx_t_3, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1900, __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":1809 + /* "collisions.py":1901 * 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_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1809, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __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, 1901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_radians); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 1809, __pyx_L1_error) + __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, 1901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_5 = 0; @@ -59824,150 +63114,150 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_phi}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_4)) __PYX_ERR(0, 1809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __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_4, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1809, __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, 1901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = 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_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); + 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_7, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_3 = __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; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; + __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_3)) __PYX_ERR(0, 1809, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1901, __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_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_angle, __pyx_t_7); + __pyx_t_7 = 0; - /* "collisions.py":1811 + /* "collisions.py":1903 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __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, 1811, __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, 1903, __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, 1903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1903, __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_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + 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_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_angle}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_7)) __PYX_ERR(0, 1811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1811, __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, 1811, __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, 1903, __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, 1903, __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_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __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, 1903, __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_4); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_qx, __pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":1812 + /* "collisions.py":1904 * * qx = self.x - math.sin(angle) * self.r * qy = self.y + math.cos(angle) * self.r # <<<<<<<<<<<<<< * if returnAll: * return [[qx, qy]] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1812, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1812, __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, 1904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1812, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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_7))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_3); + 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_7, 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_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, 1812, __pyx_L1_error) + 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, 1904, __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_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1812, __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, 1904, __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, 1904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1812, __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; - __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1812, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __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, 1904, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_qy, __pyx_t_7); - __pyx_t_7 = 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":1813 + /* "collisions.py":1905 * 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, 1813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1905, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1814 + /* "collisions.py":1906 * qy = self.y + math.cos(angle) * self.r * if returnAll: * return [[qx, qy]] # <<<<<<<<<<<<<< @@ -59975,24 +63265,24 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj * else: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1906, __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_7, 0, __pyx_v_qx)) __PYX_ERR(0, 1814, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_qx)) __PYX_ERR(0, 1906, __pyx_L1_error); __Pyx_INCREF(__pyx_v_qy); __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_qy)) __PYX_ERR(0, 1814, __pyx_L1_error); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 1814, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_qy)) __PYX_ERR(0, 1906, __pyx_L1_error); + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1906, __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, 1906, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_r = __pyx_t_7; __pyx_t_7 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1813 + /* "collisions.py":1905 * qx = self.x - math.sin(angle) * self.r * qy = self.y + math.cos(angle) * self.r * if returnAll: # <<<<<<<<<<<<<< @@ -60001,7 +63291,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1815 + /* "collisions.py":1907 * if returnAll: * return [[qx, qy]] * return qx, qy # <<<<<<<<<<<<<< @@ -60009,28 +63299,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj * closests = [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1815, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1907, __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_3, 0, __pyx_v_qx)) __PYX_ERR(0, 1815, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_qx)) __PYX_ERR(0, 1907, __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, 1815, __pyx_L1_error); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_qy)) __PYX_ERR(0, 1907, __pyx_L1_error); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1792 - * elif checkShpType(othershape, Circle): + /* "collisions.py":1884 + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * wheres = self.whereCollides(othershape) * if wheres != []: */ } - /* "collisions.py":1817 + /* "collisions.py":1909 * return qx, qy * else: * closests = [] # <<<<<<<<<<<<<< @@ -60038,230 +63328,230 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj * cp = self.closestPointTo(ln) */ /*else*/ { - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_closests = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_closests = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; - /* "collisions.py":1818 + /* "collisions.py":1910 * else: * closests = [] * for ln in othershape.toLines(): # <<<<<<<<<<<<<< * cp = self.closestPointTo(ln) * ocp = othershape.closestPointTo(Point(*cp)) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1910, __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_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); + 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_7, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + 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, 1910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); + if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1818, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1910, __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, 1910, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_7))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + 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, 1818, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1910, __pyx_L1_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_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1818, __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, 1910, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); + 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, 1818, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1910, __pyx_L1_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_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1818, __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, 1910, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif } } else { - __pyx_t_3 = __pyx_t_11(__pyx_t_7); - if (unlikely(!__pyx_t_3)) { + __pyx_t_7 = __pyx_t_11(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1818, __pyx_L1_error) + else __PYX_ERR(0, 1910, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_7); + __pyx_t_7 = 0; - /* "collisions.py":1819 + /* "collisions.py":1911 * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1911, __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_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + 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_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_ln}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_3)) __PYX_ERR(0, 1819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1911, __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_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_cp, __pyx_t_7); + __pyx_t_7 = 0; - /* "collisions.py":1820 + /* "collisions.py":1912 * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1820, __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, 1820, __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, 1912, __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, 1912, __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, 1820, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_cp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1912, __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, 1820, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1912, __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; __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(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_3)) __PYX_ERR(0, 1820, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1912, __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_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_ocp, __pyx_t_7); + __pyx_t_7 = 0; - /* "collisions.py":1821 + /* "collisions.py":1913 * 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_3 = __Pyx_GetItemInt(__pyx_v_cp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1821, __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, 1913, __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, 1913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ocp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1821, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1913, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1913, __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, 1821, __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, 1913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_ocp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1821, __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, 1913, __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, 1913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 1821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __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, 1821, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1913, __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_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1822 + /* "collisions.py":1914 * 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, 1822, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __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, 1822, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cp)) __PYX_ERR(0, 1914, __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, 1822, __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, 1822, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_d)) __PYX_ERR(0, 1914, __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, 1914, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1818 + /* "collisions.py":1910 * else: * closests = [] * for ln in othershape.toLines(): # <<<<<<<<<<<<<< @@ -60269,40 +63559,40 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj * ocp = othershape.closestPointTo(Point(*cp)) */ } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1823 + /* "collisions.py":1915 * 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_closests, __pyx_n_s_sort); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_closests, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_14closestPointTo_3lambda18, 0, __pyx_n_s_Arc_closestPointTo_locals_lambda, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1823, __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, 1823, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 1915, __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, 1915, __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, 1915, __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1824 + /* "collisions.py":1916 * 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, 1824, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1916, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1825 + /* "collisions.py":1917 * closests.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in closests] # <<<<<<<<<<<<<< @@ -60311,44 +63601,44 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1825, __pyx_L45_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1917, __pyx_L45_error) + __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_v_closests; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 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, 1825, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1917, __pyx_L45_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_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1825, __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, 1917, __pyx_L45_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1825, __pyx_L45_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1917, __pyx_L45_error) + __Pyx_GOTREF(__pyx_t_4); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_i, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr31__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1825, __pyx_L45_error) - __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1825, __pyx_L45_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __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, 1917, __pyx_L45_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1917, __pyx_L45_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_i); __pyx_9genexpr31__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_i); __pyx_9genexpr33__pyx_v_i = 0; goto __pyx_L49_exit_scope; __pyx_L45_error:; - __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_i); __pyx_9genexpr31__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_i); __pyx_9genexpr33__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L49_exit_scope:; } /* exit inner scope */ - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1824 + /* "collisions.py":1916 * closests.append((cp, d)) * closests.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -60357,7 +63647,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1826 + /* "collisions.py":1918 * if returnAll: * return [i[0] for i in closests] * return closests[0][0] # <<<<<<<<<<<<<< @@ -60365,17 +63655,17 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj * def constrainAng(self, phi: Number) -> Number: */ __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, 1826, __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, 1826, __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, 1918, __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, 1918, __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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } - /* "collisions.py":1746 + /* "collisions.py":1838 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -60410,18 +63700,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj __Pyx_XDECREF(__pyx_v_cp); __Pyx_XDECREF(__pyx_v_ocp); __Pyx_XDECREF(__pyx_v_d); - __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_i); __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_i); __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_i); __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_i); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1828 +/* "collisions.py":1920 * return closests[0][0] * * def constrainAng(self, phi: Number) -> Number: # <<<<<<<<<<<<<< @@ -60430,15 +63720,15 @@ static PyObject *__pyx_pf_10collisions_3Arc_10closestPointTo(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_13constrainAng(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_15constrainAng(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_3Arc_13constrainAng = {"constrainAng", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_13constrainAng, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_3Arc_13constrainAng(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_3Arc_15constrainAng = {"constrainAng", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_15constrainAng, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_3Arc_15constrainAng(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -60485,7 +63775,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1828, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1920, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -60493,14 +63783,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1828, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1920, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("constrainAng", 1, 2, 2, 1); __PYX_ERR(0, 1828, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("constrainAng", 1, 2, 2, 1); __PYX_ERR(0, 1920, __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, 1828, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "constrainAng") < 0)) __PYX_ERR(0, 1920, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -60513,7 +63803,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, 1828, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("constrainAng", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1920, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -60527,7 +63817,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_3Arc_12constrainAng(__pyx_self, __pyx_v_self, __pyx_v_phi); + __pyx_r = __pyx_pf_10collisions_3Arc_14constrainAng(__pyx_self, __pyx_v_self, __pyx_v_phi); /* function exit code */ { @@ -60540,7 +63830,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1831 +/* "collisions.py":1923 * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * phi = phi % 360 * def angular_distance(a, b): # <<<<<<<<<<<<<< @@ -60604,7 +63894,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1831, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1923, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -60612,14 +63902,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1831, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1923, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("angular_distance", 1, 2, 2, 1); __PYX_ERR(0, 1831, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angular_distance", 1, 2, 2, 1); __PYX_ERR(0, 1923, __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, 1831, __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, 1923, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -60632,7 +63922,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, 1831, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angular_distance", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1923, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -60672,7 +63962,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(CYTH int __pyx_clineno = 0; __Pyx_RefNannySetupContext("angular_distance", 1); - /* "collisions.py":1832 + /* "collisions.py":1924 * phi = phi % 360 * def angular_distance(a, b): * return min(abs(a - b), 360 - abs(a - b)) # <<<<<<<<<<<<<< @@ -60680,21 +63970,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, 1832, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1924, __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, 1832, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1924, __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, 1832, __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, 1924, __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, 1832, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1924, __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, 1832, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1924, __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, 1832, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1832, __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, 1924, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1924, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_1); @@ -60710,7 +64000,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":1831 + /* "collisions.py":1923 * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * phi = phi % 360 * def angular_distance(a, b): # <<<<<<<<<<<<<< @@ -60732,7 +64022,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(CYTH return __pyx_r; } -/* "collisions.py":1828 +/* "collisions.py":1920 * return closests[0][0] * * def constrainAng(self, phi: Number) -> Number: # <<<<<<<<<<<<<< @@ -60740,7 +64030,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(CYTH * phi = phi % 360 */ -static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_phi) { +static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_phi) { PyObject *__pyx_v_angular_distance = 0; PyObject *__pyx_v_dist_to_start = NULL; PyObject *__pyx_v_dist_to_end = NULL; @@ -60757,129 +64047,129 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("constrainAng", 0); __Pyx_INCREF(__pyx_v_phi); - /* "collisions.py":1829 + /* "collisions.py":1921 * * 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, 1829, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1921, __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, 1829, __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, 1921, __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, 1829, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1921, __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, 1829, __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, 1921, __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, 1829, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_2) < 0) __PYX_ERR(0, 1921, __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, 1829, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_3) < 0) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1830 + /* "collisions.py":1922 * 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, 1830, __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, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1831 + /* "collisions.py":1923 * 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__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1831, __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__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_angular_distance = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1833 + /* "collisions.py":1925 * 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, 1833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1925, __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, 1833, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1925, __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, 1833, __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, 1925, __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, 1833, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1925, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "collisions.py":1834 + /* "collisions.py":1926 * 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, 1834, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1926, __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, 1834, __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, 1926, __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, 1834, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1926, __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, 1834, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1926, __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, 1834, __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, 1926, __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, 1834, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1926, __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":1835 + /* "collisions.py":1927 * 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, 1835, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1927, __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, 1835, __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, 1927, __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":1836 + /* "collisions.py":1928 * 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, 1836, __pyx_L1_error) + __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_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, 1836, __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, 1928, __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":1837 + /* "collisions.py":1929 * 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 # <<<<<<<<<<<<<< @@ -60887,16 +64177,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(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, 1837, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1837, __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, 1929, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1929, __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, 1837, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1929, __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, 1837, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; @@ -60905,7 +64195,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1834 + /* "collisions.py":1926 * return min(abs(a - b), 360 - abs(a - b)) * if self.endAng < self.startAng: * if phi < self.startAng and phi > self.endAng: # <<<<<<<<<<<<<< @@ -60914,7 +64204,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1833 + /* "collisions.py":1925 * def angular_distance(a, b): * return min(abs(a - b), 360 - abs(a - b)) * if self.endAng < self.startAng: # <<<<<<<<<<<<<< @@ -60924,7 +64214,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":1839 + /* "collisions.py":1931 * return self.startAng if dist_to_start < dist_to_end else self.endAng * else: * if phi > self.endAng or phi < self.startAng: # <<<<<<<<<<<<<< @@ -60932,70 +64222,70 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(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, 1839, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1931, __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, 1839, __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, 1931, __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, 1839, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1931, __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, 1839, __pyx_L1_error) + __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_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, 1839, __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, 1931, __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, 1839, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1931, __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":1840 + /* "collisions.py":1932 * 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, 1840, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1932, __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, 1840, __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, 1932, __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":1841 + /* "collisions.py":1933 * 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, 1841, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1933, __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, 1841, __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, 1933, __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":1842 + /* "collisions.py":1934 * 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, 1842, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1842, __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, 1934, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1934, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "collisions.py":1843 + /* "collisions.py":1935 * dist_to_end = angular_distance(phi, self.endAng) * if dist_to_start < dist_to_end: * return self.startAng # <<<<<<<<<<<<<< @@ -61003,13 +64293,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(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, 1843, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1842 + /* "collisions.py":1934 * dist_to_start = angular_distance(phi, self.startAng) * dist_to_end = angular_distance(phi, self.endAng) * if dist_to_start < dist_to_end: # <<<<<<<<<<<<<< @@ -61018,7 +64308,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1845 + /* "collisions.py":1937 * return self.startAng * else: * return self.endAng # <<<<<<<<<<<<<< @@ -61027,14 +64317,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(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, 1845, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } - /* "collisions.py":1839 + /* "collisions.py":1931 * return self.startAng if dist_to_start < dist_to_end else self.endAng * else: * if phi > self.endAng or phi < self.startAng: # <<<<<<<<<<<<<< @@ -61045,7 +64335,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObjec } __pyx_L3:; - /* "collisions.py":1846 + /* "collisions.py":1938 * else: * return self.endAng * return phi # <<<<<<<<<<<<<< @@ -61057,7 +64347,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObjec __pyx_r = __pyx_v_phi; goto __pyx_L0; - /* "collisions.py":1828 + /* "collisions.py":1920 * return closests[0][0] * * def constrainAng(self, phi: Number) -> Number: # <<<<<<<<<<<<<< @@ -61082,7 +64372,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":1848 +/* "collisions.py":1940 * return phi * * def angleInRange(self, angle: Number) -> bool: # <<<<<<<<<<<<<< @@ -61091,16 +64381,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng(CYTHON_UNUSED PyObjec */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_15angleInRange(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_17angleInRange(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_3Arc_14angleInRange, "\n Check to see if an angle is in the range of this arc.\n\n Args:\n angle (Number): The angle to check if it is in range of this arc or not.\n\n Returns:\n bool: Whether or not the angle is in the range of this arc.\n "); -static PyMethodDef __pyx_mdef_10collisions_3Arc_15angleInRange = {"angleInRange", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_15angleInRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_14angleInRange}; -static PyObject *__pyx_pw_10collisions_3Arc_15angleInRange(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_3Arc_16angleInRange, "\n Check to see if an angle is in the range of this arc.\n\n Args:\n angle (Number): The angle to check if it is in range of this arc or not.\n\n Returns:\n bool: Whether or not the angle is in the range of this arc.\n "); +static PyMethodDef __pyx_mdef_10collisions_3Arc_17angleInRange = {"angleInRange", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_17angleInRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_16angleInRange}; +static PyObject *__pyx_pw_10collisions_3Arc_17angleInRange(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -61147,7 +64437,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1848, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1940, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -61155,14 +64445,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1848, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1940, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("angleInRange", 1, 2, 2, 1); __PYX_ERR(0, 1848, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angleInRange", 1, 2, 2, 1); __PYX_ERR(0, 1940, __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, 1848, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "angleInRange") < 0)) __PYX_ERR(0, 1940, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -61175,7 +64465,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, 1848, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angleInRange", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1940, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -61189,7 +64479,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_3Arc_14angleInRange(__pyx_self, __pyx_v_self, __pyx_v_angle); + __pyx_r = __pyx_pf_10collisions_3Arc_16angleInRange(__pyx_self, __pyx_v_self, __pyx_v_angle); /* function exit code */ { @@ -61202,7 +64492,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_angle) { +static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_angle) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -61215,47 +64505,47 @@ static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("angleInRange", 1); - /* "collisions.py":1858 + /* "collisions.py":1950 * 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, 1858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1950, __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, 1858, __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, 1950, __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, 1858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1950, __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, 1858, __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, 1950, __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, 1858, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_2) < 0) __PYX_ERR(0, 1950, __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, 1858, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_3) < 0) __PYX_ERR(0, 1950, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1859 + /* "collisions.py":1951 * """ * 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, 1859, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1951, __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, 1859, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1951, __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, 1859, __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, 1951, __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, 1859, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1951, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "collisions.py":1860 + /* "collisions.py":1952 * 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 # <<<<<<<<<<<<<< @@ -61263,14 +64553,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(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, 1860, __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, 1952, __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, 1860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1952, __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, 1860, __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, 1952, __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, 1860, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1952, __pyx_L1_error) if (!__pyx_t_4) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { @@ -61279,11 +64569,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(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, 1860, __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, 1952, __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, 1860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1952, __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, 1860, __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, 1952, __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); @@ -61294,7 +64584,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1859 + /* "collisions.py":1951 * """ * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * if self.startAng > self.endAng: # <<<<<<<<<<<<<< @@ -61303,7 +64593,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1862 + /* "collisions.py":1954 * return angle%360 >= self.startAng or angle%360 <= self.endAng * else: * return self.startAng <= angle%360 <= self.endAng # <<<<<<<<<<<<<< @@ -61312,16 +64602,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(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, 1862, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1954, __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, 1862, __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, 1954, __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, 1862, __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, 1954, __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, 1862, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1954, __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, 1862, __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, 1954, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -61331,7 +64621,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(CYTHON_UNUSED PyObjec goto __pyx_L0; } - /* "collisions.py":1848 + /* "collisions.py":1940 * return phi * * def angleInRange(self, angle: Number) -> bool: # <<<<<<<<<<<<<< @@ -61353,7 +64643,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":1864 +/* "collisions.py":1956 * return self.startAng <= angle%360 <= self.endAng * * def endPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -61362,16 +64652,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_14angleInRange(CYTHON_UNUSED PyObjec */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_17endPoints(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_19endPoints(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_3Arc_16endPoints, "\n Gets the end points of the arc\n\n Returns:\n Iterable[pointLike]: The endpoints of the arc\n "); -static PyMethodDef __pyx_mdef_10collisions_3Arc_17endPoints = {"endPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_17endPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_16endPoints}; -static PyObject *__pyx_pw_10collisions_3Arc_17endPoints(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_3Arc_18endPoints, "\n Gets the end points of the arc\n\n Returns:\n Iterable[pointLike]: The endpoints of the arc\n "); +static PyMethodDef __pyx_mdef_10collisions_3Arc_19endPoints = {"endPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_19endPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_18endPoints}; +static PyObject *__pyx_pw_10collisions_3Arc_19endPoints(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -61415,12 +64705,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1864, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1956, __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, 1864, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "endPoints") < 0)) __PYX_ERR(0, 1956, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -61431,7 +64721,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, 1864, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("endPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1956, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -61445,7 +64735,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_3Arc_16endPoints(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_3Arc_18endPoints(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -61458,7 +64748,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_startAng = NULL; PyObject *__pyx_v_endAng = NULL; PyObject *__pyx_r = NULL; @@ -61476,19 +64766,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("endPoints", 1); - /* "collisions.py":1871 + /* "collisions.py":1963 * 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, 1871, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __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, 1871, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1963, __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, 1871, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -61509,26 +64799,26 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(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, 1871, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1963, __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":1872 + /* "collisions.py":1964 * """ * 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, 1872, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1964, __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, 1872, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1964, __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, 1872, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -61549,14 +64839,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(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, 1872, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1964, __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":1873 + /* "collisions.py":1965 * 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)), \ # <<<<<<<<<<<<<< @@ -61564,13 +64854,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(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, 1873, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -61591,25 +64881,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(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, 1873, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -61630,41 +64920,41 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(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, 1873, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __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_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1873, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 1965, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 1873, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 1965, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; - /* "collisions.py":1874 + /* "collisions.py":1966 * 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, 1874, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -61685,25 +64975,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(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, 1874, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -61724,47 +65014,47 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(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, 1874, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1966, __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, 1874, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 1966, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1966, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_3 = 0; - /* "collisions.py":1873 + /* "collisions.py":1965 * 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, 1873, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1965, __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, 1873, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 1965, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 1873, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 1965, __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":1864 + /* "collisions.py":1956 * return self.startAng <= angle%360 <= self.endAng * * def endPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -61791,7 +65081,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":1876 +/* "collisions.py":1968 * (self.x + self.r * math.cos(endAng), self.y + self.r * math.sin(endAng)) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -61800,16 +65090,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_16endPoints(CYTHON_UNUSED PyObject * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_19rect(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_21rect(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_3Arc_18rect, "\n Returns the rectangle bounding box surrounding this object.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); -static PyMethodDef __pyx_mdef_10collisions_3Arc_19rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_19rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_18rect}; -static PyObject *__pyx_pw_10collisions_3Arc_19rect(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_3Arc_20rect, "\n Returns the rectangle bounding box surrounding this object.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); +static PyMethodDef __pyx_mdef_10collisions_3Arc_21rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_21rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_20rect}; +static PyObject *__pyx_pw_10collisions_3Arc_21rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -61853,12 +65143,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1876, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1968, __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, 1876, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 1968, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -61869,7 +65159,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, 1876, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1968, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -61883,7 +65173,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_3Arc_18rect(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_3Arc_20rect(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -61896,7 +65186,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_eps = NULL; PyObject *__pyx_v_N = NULL; PyObject *__pyx_v_E = NULL; @@ -61915,14 +65205,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":1883 + /* "collisions.py":1975 * 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, 1883, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -61942,21 +65232,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(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, 1883, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1975, __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":1885 + /* "collisions.py":1977 * 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, 1885, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -61976,33 +65266,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(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, 1885, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __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, 1885, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1977, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":1886 + /* "collisions.py":1978 * * 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, 1886, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1978, __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, 1886, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __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, 1886, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1978, __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":1885 + /* "collisions.py":1977 * eps = self.endPoints() * * if self.angleInRange(270): # <<<<<<<<<<<<<< @@ -62012,7 +65302,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":1888 + /* "collisions.py":1980 * N = self.y-self.r * else: * N = min(eps[0][1], eps[1][1]) # <<<<<<<<<<<<<< @@ -62020,18 +65310,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(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, 1888, __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, 1980, __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, 1888, __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, 1980, __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, 1888, __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, 1980, __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, 1888, __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, 1980, __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, 1888, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1888, __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, 1980, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_2); @@ -62050,14 +65340,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx } __pyx_L3:; - /* "collisions.py":1889 + /* "collisions.py":1981 * 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, 1889, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; @@ -62077,33 +65367,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(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, 1889, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1981, __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, 1889, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "collisions.py":1890 + /* "collisions.py":1982 * 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, 1890, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __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, 1890, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __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, 1890, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __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":1889 + /* "collisions.py":1981 * else: * N = min(eps[0][1], eps[1][1]) * if self.angleInRange(180): # <<<<<<<<<<<<<< @@ -62113,7 +65403,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx goto __pyx_L4; } - /* "collisions.py":1892 + /* "collisions.py":1984 * E = self.x-self.r * else: * E = min(eps[0][0], eps[1][0]) # <<<<<<<<<<<<<< @@ -62121,18 +65411,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(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, 1892, __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, 1984, __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, 1892, __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, 1984, __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, 1892, __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, 1984, __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, 1892, __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, 1984, __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, 1892, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1892, __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, 1984, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1984, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_3); @@ -62151,14 +65441,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx } __pyx_L4:; - /* "collisions.py":1893 + /* "collisions.py":1985 * 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, 1893, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -62178,33 +65468,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(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, 1893, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1985, __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, 1893, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1985, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "collisions.py":1894 + /* "collisions.py":1986 * 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, 1894, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1986, __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, 1894, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1986, __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, 1894, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1986, __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":1893 + /* "collisions.py":1985 * else: * E = min(eps[0][0], eps[1][0]) * if self.angleInRange(90): # <<<<<<<<<<<<<< @@ -62214,7 +65504,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx goto __pyx_L5; } - /* "collisions.py":1896 + /* "collisions.py":1988 * S = self.y+self.r * else: * S = max(eps[0][1], eps[1][1]) # <<<<<<<<<<<<<< @@ -62222,18 +65512,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(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, 1896, __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, 1988, __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, 1896, __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, 1988, __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, 1896, __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, 1988, __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, 1896, __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, 1988, __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, 1896, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1896, __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, 1988, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_1); @@ -62252,14 +65542,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx } __pyx_L5:; - /* "collisions.py":1897 + /* "collisions.py":1989 * 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, 1897, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -62279,33 +65569,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(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, 1897, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1989, __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, 1897, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":1898 + /* "collisions.py":1990 * 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, 1898, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1990, __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, 1898, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1990, __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, 1898, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1990, __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":1897 + /* "collisions.py":1989 * else: * S = max(eps[0][1], eps[1][1]) * if self.angleInRange(0): # <<<<<<<<<<<<<< @@ -62315,7 +65605,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx goto __pyx_L6; } - /* "collisions.py":1900 + /* "collisions.py":1992 * W = self.x+self.r * else: * W = max(eps[0][0], eps[1][0]) # <<<<<<<<<<<<<< @@ -62323,18 +65613,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(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, 1900, __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, 1992, __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, 1900, __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, 1992, __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, 1900, __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, 1992, __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, 1900, __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, 1992, __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, 1900, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1900, __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, 1992, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_2); @@ -62353,33 +65643,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx } __pyx_L6:; - /* "collisions.py":1901 + /* "collisions.py":1993 * else: * W = max(eps[0][0], eps[1][0]) * return E, N, W, S # <<<<<<<<<<<<<< * - * def copy(self) -> 'Arc': + * 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, 1901, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1993, __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, 1901, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_E)) __PYX_ERR(0, 1993, __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, 1901, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_N)) __PYX_ERR(0, 1993, __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, 1901, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_W)) __PYX_ERR(0, 1993, __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, 1901, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_S)) __PYX_ERR(0, 1993, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1876 + /* "collisions.py":1968 * (self.x + self.r * math.cos(endAng), self.y + self.r * math.sin(endAng)) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -62406,25 +65696,64 @@ static PyObject *__pyx_pf_10collisions_3Arc_18rect(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":1903 +/* "collisions.py":1995 * return E, N, W, S * - * def copy(self) -> 'Arc': # <<<<<<<<<<<<<< + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ - * Because Noah's first arc broke, now you need another one. + * Finds whether a point is on a corner of this shape. */ +static PyObject *__pyx_pf_10collisions_52__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, 1995, __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, 1995, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __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, 1995, __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, 1995, __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_3Arc_21copy(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_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_3Arc_20copy, "\n Because Noah's first arc broke, now you need another one.\n "); -static PyMethodDef __pyx_mdef_10collisions_3Arc_21copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_21copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_20copy}; -static PyObject *__pyx_pw_10collisions_3Arc_21copy(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_3Arc_22isCorner, "\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_3Arc_23isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_23isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_22isCorner}; +static PyObject *__pyx_pw_10collisions_3Arc_23isCorner(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -62432,17 +65761,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("copy (wrapper)", 0); + __Pyx_RefNannySetupContext("isCorner (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -62452,10 +65783,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_defaults17 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults17, __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; @@ -62468,23 +65805,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1903, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1995, __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, 1995, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1995, __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, 1995, __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, "copy") < 0)) __PYX_ERR(0, 1903, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 1995, __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("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1903, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1995, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -62494,11 +65855,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Arc.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Arc.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_3Arc_20copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_3Arc_22isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); /* function exit code */ { @@ -62511,88 +65872,255 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_3Arc_20copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision) { + PyObject *__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; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + unsigned int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - unsigned int __pyx_t_11; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 1); + __Pyx_RefNannySetupContext("isCorner", 1); - /* "collisions.py":1907 - * Because Noah's first arc broke, now you need another one. + /* "collisions.py":2006 + * bool: Whether the point is on a corner of this shape * """ - * return Arc(self.x, self.y, self.r, self.startAng, self.endAng, self.precision, self.bounciness) # <<<<<<<<<<<<<< - * - * def __getitem__(self, item: int) -> Union[Number, pointLike]: + * for p in self.toPoints(): # <<<<<<<<<<<<<< + * if round(p[0], precision) == round(point[0], precision) and \ + * round(p[1], precision) == round(point[1], precision): */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1907, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __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, 1907, __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, 1907, __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, 1907, __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, 1907, __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, 1907, __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, 1907, __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, 1907, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = NULL; - __pyx_t_11 = 0; + __pyx_t_3 = NULL; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_10)) { + 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_10); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_11 = 1; + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[8] = {__pyx_t_10, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_11, 7+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + 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, 2006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + 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_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, 2006, __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, 2006, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + 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, 2006, __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, 2006, __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, 2006, __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, 2006, __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, 2006, __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, 2006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_6(__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, 2006, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":2007 + * """ + * 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, 2007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2007, __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, 2007, __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, 2007, __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, 2007, __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_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; + __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, 2007, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2007, __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, 2007, __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, 2007, __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, 2007, __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1907, __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, 2007, __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, 2007, __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; + } + + /* "collisions.py":2008 + * 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, 2008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2008, __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, 2008, __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, 2008, __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, 2008, __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, 2008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2008, __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, 2008, __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, 2008, __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, 2008, __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, 2008, __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":2007 + * """ + * 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 + */ + if (__pyx_t_7) { + + /* "collisions.py":2009 + * if round(p[0], precision) == round(point[0], precision) and \ + * round(p[1], precision) == round(point[1], precision): + * 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":2007 + * """ + * 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 + */ + } + + /* "collisions.py":2006 + * 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_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":2010 + * round(p[1], precision) == round(point[1], precision): + * return True + * return False # <<<<<<<<<<<<<< + * + * def toPoints(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1903 + /* "collisions.py":1995 * return E, N, W, S * - * def copy(self) -> 'Arc': # <<<<<<<<<<<<<< + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ - * Because Noah's first arc broke, now you need another one. + * Finds whether a point is on a corner of this shape. */ /* function exit code */ @@ -62600,39 +66128,35 @@ static PyObject *__pyx_pf_10collisions_3Arc_20copy(CYTHON_UNUSED PyObject *__pyx __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_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("collisions.Arc.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Arc.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_p); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1909 - * return Arc(self.x, self.y, self.r, self.startAng, self.endAng, self.precision, self.bounciness) +/* "collisions.py":2012 + * return False * - * def __getitem__(self, item: int) -> Union[Number, pointLike]: # <<<<<<<<<<<<<< - * if item == 0: - * return self.x + * def toPoints(self): # <<<<<<<<<<<<<< + * """ + * Returns: */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_23__getitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_25toPoints(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_3Arc_23__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_23__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_3Arc_23__getitem__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_3Arc_24toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object.\n "); +static PyMethodDef __pyx_mdef_10collisions_3Arc_25toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_25toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_24toPoints}; +static PyObject *__pyx_pw_10collisions_3Arc_25toPoints(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -62640,18 +66164,17 @@ 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}; + 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("toPoints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -62661,12 +66184,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_item,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; @@ -62679,35 +66200,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1909, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2012, __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, 1909, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1909, __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, 1909, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2012, __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_item = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1909, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2012, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -62717,18 +66226,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Arc.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Arc.toPoints", __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, 1909, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_3Arc_22__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); + __pyx_r = __pyx_pf_10collisions_3Arc_24toPoints(__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) { @@ -62739,44 +66243,608 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) { +static PyObject *__pyx_pf_10collisions_3Arc_24toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { 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; + 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; + unsigned int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getitem__", 1); + __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":1910 - * - * def __getitem__(self, item: int) -> Union[Number, pointLike]: - * if item == 0: # <<<<<<<<<<<<<< - * return self.x - * elif item == 1: + /* "collisions.py":2017 + * 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_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1910, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1910, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { + __Pyx_XDECREF(__pyx_r); - /* "collisions.py":1911 - * def __getitem__(self, item: int) -> Union[Number, pointLike]: - * if item == 0: - * return self.x # <<<<<<<<<<<<<< + /* "collisions.py":2018 + * """ + * 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, 2018, __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, 2018, __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, 2018, __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, 2018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2018, __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, 2018, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 2018, __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, 2018, __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, 2018, __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, 2018, __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, 2018, __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, 2018, __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, 2018, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 2018, __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, 2018, __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, 2018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + __pyx_t_9 = 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_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_6, __pyx_t_7, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 2018, __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, 2018, __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, 2018, __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":2019 + * 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, 2019, __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, 2019, __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, 2019, __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, 2019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2019, __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, 2019, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 2019, __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, 2019, __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, 2019, __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, 2019, __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, 2019, __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, 2019, __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, 2019, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10)) __PYX_ERR(0, 2019, __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, 2019, __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, 2019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_t_8, __pyx_t_4, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 2019, __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, 2019, __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, 2019, __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":2017 + * 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, 2017, __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, 2017, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(0, 2017, __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":2012 + * return False + * + * def toPoints(self): # <<<<<<<<<<<<<< + * """ + * Returns: + */ + + /* 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_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("collisions.Arc.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2022 + * ] + * + * def copy(self) -> 'Arc': # <<<<<<<<<<<<<< + * """ + * Because Noah's first arc broke, now you need another one. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_3Arc_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_3Arc_26copy, "\n Because Noah's first arc broke, now you need another one.\n "); +static PyMethodDef __pyx_mdef_10collisions_3Arc_27copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_27copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_3Arc_26copy}; +static PyObject *__pyx_pw_10collisions_3Arc_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 +) { + 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("copy (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, 2022, __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, 2022, __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, 2022, __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.Arc.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_3Arc_26copy(__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_3Arc_26copy(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; + 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; + PyObject *__pyx_t_10 = NULL; + unsigned int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 1); + + /* "collisions.py":2026 + * 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) # <<<<<<<<<<<<<< + * + * 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, 2026, __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, 2026, __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, 2026, __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, 2026, __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, 2026, __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, 2026, __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, 2026, __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, 2026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = NULL; + __pyx_t_11 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(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_11 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[8] = {__pyx_t_10, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_11, 7+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 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; + __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; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2026, __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":2022 + * ] + * + * def copy(self) -> 'Arc': # <<<<<<<<<<<<<< + * """ + * Because Noah's first arc broke, now you need another one. + */ + + /* 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_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("collisions.Arc.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2028 + * 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 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_3Arc_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_3Arc_29__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_29__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_3Arc_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 +) { + 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, 2028, __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, 2028, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__getitem__", 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, "__getitem__") < 0)) __PYX_ERR(0, 2028, __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, 2028, __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.Arc.__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, 2028, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_3Arc_28__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_3Arc_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; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 1); + + /* "collisions.py":2029 + * + * 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, 2029, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2029, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "collisions.py":2030 + * def __getitem__(self, item: int) -> Union[Number, pointLike]: + * 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, 1911, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1910 + /* "collisions.py":2029 * * def __getitem__(self, item: int) -> Union[Number, pointLike]: * if item == 0: # <<<<<<<<<<<<<< @@ -62785,19 +66853,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1912 + /* "collisions.py":2031 * 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, 1912, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1912, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1913 + /* "collisions.py":2032 * return self.x * elif item == 1: * return self.y # <<<<<<<<<<<<<< @@ -62805,13 +66873,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__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, 1913, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1912 + /* "collisions.py":2031 * if item == 0: * return self.x * elif item == 1: # <<<<<<<<<<<<<< @@ -62820,19 +66888,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1914 + /* "collisions.py":2033 * 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, 1914, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1914, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1915 + /* "collisions.py":2034 * return self.y * elif item == 2: * return self.r # <<<<<<<<<<<<<< @@ -62840,13 +66908,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__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, 1915, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1914 + /* "collisions.py":2033 * elif item == 1: * return self.y * elif item == 2: # <<<<<<<<<<<<<< @@ -62855,19 +66923,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1916 + /* "collisions.py":2035 * 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, 1916, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1916, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1917 + /* "collisions.py":2036 * return self.r * elif item == 3: * return self.startAng # <<<<<<<<<<<<<< @@ -62875,13 +66943,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__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, 1917, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1916 + /* "collisions.py":2035 * elif item == 2: * return self.r * elif item == 3: # <<<<<<<<<<<<<< @@ -62890,19 +66958,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1918 + /* "collisions.py":2037 * 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, 1918, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1918, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1919 + /* "collisions.py":2038 * return self.startAng * elif item == 4: * return self.endAng # <<<<<<<<<<<<<< @@ -62910,13 +66978,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__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, 1919, __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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1918 + /* "collisions.py":2037 * elif item == 3: * return self.startAng * elif item == 4: # <<<<<<<<<<<<<< @@ -62925,7 +66993,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1921 + /* "collisions.py":2040 * return self.endAng * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -62934,35 +67002,35 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject */ /*else*/ { - /* "collisions.py":1922 + /* "collisions.py":2041 * 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, 1922, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2041, __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, 1922, __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, 2041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1921 + /* "collisions.py":2040 * 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, 1921, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2040, __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, 1921, __pyx_L1_error) + __PYX_ERR(0, 2040, __pyx_L1_error) } - /* "collisions.py":1909 + /* "collisions.py":2028 * return Arc(self.x, self.y, self.r, self.startAng, self.endAng, self.precision, self.bounciness) * * def __getitem__(self, item: int) -> Union[Number, pointLike]: # <<<<<<<<<<<<<< @@ -62982,7 +67050,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1925 +/* "collisions.py":2044 * ) * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: # <<<<<<<<<<<<<< @@ -62991,15 +67059,15 @@ static PyObject *__pyx_pf_10collisions_3Arc_22__getitem__(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_25__setitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_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_3Arc_25__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_25__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_3Arc_25__setitem__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_3Arc_31__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_31__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_3Arc_31__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -63049,7 +67117,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, 2044, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -63057,9 +67125,9 @@ 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, 2044, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 1925, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2044, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -63067,14 +67135,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1925, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2044, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 1925, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2044, __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, 1925, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2044, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -63089,7 +67157,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, 1925, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2044, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -63103,8 +67171,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, 1925, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_3Arc_24__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, 2044, __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 */ goto __pyx_L0; @@ -63121,7 +67189,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new) { +static PyObject *__pyx_pf_10collisions_3Arc_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; @@ -63132,28 +67200,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":1926 + /* "collisions.py":2045 * * 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, 1926, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1926, __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, 2045, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2045, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1927 + /* "collisions.py":2046 * 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, 1927, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_new) < 0) __PYX_ERR(0, 2046, __pyx_L1_error) - /* "collisions.py":1926 + /* "collisions.py":2045 * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: * if item == 0: # <<<<<<<<<<<<<< @@ -63163,28 +67231,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":1928 + /* "collisions.py":2047 * 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, 1928, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1928, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1929 + /* "collisions.py":2048 * 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, 1929, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_new) < 0) __PYX_ERR(0, 2048, __pyx_L1_error) - /* "collisions.py":1928 + /* "collisions.py":2047 * if item == 0: * self.x = new * elif item == 1: # <<<<<<<<<<<<<< @@ -63194,28 +67262,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":1930 + /* "collisions.py":2049 * 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, 1930, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1930, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1931 + /* "collisions.py":2050 * 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, 1931, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_v_new) < 0) __PYX_ERR(0, 2050, __pyx_L1_error) - /* "collisions.py":1930 + /* "collisions.py":2049 * elif item == 1: * self.y = new * elif item == 2: # <<<<<<<<<<<<<< @@ -63225,28 +67293,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":1932 + /* "collisions.py":2051 * 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, 1932, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1932, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1933 + /* "collisions.py":2052 * 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, 1933, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_v_new) < 0) __PYX_ERR(0, 2052, __pyx_L1_error) - /* "collisions.py":1932 + /* "collisions.py":2051 * elif item == 2: * self.r = new * elif item == 3: # <<<<<<<<<<<<<< @@ -63256,28 +67324,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":1934 + /* "collisions.py":2053 * 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, 1934, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1934, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1935 + /* "collisions.py":2054 * 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, 1935, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_v_new) < 0) __PYX_ERR(0, 2054, __pyx_L1_error) - /* "collisions.py":1934 + /* "collisions.py":2053 * elif item == 3: * self.startAng = new * elif item == 4: # <<<<<<<<<<<<<< @@ -63287,7 +67355,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":1937 + /* "collisions.py":2056 * self.endAng = new * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -63296,36 +67364,36 @@ static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject */ /*else*/ { - /* "collisions.py":1938 + /* "collisions.py":2057 * 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, 1938, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2057, __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, 1938, __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, 2057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1937 + /* "collisions.py":2056 * 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, 1937, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2056, __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, 1937, __pyx_L1_error) + __PYX_ERR(0, 2056, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":1925 + /* "collisions.py":2044 * ) * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: # <<<<<<<<<<<<<< @@ -63347,7 +67415,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1941 +/* "collisions.py":2060 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -63356,15 +67424,15 @@ static PyObject *__pyx_pf_10collisions_3Arc_24__setitem__(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_27__iter__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_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_3Arc_27__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_27__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_3Arc_27__iter__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_3Arc_33__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_33__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_3Arc_33__iter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -63408,12 +67476,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1941, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2060, __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, 1941, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 2060, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -63424,7 +67492,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, 1941, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2060, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -63438,7 +67506,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_3Arc_26__iter__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_3Arc_32__iter__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -63451,7 +67519,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_3Arc_26__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_3Arc_32__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -63465,7 +67533,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_26__iter__(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":1942 + /* "collisions.py":2061 * * def __iter__(self): * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) # <<<<<<<<<<<<<< @@ -63473,41 +67541,41 @@ static PyObject *__pyx_pf_10collisions_3Arc_26__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, 1942, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2061, __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, 1942, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2061, __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, 1942, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2061, __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, 1942, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2061, __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, 1942, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1942, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2061, __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, 1942, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2061, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 1942, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 2061, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 1942, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 2061, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4)) __PYX_ERR(0, 1942, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4)) __PYX_ERR(0, 2061, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5)) __PYX_ERR(0, 1942, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5)) __PYX_ERR(0, 2061, __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, 1942, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2061, __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":1941 + /* "collisions.py":2060 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -63531,7 +67599,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_26__iter__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":1944 +/* "collisions.py":2063 * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -63540,15 +67608,15 @@ static PyObject *__pyx_pf_10collisions_3Arc_26__iter__(CYTHON_UNUSED PyObject *_ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_3Arc_29__str__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_3Arc_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_3Arc_29__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_29__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_3Arc_29__str__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_3Arc_35__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_3Arc_35__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_3Arc_35__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -63592,12 +67660,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1944, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2063, __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, 1944, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2063, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -63608,7 +67676,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, 1944, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2063, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -63622,7 +67690,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_3Arc_28__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_3Arc_34__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -63635,7 +67703,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_3Arc_28__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -63648,7 +67716,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__str__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":1945 + /* "collisions.py":2064 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -63656,7 +67724,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__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, 1945, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -63664,9 +67732,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__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, 1945, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2064, __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, 1945, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2064, __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; @@ -63674,13 +67742,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__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__3); + __Pyx_INCREF(__pyx_kp_u__6); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__3); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1945, __pyx_L1_error) + __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, 2064, __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, 1945, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2064, __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; @@ -63692,9 +67760,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__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, 1945, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2064, __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, 1945, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2064, __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; @@ -63706,9 +67774,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__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, 1945, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2064, __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, 1945, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2064, __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; @@ -63716,14 +67784,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__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__22); + __Pyx_INCREF(__pyx_kp_u__24); __pyx_t_3 = (255 > __pyx_t_3) ? 255 : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_kp_u__22); - __Pyx_GIVEREF(__pyx_kp_u__22); - PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__22); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1945, __pyx_L1_error) + __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, 2064, __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, 1945, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2064, __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; @@ -63731,19 +67799,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__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__23); + __Pyx_INCREF(__pyx_kp_u__25); __pyx_t_3 = (255 > __pyx_t_3) ? 255 : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_kp_u__23); - __Pyx_GIVEREF(__pyx_kp_u__23); - PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u__23); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1945, __pyx_L1_error) + __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, 2064, __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":1944 + /* "collisions.py":2063 * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -63764,9 +67832,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__str__(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":1951 +/* "collisions.py":2070 * 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} * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return [] @@ -63828,7 +67896,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1951, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2070, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -63836,14 +67904,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1951, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2070, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1951, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 2070, __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, 1951, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 2070, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -63856,7 +67924,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, 1951, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2070, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -63903,14 +67971,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":1952 - * GROUPS = [ShpGroups.CLOSED] + /* "collisions.py":2071 + * GROUPS = {ShpGroups.CLOSED} * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return [] - * if checkShpType(othershape, Point): + * 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, 1952, __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, 2071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -63930,57 +67998,60 @@ 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, 1952, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2071, __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, 1952, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2071, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "collisions.py":1953 + /* "collisions.py":2072 * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if not self.check_rects(othershape): * return [] # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * for i in self.toLines(): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1952 - * GROUPS = [ShpGroups.CLOSED] + /* "collisions.py":2071 + * GROUPS = {ShpGroups.CLOSED} * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return [] - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): */ } - /* "collisions.py":1954 + /* "collisions.py":2073 * if not self.check_rects(othershape): * return [] - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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, 1954, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2073, __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, 1954, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __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_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_7)) { + __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_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -63988,35 +68059,35 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_7}; __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1954, __pyx_L1_error) + __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, 2073, __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, 1954, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1955 + /* "collisions.py":2074 * return [] - * if checkShpType(othershape, Point): + * 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, 1955, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; + __pyx_t_7 = 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)) { + __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_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -64024,10 +68095,10 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1955, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -64036,9 +68107,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, 1955, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2074, __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, 1955, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2074, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -64047,28 +68118,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, 1955, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2074, __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, 1955, __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, 2074, __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, 1955, __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, 2074, __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, 1955, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2074, __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, 1955, __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, 2074, __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, 1955, __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, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -64078,7 +68149,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, 1955, __pyx_L1_error) + else __PYX_ERR(0, 2074, __pyx_L1_error) } break; } @@ -64087,42 +68158,42 @@ 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":1956 - * if checkShpType(othershape, Point): + /* "collisions.py":2075 + * if checkShpType(othershape, ShpTyps.Point): * for i in self.toLines(): * if i.collides(othershape): # <<<<<<<<<<<<<< * return [[othershape.x, othershape.y]] * return [] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1956, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = NULL; __pyx_t_4 = 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); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __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, 1956, __pyx_L1_error) + 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, 2075, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1956, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2075, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1957 + /* "collisions.py":2076 * for i in self.toLines(): * if i.collides(othershape): * return [[othershape.x, othershape.y]] # <<<<<<<<<<<<<< @@ -64130,30 +68201,30 @@ 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, 1957, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1957, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2076, __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, 1957, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(0, 1957, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1957, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2076, __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, 2076, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 1957, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 2076, __pyx_L1_error); + __pyx_t_1 = 0; __pyx_t_7 = 0; - __pyx_r = __pyx_t_3; + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2076, __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, 2076, __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":1956 - * if checkShpType(othershape, Point): + /* "collisions.py":2075 + * if checkShpType(othershape, ShpTyps.Point): * for i in self.toLines(): * if i.collides(othershape): # <<<<<<<<<<<<<< * return [[othershape.x, othershape.y]] @@ -64161,9 +68232,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje */ } - /* "collisions.py":1955 + /* "collisions.py":2074 * return [] - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * for i in self.toLines(): # <<<<<<<<<<<<<< * if i.collides(othershape): * return [[othershape.x, othershape.y]] @@ -64171,7 +68242,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1958 + /* "collisions.py":2077 * if i.collides(othershape): * return [[othershape.x, othershape.y]] * return [] # <<<<<<<<<<<<<< @@ -64179,22 +68250,22 @@ 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, 1958, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1954 + /* "collisions.py":2073 * if not self.check_rects(othershape): * return [] - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * for i in self.toLines(): * if i.collides(othershape): */ } - /* "collisions.py":1960 + /* "collisions.py":2079 * return [] * else: * points = [] # <<<<<<<<<<<<<< @@ -64202,90 +68273,90 @@ 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, 1960, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_points = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1961 + /* "collisions.py":2080 * else: * points = [] * for i in self.toLines(): # <<<<<<<<<<<<<< * points.extend(i._where(othershape)) * return points */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = NULL; __pyx_t_4 = 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); + if (likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __pyx_L1_error) + 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, 2080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1961, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2080, __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, 2080, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 1961, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2080, __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_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1961, __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, 2080, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __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, 2080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 1961, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2080, __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_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1961, __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, 2080, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __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, 2080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_2 = __pyx_t_9(__pyx_t_3); + __pyx_t_2 = __pyx_t_9(__pyx_t_7); 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, 1961, __pyx_L1_error) + else __PYX_ERR(0, 2080, __pyx_L1_error) } break; } @@ -64294,41 +68365,41 @@ 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":1962 + /* "collisions.py":2081 * points = [] * for i in self.toLines(): * points.extend(i._where(othershape)) # <<<<<<<<<<<<<< * return points * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_where); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_othershape}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __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, 1962, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __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, 1962, __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, 2081, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1961 + /* "collisions.py":2080 * else: * points = [] * for i in self.toLines(): # <<<<<<<<<<<<<< @@ -64336,9 +68407,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje * return points */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1963 + /* "collisions.py":2082 * for i in self.toLines(): * points.extend(i._where(othershape)) * return points # <<<<<<<<<<<<<< @@ -64351,9 +68422,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje goto __pyx_L0; } - /* "collisions.py":1951 + /* "collisions.py":2070 * 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} * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return [] @@ -64375,7 +68446,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":1965 +/* "collisions.py":2084 * return points * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -64443,7 +68514,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1965, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2084, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -64451,9 +68522,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1965, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2084, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 1965, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 2084, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -64461,14 +68532,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1965, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2084, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 1965, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 2084, __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, 1965, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 2084, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -64483,7 +68554,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, 1965, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2084, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -64510,7 +68581,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1983 +/* "collisions.py":2102 * 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): # <<<<<<<<<<<<<< @@ -64571,12 +68642,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2102, __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, 1983, __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, 2102, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -64587,7 +68658,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, 1983, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("degrees_to_vector", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2102, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -64628,16 +68699,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("degrees_to_vector", 1); - /* "collisions.py":1985 + /* "collisions.py":2104 * 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, 1985, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2104, __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, 1985, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -64658,14 +68729,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, 1985, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2104, __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":1986 + /* "collisions.py":2105 * # Convert an angle to a unit vector * radians = math.radians(angle) * return math.cos(radians), math.sin(radians) # <<<<<<<<<<<<<< @@ -64673,9 +68744,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, 1986, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2105, __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, 1986, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -64696,13 +68767,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, 1986, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2105, __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, 1986, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2105, __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, 1986, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -64723,23 +68794,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, 1986, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2105, __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, 1986, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2105, __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, 1986, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 2105, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 1986, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 2105, __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":1983 + /* "collisions.py":2102 * 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): # <<<<<<<<<<<<<< @@ -64762,7 +68833,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector( return __pyx_r; } -/* "collisions.py":1981 +/* "collisions.py":2100 * 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) # <<<<<<<<<<<<<< @@ -64771,15 +68842,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector( */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_7tangent_2lambda19(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_7tangent_2lambda20(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_11ClosedShape_7tangent_2lambda19 = {"lambda19", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_7tangent_2lambda19, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_7tangent_2lambda19(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_7tangent_2lambda20 = {"lambda20", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_7tangent_2lambda20, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_7tangent_2lambda20(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -64797,7 +68868,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda19 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda20 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -64823,12 +68894,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1981, __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, "lambda19") < 0)) __PYX_ERR(0, 1981, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda20") < 0)) __PYX_ERR(0, 2100, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -64839,7 +68910,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, 1981, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda20", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2100, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -64849,11 +68920,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ClosedShape.tangent.lambda19", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.tangent.lambda20", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda19(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda20(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -64866,9 +68937,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda19(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *__pyx_outer_scope; +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; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -64878,47 +68949,47 @@ static PyObject *__pyx_lambda_funcdef_lambda19(PyObject *__pyx_self, PyObject *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda19", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *) __Pyx_CyFunction_GetClosure(__pyx_self); + __Pyx_RefNannySetupContext("lambda20", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_16_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, 1981, __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, 2100, __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, 1981, __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, 2100, __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, 1981, __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, 1981, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_point)) { __Pyx_RaiseClosureNameError("point"); __PYX_ERR(0, 2100, __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, 2100, __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, 1981, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2100, __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, 1981, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2100, __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, 1981, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2100, __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, 1981, __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, 2100, __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, 1981, __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, 2100, __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, 1981, __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, 1981, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_point)) { __Pyx_RaiseClosureNameError("point"); __PYX_ERR(0, 2100, __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, 2100, __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, 1981, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2100, __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, 1981, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2100, __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, 1981, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2100, __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, 1981, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2100, __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; @@ -64932,7 +69003,7 @@ static PyObject *__pyx_lambda_funcdef_lambda19(PyObject *__pyx_self, PyObject *_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.ClosedShape.tangent.lambda19", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.tangent.lambda20", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -64940,7 +69011,7 @@ static PyObject *__pyx_lambda_funcdef_lambda19(PyObject *__pyx_self, PyObject *_ return __pyx_r; } -/* "collisions.py":1965 +/* "collisions.py":2084 * return points * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -64949,7 +69020,7 @@ static PyObject *__pyx_lambda_funcdef_lambda19(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_14_tangent *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *__pyx_cur_scope; PyObject *__pyx_v_p = NULL; PyObject *__pyx_v_ps = NULL; PyObject *__pyx_v_origps = NULL; @@ -64960,8 +69031,8 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb PyObject *__pyx_v_y2 = NULL; PyObject *__pyx_v_avg_x = NULL; PyObject *__pyx_v_avg_y = NULL; - PyObject *__pyx_9genexpr32__pyx_v_i = NULL; - PyObject *__pyx_9genexpr33__pyx_v_pt = NULL; + PyObject *__pyx_9genexpr34__pyx_v_i = NULL; + PyObject *__pyx_9genexpr35__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -64979,11 +69050,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_14_tangent *)__pyx_tp_new_10collisions___pyx_scope_struct_14_tangent(__pyx_ptype_10collisions___pyx_scope_struct_14_tangent, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1965, __pyx_L1_error) + __PYX_ERR(0, 2084, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -64991,25 +69062,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":1977 + /* "collisions.py":2096 * """ * # 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, 1977, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2096, __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, 1977, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2096, __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, 1977, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_p = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1978 + /* "collisions.py":2097 * # 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()] # <<<<<<<<<<<<<< @@ -65017,9 +69088,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, 1978, __pyx_L5_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2097, __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, 1978, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2097, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -65039,7 +69110,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, 1978, __pyx_L5_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2097, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -65048,9 +69119,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, 1978, __pyx_L5_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2097, __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, 1978, __pyx_L5_error) + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2097, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -65059,28 +69130,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, 1978, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2097, __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, 1978, __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, 2097, __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, 1978, __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, 2097, __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, 1978, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2097, __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, 1978, __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, 2097, __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, 1978, __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, 2097, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -65090,15 +69161,15 @@ 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, 1978, __pyx_L5_error) + else __PYX_ERR(0, 2097, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr32__pyx_v_i, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1978, __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, 2097, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -65118,33 +69189,33 @@ 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, 1978, __pyx_L5_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2097, __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, 1978, __pyx_L5_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2097, __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, 1978, __pyx_L5_error); - __Pyx_INCREF(__pyx_9genexpr32__pyx_v_i); - __Pyx_GIVEREF(__pyx_9genexpr32__pyx_v_i); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_9genexpr32__pyx_v_i)) __PYX_ERR(0, 1978, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 2097, __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, 2097, __pyx_L5_error); __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1978, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2097, __pyx_L5_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_i); __pyx_9genexpr32__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_i); __pyx_9genexpr34__pyx_v_i = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_i); __pyx_9genexpr32__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_i); __pyx_9genexpr34__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ __pyx_v_ps = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1979 + /* "collisions.py":2098 * 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] # <<<<<<<<<<<<<< @@ -65152,16 +69223,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, 1979, __pyx_L12_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2098, __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, 1979, __pyx_L12_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2098, __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, 1979, __pyx_L12_error) + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2098, __pyx_L12_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -65169,28 +69240,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, 1979, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2098, __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, 1979, __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, 2098, __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, 1979, __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, 2098, __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, 1979, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2098, __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, 1979, __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, 2098, __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, 1979, __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, 2098, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -65200,20 +69271,20 @@ 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, 1979, __pyx_L12_error) + else __PYX_ERR(0, 2098, __pyx_L12_error) } break; } __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_pt, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_pt, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr33__pyx_v_pt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __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, 2098, __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, 1979, __pyx_L12_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tangent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2098, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr33__pyx_v_pt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __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, 2098, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -65234,116 +69305,116 @@ 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, 1979, __pyx_L12_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2098, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr33__pyx_v_pt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1979, __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, 2098, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __pyx_L12_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2098, __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, 1979, __pyx_L12_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 2098, __pyx_L12_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_8)) __PYX_ERR(0, 1979, __pyx_L12_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_8)) __PYX_ERR(0, 2098, __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, 1979, __pyx_L12_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2098, __pyx_L12_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_pt); __pyx_9genexpr33__pyx_v_pt = 0; + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_pt); __pyx_9genexpr35__pyx_v_pt = 0; goto __pyx_L16_exit_scope; __pyx_L12_error:; - __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_pt); __pyx_9genexpr33__pyx_v_pt = 0; + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_pt); __pyx_9genexpr35__pyx_v_pt = 0; goto __pyx_L1_error; __pyx_L16_exit_scope:; } /* exit inner scope */ __pyx_v_origps = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1980 + /* "collisions.py":2099 * 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, 1980, __pyx_L1_error) + __pyx_t_3 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_copy, __pyx_v_origps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_ps, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1981 + /* "collisions.py":2100 * 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, 1981, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ps, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_7tangent_2lambda19, 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, 1981, __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, 2100, __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, 1981, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 2100, __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, 1981, __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, 2100, __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":1982 + /* "collisions.py":2101 * 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, 1982, __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, 2101, __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, 1982, __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, 2101, __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, 1982, __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, 2101, __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, 1982, __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, 2101, __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, 1982, __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, 2101, __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, 1982, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_10) { - /* "collisions.py":1983 + /* "collisions.py":2102 * 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__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1983, __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__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_degrees_to_vector = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1989 + /* "collisions.py":2108 * * # 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, 1989, __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, 2108, __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, 1989, __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, 2108, __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, 1989, __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, 2108, __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))) { @@ -65352,7 +69423,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, 1989, __pyx_L1_error) + __PYX_ERR(0, 2108, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -65365,15 +69436,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, 1989, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1989, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2108, __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, 1989, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2108, __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); @@ -65381,7 +69452,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, 1989, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2108, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L19_unpacking_done; @@ -65389,7 +69460,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, 1989, __pyx_L1_error) + __PYX_ERR(0, 2108, __pyx_L1_error) __pyx_L19_unpacking_done:; } __pyx_v_x1 = __pyx_t_3; @@ -65397,19 +69468,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __pyx_v_y1 = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1990 + /* "collisions.py":2109 * # 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, 1990, __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, 2109, __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, 1990, __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, 2109, __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, 1990, __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, 2109, __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))) { @@ -65418,7 +69489,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, 1990, __pyx_L1_error) + __PYX_ERR(0, 2109, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -65431,15 +69502,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, 1990, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1990, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2109, __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, 1990, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2109, __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); @@ -65447,7 +69518,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, 1990, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2109, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L21_unpacking_done; @@ -65455,7 +69526,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, 1990, __pyx_L1_error) + __PYX_ERR(0, 2109, __pyx_L1_error) __pyx_L21_unpacking_done:; } __pyx_v_x2 = __pyx_t_1; @@ -65463,37 +69534,37 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __pyx_v_y2 = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1993 + /* "collisions.py":2112 * * # 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, 1993, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_x1, __pyx_v_x2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2112, __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, 1993, __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, 2112, __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":1994 + /* "collisions.py":2113 * # 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, 1994, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_y1, __pyx_v_y2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2113, __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, 1994, __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, 2113, __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":1995 + /* "collisions.py":2114 * avg_x = (x1 + x2) / 2 * avg_y = (y1 + y2) / 2 * return math.degrees(math.atan2(avg_y, avg_x)) % 360 # <<<<<<<<<<<<<< @@ -65501,14 +69572,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, 1995, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2114, __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, 1995, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2114, __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, 1995, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2114, __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, 1995, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atan2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -65529,7 +69600,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, 1995, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -65552,18 +69623,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, 1995, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2114, __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, 1995, __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, 2114, __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":1982 + /* "collisions.py":2101 * 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]: # <<<<<<<<<<<<<< @@ -65572,7 +69643,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb */ } - /* "collisions.py":1997 + /* "collisions.py":2116 * return math.degrees(math.atan2(avg_y, avg_x)) % 360 * * return ps[0][0] # <<<<<<<<<<<<<< @@ -65580,16 +69651,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, 1997, __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, 2116, __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, 1997, __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, 2116, __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":1965 + /* "collisions.py":2084 * return points * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -65618,15 +69689,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __Pyx_XDECREF(__pyx_v_y2); __Pyx_XDECREF(__pyx_v_avg_x); __Pyx_XDECREF(__pyx_v_avg_y); - __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_pt); + __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_pt); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1999 +/* "collisions.py":2118 * return ps[0][0] * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< @@ -65695,7 +69766,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1999, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -65703,21 +69774,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1999, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1999, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 2118, __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, 1999, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2118, __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, 1999, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 2118, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -65735,7 +69806,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, 1999, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2118, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -65762,7 +69833,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":2022 +/* "collisions.py":2141 * return colls * return colls[0] * def calculate(ln, oln, recalculate): # <<<<<<<<<<<<<< @@ -65829,7 +69900,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2141, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -65837,9 +69908,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2141, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 2022, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 2141, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -65847,14 +69918,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2141, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 2022, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 2141, __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, 2022, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 2141, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -65869,7 +69940,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, 2022, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2141, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -65914,14 +69985,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("calculate", 1); - /* "collisions.py":2023 + /* "collisions.py":2142 * 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, 2023, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -65941,27 +70012,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, 2023, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2142, __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":2024 + /* "collisions.py":2143 * 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, 2024, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2143, __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, 2024, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2143, __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, 2024, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2143, __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, 2024, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2143, __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; @@ -65984,37 +70055,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, 2024, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2143, __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":2025 + /* "collisions.py":2144 * 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, 2025, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 2144, __pyx_L1_error) if (__pyx_t_7) { - /* "collisions.py":2026 + /* "collisions.py":2145 * 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, 2026, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2145, __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, 2026, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2145, __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, 2026, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2145, __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, 2026, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2145, __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; @@ -66037,14 +70108,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, 2026, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2145, __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":2027 + /* "collisions.py":2146 * if recalculate: * p3 = oln.closestPointTo(Point(*p)) * p2 = p # <<<<<<<<<<<<<< @@ -66054,7 +70125,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":2028 + /* "collisions.py":2147 * p3 = oln.closestPointTo(Point(*p)) * p2 = p * p = p3 # <<<<<<<<<<<<<< @@ -66064,7 +70135,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":2025 + /* "collisions.py":2144 * p2 = oln.closestPointTo(ln) * p = ln.closestPointTo(Point(*p2)) * if recalculate: # <<<<<<<<<<<<<< @@ -66073,7 +70144,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( */ } - /* "collisions.py":2029 + /* "collisions.py":2148 * p2 = p * p = p3 * return p2, abs(p[0]-p2[0])**2+abs(p[1]-p2[1])**2 # <<<<<<<<<<<<<< @@ -66081,51 +70152,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, 2029, __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, 2148, __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, 2029, __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, 2148, __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, 2029, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2148, __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, 2029, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2148, __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, 2029, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2148, __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, 2029, __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, 2148, __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, 2029, __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, 2148, __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, 2029, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2148, __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, 2029, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2148, __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, 2029, __pyx_L1_error) + __pyx_t_5 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2148, __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, 2029, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2148, __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, 2029, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2148, __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, 2029, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_p2)) __PYX_ERR(0, 2148, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(0, 2029, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(0, 2148, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2022 + /* "collisions.py":2141 * return colls * return colls[0] * def calculate(ln, oln, recalculate): # <<<<<<<<<<<<<< @@ -66151,7 +70222,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( return __pyx_r; } -/* "collisions.py":2058 +/* "collisions.py":2177 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< @@ -66218,7 +70289,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2058, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -66226,9 +70297,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2058, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 2177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -66236,14 +70307,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2058, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 2177, __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, 2058, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 2177, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -66258,7 +70329,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, 2058, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2177, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -66286,8 +70357,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_15_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *__pyx_outer_scope; PyObject *__pyx_v_p2 = NULL; PyObject *__pyx_v_olineP = NULL; PyObject *__pyx_r = NULL; @@ -66303,23 +70374,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_15_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":2059 + /* "collisions.py":2178 * 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, 2059, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2178, __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, 2059, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2178, __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, 2059, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2178, __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, 2059, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2178, __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; @@ -66342,14 +70413,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, 2059, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2178, __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":2060 + /* "collisions.py":2179 * def calculate(ln, point, recalculate): * p2 = ln.closestPointTo(Point(*point)) * olineP = point # <<<<<<<<<<<<<< @@ -66359,17 +70430,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate __Pyx_INCREF(__pyx_v_point); __pyx_v_olineP = __pyx_v_point; - /* "collisions.py":2061 + /* "collisions.py":2180 * 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, 2061, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 2180, __pyx_L1_error) if (__pyx_t_7) { - /* "collisions.py":2062 + /* "collisions.py":2181 * olineP = point * if recalculate: * olineP = p2 # <<<<<<<<<<<<<< @@ -66379,21 +70450,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":2063 + /* "collisions.py":2182 * 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, 2063, __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, 2063, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2182, __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, 2182, __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, 2063, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2182, __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, 2063, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2182, __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, 2063, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2182, __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; @@ -66416,14 +70487,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, 2063, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2182, __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":2061 + /* "collisions.py":2180 * p2 = ln.closestPointTo(Point(*point)) * olineP = point * if recalculate: # <<<<<<<<<<<<<< @@ -66432,7 +70503,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate */ } - /* "collisions.py":2064 + /* "collisions.py":2183 * olineP = p2 * p2 = self.closestPointTo(Point(*p2)) * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 # <<<<<<<<<<<<<< @@ -66440,51 +70511,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, 2064, __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, 2183, __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, 2064, __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, 2183, __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, 2064, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2183, __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, 2064, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __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, 2064, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2183, __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, 2064, __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, 2183, __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, 2064, __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, 2183, __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, 2064, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2183, __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, 2064, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2183, __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, 2064, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2183, __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, 2064, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2183, __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, 2064, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2183, __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, 2064, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p2)) __PYX_ERR(0, 2183, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 2183, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2058 + /* "collisions.py":2177 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< @@ -66509,8 +70580,8 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate return __pyx_r; } -/* "collisions.py":2012 - * if checkShpType(othershape, Point): +/* "collisions.py":2131 + * 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: @@ -66518,15 +70589,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_4lambda20(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_4lambda21(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_11ClosedShape_14closestPointTo_4lambda20 = {"lambda20", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_14closestPointTo_4lambda20, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_4lambda20(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_14closestPointTo_4lambda21 = {"lambda21", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_14closestPointTo_4lambda21, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_4lambda21(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -66544,7 +70615,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda20 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda21 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -66570,12 +70641,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2131, __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, 2012, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda21") < 0)) __PYX_ERR(0, 2131, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -66586,7 +70657,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, 2012, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda21", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -66596,11 +70667,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ClosedShape.closestPointTo.lambda20", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.closestPointTo.lambda21", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda20(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda21(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -66613,9 +70684,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *__pyx_outer_scope; +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; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -66625,41 +70696,41 @@ static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda20", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __Pyx_RefNannySetupContext("lambda21", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_17_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, 2012, __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, 2131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 2012, __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, 2012, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 2131, __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, 2131, __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, 2012, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2131, __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, 2012, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2131, __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, 2012, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2131, __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, 2012, __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, 2131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 2012, __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, 2012, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 2131, __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, 2131, __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, 2012, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2131, __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, 2012, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2131, __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, 2012, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2131, __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, 2012, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2131, __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; @@ -66673,7 +70744,7 @@ static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.ClosedShape.closestPointTo.lambda20", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.closestPointTo.lambda21", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -66681,7 +70752,7 @@ static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *_ return __pyx_r; } -/* "collisions.py":2035 +/* "collisions.py":2154 * calculate(ln, othershape, True) for ln in self.toLines() * ] * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< @@ -66690,145 +70761,15 @@ static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *_ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_5lambda21(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_11ClosedShape_14closestPointTo_5lambda21 = {"lambda21", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_14closestPointTo_5lambda21, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_5lambda21(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("lambda21 (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, 2035, __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, 2035, __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("lambda21", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2035, __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.ClosedShape.closestPointTo.lambda21", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda21(__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_lambda21(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("lambda21", 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, 2035, __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.ClosedShape.closestPointTo.lambda21", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":2048 - * 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] - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_6lambda22(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_5lambda22(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_11ClosedShape_14closestPointTo_6lambda22 = {"lambda22", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_14closestPointTo_6lambda22, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_6lambda22(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_14closestPointTo_5lambda22 = {"lambda22", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_14closestPointTo_5lambda22, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_5lambda22(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -66872,12 +70813,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2048, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2154, __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, 2048, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda22") < 0)) __PYX_ERR(0, 2154, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -66888,7 +70829,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, 2048, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda22", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2154, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -66924,7 +70865,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, 2048, __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, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -66941,24 +70882,24 @@ static PyObject *__pyx_lambda_funcdef_lambda22(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2074 - * 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]) # <<<<<<<<<<<<<< +/* "collisions.py":2167 + * 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 tries] + * return [i[0] for i in closests] */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_7lambda23(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_6lambda23(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_11ClosedShape_14closestPointTo_7lambda23 = {"lambda23", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_14closestPointTo_7lambda23, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_7lambda23(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_14closestPointTo_6lambda23 = {"lambda23", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_14closestPointTo_6lambda23, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_6lambda23(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -67002,12 +70943,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2074, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2167, __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, 2074, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda23") < 0)) __PYX_ERR(0, 2167, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -67018,7 +70959,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, 2074, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda23", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2167, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -67054,7 +70995,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, 2074, __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, 2167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -67071,7 +71012,137 @@ static PyObject *__pyx_lambda_funcdef_lambda23(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":1999 +/* "collisions.py":2193 + * 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] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_7lambda24(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_11ClosedShape_14closestPointTo_7lambda24 = {"lambda24", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_14closestPointTo_7lambda24, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_14closestPointTo_7lambda24(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("lambda24 (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, 2193, __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, 2193, __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("lambda24", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2193, __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.ClosedShape.closestPointTo.lambda24", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda24(__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_lambda24(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("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, 2193, __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.ClosedShape.closestPointTo.lambda24", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2118 * return ps[0][0] * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< @@ -67080,7 +71151,7 @@ static PyObject *__pyx_lambda_funcdef_lambda23(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_15_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *__pyx_cur_scope; PyObject *__pyx_v_ps = NULL; PyObject *__pyx_v_colls = NULL; PyObject *__pyx_v_calculate = 0; @@ -67093,16 +71164,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_v_olns = NULL; PyObject *__pyx_v_slns = NULL; PyObject *__pyx_v_oln = NULL; - PyObject *__pyx_9genexpr34__pyx_v_i = NULL; - PyObject *__pyx_9genexpr35__pyx_v_p = NULL; - PyObject *__pyx_9genexpr36__pyx_v_ln = NULL; - PyObject *__pyx_9genexpr37__pyx_v_i = NULL; - PyObject *__pyx_9genexpr38__pyx_v_i = NULL; - PyObject *__pyx_9genexpr39__pyx_v_oln = NULL; - PyObject *__pyx_9genexpr40__pyx_v_oln = NULL; - PyObject *__pyx_9genexpr41__pyx_v_ln = NULL; - PyObject *__pyx_9genexpr42__pyx_v_ln = NULL; - PyObject *__pyx_9genexpr43__pyx_v_i = NULL; + PyObject *__pyx_9genexpr36__pyx_v_i = NULL; + PyObject *__pyx_9genexpr37__pyx_v_p = NULL; + PyObject *__pyx_9genexpr38__pyx_v_ln = NULL; + PyObject *__pyx_9genexpr39__pyx_v_i = NULL; + PyObject *__pyx_9genexpr40__pyx_v_i = NULL; + PyObject *__pyx_9genexpr41__pyx_v_oln = NULL; + PyObject *__pyx_9genexpr42__pyx_v_oln = NULL; + PyObject *__pyx_9genexpr43__pyx_v_ln = NULL; + PyObject *__pyx_9genexpr44__pyx_v_ln = NULL; + PyObject *__pyx_9genexpr45__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -67123,11 +71194,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_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_17_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_17_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_17_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_17_closestPointTo *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1999, __pyx_L1_error) + __PYX_ERR(0, 2118, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -67138,25 +71209,28 @@ 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":2010 + /* "collisions.py":2129 * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape * """ - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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, 2010, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2129, __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, 2010, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2129, __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_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __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_5 = 1; @@ -67164,189 +71238,189 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2010, __pyx_L1_error) + __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, 2129, __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, 2010, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2011 + /* "collisions.py":2130 * """ - * if checkShpType(othershape, Point): + * 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: */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2011, __pyx_L6_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2130, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2130, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = 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); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __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, 2011, __pyx_L6_error) + 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, 2130, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __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, 2011, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2011, __pyx_L6_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2130, __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, 2130, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 2011, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2130, __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_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2011, __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, 2130, __pyx_L6_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, 2011, __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, 2130, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 2011, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2130, __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_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2011, __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, 2130, __pyx_L6_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, 2011, __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, 2130, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_2 = __pyx_t_8(__pyx_t_3); + __pyx_t_2 = __pyx_t_8(__pyx_t_4); 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, 2011, __pyx_L6_error) + else __PYX_ERR(0, 2130, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr36__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, 2011, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr36__pyx_v_i, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2130, __pyx_L6_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(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_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __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_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, 2011, __pyx_L6_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2130, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2011, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2130, __pyx_L6_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_i); __pyx_9genexpr34__pyx_v_i = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_i); __pyx_9genexpr36__pyx_v_i = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_i); __pyx_9genexpr34__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_i); __pyx_9genexpr36__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __pyx_v_ps = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2012 - * if checkShpType(othershape, Point): + /* "collisions.py":2131 + * 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, 2012, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ps, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_4lambda20, 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, 2012, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2131, __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, 2131, __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, 2012, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 2131, __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, 2012, __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, 2131, __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_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2013 + /* "collisions.py":2132 * 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, 2013, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2132, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2014 + /* "collisions.py":2133 * ps.sort(key=lambda x: abs(x[0]-othershape[0])**2+abs(x[1]-othershape[1])**2) * if returnAll: * return ps # <<<<<<<<<<<<<< * return ps[0] - * elif checkShpType(othershape, Line): + * elif checkShpType(othershape, ShpTyps.Line): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ps); __pyx_r = __pyx_v_ps; goto __pyx_L0; - /* "collisions.py":2013 + /* "collisions.py":2132 * 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: # <<<<<<<<<<<<<< @@ -67355,127 +71429,130 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2015 + /* "collisions.py":2134 * if returnAll: * return ps * return ps[0] # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Line): + * elif checkShpType(othershape, ShpTyps.Line): * 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, 2015, __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, 2134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2010 + /* "collisions.py":2129 * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape * """ - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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) */ } - /* "collisions.py":2016 + /* "collisions.py":2135 * return ps * return ps[0] - * elif checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * colls = self.whereCollides(othershape) * if colls != []: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2016, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2135, __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, 2135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_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 (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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__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_2)) __PYX_ERR(0, 2016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_3}; + __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, 2135, __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, 2016, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2017 + /* "collisions.py":2136 * return ps[0] - * elif checkShpType(othershape, Line): + * elif checkShpType(othershape, ShpTyps.Line): * colls = self.whereCollides(othershape) # <<<<<<<<<<<<<< * if colls != []: * if returnAll: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2136, __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_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2017, __pyx_L1_error) + 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, 2136, __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_v_colls = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2018 - * elif checkShpType(othershape, Line): + /* "collisions.py":2137 + * 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, 2018, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2018, __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, 2137, __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, 2018, __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, 2137, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":2019 + /* "collisions.py":2138 * 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, 2019, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2138, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2020 + /* "collisions.py":2139 * if colls != []: * if returnAll: * return colls # <<<<<<<<<<<<<< @@ -67487,7 +71564,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_r = __pyx_v_colls; goto __pyx_L0; - /* "collisions.py":2019 + /* "collisions.py":2138 * colls = self.whereCollides(othershape) * if colls != []: * if returnAll: # <<<<<<<<<<<<<< @@ -67496,7 +71573,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2021 + /* "collisions.py":2140 * if returnAll: * return colls * return colls[0] # <<<<<<<<<<<<<< @@ -67504,14 +71581,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * p2 = oln.closestPointTo(ln) */ __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, 2021, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __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, 2140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2018 - * elif checkShpType(othershape, Line): + /* "collisions.py":2137 + * elif checkShpType(othershape, ShpTyps.Line): * colls = self.whereCollides(othershape) * if colls != []: # <<<<<<<<<<<<<< * if returnAll: @@ -67519,19 +71596,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2022 + /* "collisions.py":2141 * return colls * return colls[0] * def calculate(ln, oln, recalculate): # <<<<<<<<<<<<<< * p2 = oln.closestPointTo(ln) * p = ln.closestPointTo(Point(*p2)) */ - __pyx_t_3 = __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__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_calculate = __pyx_t_3; - __pyx_t_3 = 0; + __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, 2141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_calculate = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":2032 + /* "collisions.py":2151 * tries = [ * calculate(othershape, p, False) for p in self.toLines() * ] + [ # <<<<<<<<<<<<<< @@ -67540,147 +71617,147 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ { /* enter inner scope */ - /* "collisions.py":2030 + /* "collisions.py":2149 * 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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2030, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2149, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_4); - /* "collisions.py":2031 + /* "collisions.py":2150 * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2031, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2150, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(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); + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { - 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, 2031, __pyx_L16_error) + 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, 2150, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __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, 2031, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2031, __pyx_L16_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2150, __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, 2150, __pyx_L16_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + 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, 2031, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2150, __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_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2031, __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, 2150, __pyx_L16_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, 2031, __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, 2150, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); #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_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2031, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2150, __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_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2031, __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, 2150, __pyx_L16_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, 2031, __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, 2150, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_2 = __pyx_t_8(__pyx_t_1); + __pyx_t_2 = __pyx_t_8(__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, 2031, __pyx_L16_error) + else __PYX_ERR(0, 2150, __pyx_L16_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_p, __pyx_t_2); + __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, 2031, __pyx_L16_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2150, __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, 2031, __pyx_L16_error); - __Pyx_INCREF(__pyx_9genexpr35__pyx_v_p); - __Pyx_GIVEREF(__pyx_9genexpr35__pyx_v_p); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_9genexpr35__pyx_v_p)) __PYX_ERR(0, 2031, __pyx_L16_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_othershape)) __PYX_ERR(0, 2150, __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, 2150, __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, 2031, __pyx_L16_error); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2031, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_False)) __PYX_ERR(0, 2150, __pyx_L16_error); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2150, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2030, __pyx_L16_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 2149, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_p); __pyx_9genexpr35__pyx_v_p = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_p); __pyx_9genexpr37__pyx_v_p = 0; goto __pyx_L20_exit_scope; __pyx_L16_error:; - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_p); __pyx_9genexpr35__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_p); __pyx_9genexpr37__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L20_exit_scope:; } /* exit inner scope */ { /* enter inner scope */ - /* "collisions.py":2032 + /* "collisions.py":2151 * tries = [ * calculate(othershape, p, False) for p in self.toLines() * ] + [ # <<<<<<<<<<<<<< * calculate(ln, othershape, True) for ln in self.toLines() * ] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2032, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2151, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); - /* "collisions.py":2033 + /* "collisions.py":2152 * 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, 2033, __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, 2152, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -67698,185 +71775,185 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __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_4)) __PYX_ERR(0, 2033, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2152, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_1); __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); + 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_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2033, __pyx_L23_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2152, __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, 2033, __pyx_L23_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2152, __pyx_L23_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; 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, 2033, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2152, __pyx_L23_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_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2033, __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, 2152, __pyx_L23_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2033, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2152, __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, 2033, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2152, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2033, __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, 2152, __pyx_L23_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2033, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2152, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_4 = __pyx_t_8(__pyx_t_2); - if (unlikely(!__pyx_t_4)) { + __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, 2033, __pyx_L23_error) + else __PYX_ERR(0, 2152, __pyx_L23_error) } break; } - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_9genexpr36__pyx_v_ln, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2033, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_9genexpr36__pyx_v_ln); - __Pyx_GIVEREF(__pyx_9genexpr36__pyx_v_ln); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_9genexpr36__pyx_v_ln)) __PYX_ERR(0, 2033, __pyx_L23_error); + __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, 2152, __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, 2152, __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_4, 1, __pyx_cur_scope->__pyx_v_othershape)) __PYX_ERR(0, 2033, __pyx_L23_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_othershape)) __PYX_ERR(0, 2152, __pyx_L23_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_True)) __PYX_ERR(0, 2033, __pyx_L23_error); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2033, __pyx_L23_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_True)) __PYX_ERR(0, 2152, __pyx_L23_error); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2152, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2032, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2151, __pyx_L23_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_ln); __pyx_9genexpr36__pyx_v_ln = 0; + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_ln); __pyx_9genexpr38__pyx_v_ln = 0; goto __pyx_L27_exit_scope; __pyx_L23_error:; - __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_ln); __pyx_9genexpr36__pyx_v_ln = 0; + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_ln); __pyx_9genexpr38__pyx_v_ln = 0; goto __pyx_L1_error; __pyx_L27_exit_scope:; } /* exit inner scope */ - /* "collisions.py":2032 + /* "collisions.py":2151 * 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_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2032, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2151, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tries = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2035 + /* "collisions.py":2154 * 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, 2035, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_5lambda21, 0, __pyx_n_s_ClosedShape_closestPointTo_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2035, __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, 2035, __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, 2035, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2154, __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, 2154, __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, 2154, __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, 2154, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2036 + /* "collisions.py":2155 * ] * 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, 2036, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2155, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2037 + /* "collisions.py":2156 * tries.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in tries] # <<<<<<<<<<<<<< * return tries[0][0] - * elif checkShpType(othershape, Circle): + * 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, 2037, __pyx_L31_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2156, __pyx_L31_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + 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, 2037, __pyx_L31_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2156, __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_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2037, __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, 2156, __pyx_L31_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, 2037, __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, 2156, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_2); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr37__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2037, __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, 2156, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2037, __pyx_L31_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2156, __pyx_L31_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_i); __pyx_9genexpr37__pyx_v_i = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_i); __pyx_9genexpr39__pyx_v_i = 0; goto __pyx_L35_exit_scope; __pyx_L31_error:; - __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_i); __pyx_9genexpr37__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_i); __pyx_9genexpr39__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L35_exit_scope:; } /* exit inner scope */ - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2036 + /* "collisions.py":2155 * ] * tries.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -67885,291 +71962,297 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2038 + /* "collisions.py":2157 * if returnAll: * return [i[0] for i in tries] * return tries[0][0] # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Circle): + * 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, 2038, __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, 2157, __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, 2157, __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, 2038, __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; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2016 + /* "collisions.py":2135 * return ps * return ps[0] - * elif checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * colls = self.whereCollides(othershape) * if colls != []: */ } - /* "collisions.py":2039 + /* "collisions.py":2158 * return [i[0] for i in tries] * return tries[0][0] - * elif checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2158, __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, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = NULL; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2158, __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; #if CYTHON_UNPACK_METHODS - if (unlikely(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); + if (unlikely(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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __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_1)) __PYX_ERR(0, 2039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_9}; + __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, 2158, __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_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2039, __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, 2158, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":2040 + /* "collisions.py":2159 * return tries[0][0] - * elif checkShpType(othershape, Circle): + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): * closests = [] */ __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, 2040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2040, __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, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2040, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2159, __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, 2159, __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, 2159, __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_9))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_4, __pyx_t_10}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_1, __pyx_t_10}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__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_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_9 = NULL; + __pyx_t_2 = NULL; __pyx_t_5 = 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); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_2, __pyx_v_returnAll}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __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_1)) __PYX_ERR(0, 2040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_9, __pyx_v_returnAll}; + __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, 2159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2039 + /* "collisions.py":2158 * return [i[0] for i in tries] * return tries[0][0] - * elif checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): */ } - /* "collisions.py":2041 - * elif checkShpType(othershape, Circle): + /* "collisions.py":2160 + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * closests = [] * for ln in self.toLines(): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2041, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2160, __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, 2160, __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, 2160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + 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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __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[3] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_othershape, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __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_1)) __PYX_ERR(0, 2041, __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, 2160, __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_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2041, __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, 2160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":2042 + /* "collisions.py":2161 * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): + * elif checkShpType(othershape, ShpTyps.Arc): * closests = [] # <<<<<<<<<<<<<< * for ln in self.toLines(): * cp = othershape.closestPointTo(ln) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_closests = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_closests = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":2043 - * elif checkShpType(othershape, Arc): + /* "collisions.py":2162 + * elif checkShpType(othershape, ShpTyps.Arc): * closests = [] * for ln in self.toLines(): # <<<<<<<<<<<<<< * cp = othershape.closestPointTo(ln) * mycp = self.closestPointTo(Point(*cp)) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2162, __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_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + 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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __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, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __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_1)) __PYX_ERR(0, 2043, __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, 2162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2043, __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, 2043, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2162, __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, 2162, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 2043, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2162, __pyx_L1_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_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2043, __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, 2162, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 2043, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2162, __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_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2043, __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, 2162, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif } } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __pyx_t_3 = __pyx_t_8(__pyx_t_4); + 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, 2043, __pyx_L1_error) + else __PYX_ERR(0, 2162, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":2044 + /* "collisions.py":2163 * 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, 2044, __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, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -68187,30 +72270,30 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_ln}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __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_1)) __PYX_ERR(0, 2044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2163, __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_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_cp, __pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":2045 + /* "collisions.py":2164 * 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, 2045, __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, 2164, __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, 2045, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2164, __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, 2045, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_v_cp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2164, __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; __pyx_t_10 = NULL; @@ -68228,113 +72311,113 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_1}; + __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2164, __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_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_mycp, __pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":2046 + /* "collisions.py":2165 * 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_1 = __Pyx_GetItemInt(__pyx_v_cp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __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, 2046, __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, 2165, __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, 2165, __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, 2046, __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_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2165, __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_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2046, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mycp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2046, __pyx_L1_error) + __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, 2165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2046, __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, 2165, __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, 2165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __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_10, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 2165, __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_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2046, __pyx_L1_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __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; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2047 + /* "collisions.py":2166 * 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, 2047, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2166, __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, 2047, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_mycp)) __PYX_ERR(0, 2166, __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, 2047, __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, 2047, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_d)) __PYX_ERR(0, 2166, __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, 2166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2043 - * elif checkShpType(othershape, Arc): + /* "collisions.py":2162 + * elif checkShpType(othershape, ShpTyps.Arc): * closests = [] * for ln in self.toLines(): # <<<<<<<<<<<<<< * cp = othershape.closestPointTo(ln) * mycp = self.closestPointTo(Point(*cp)) */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2048 + /* "collisions.py":2167 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_closests, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2048, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_closests, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_6lambda22, 0, __pyx_n_s_ClosedShape_closestPointTo_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_key, __pyx_t_1) < 0) __PYX_ERR(0, 2048, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 2167, __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, 2167, __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, 2167, __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_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2049 + /* "collisions.py":2168 * 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, 2049, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2168, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2050 + /* "collisions.py":2169 * closests.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in closests] # <<<<<<<<<<<<<< @@ -68343,44 +72426,44 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2050, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2169, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __pyx_v_closests; __Pyx_INCREF(__pyx_t_10); __pyx_t_7 = 0; for (;;) { { 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, 2050, __pyx_L42_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2169, __pyx_L42_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, 2050, __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, 2169, __pyx_L42_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, 2050, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2169, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_4); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_i, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_9genexpr38__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2050, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2050, __pyx_L42_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 2169, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2169, __pyx_L42_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_i); __pyx_9genexpr38__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_i); __pyx_9genexpr40__pyx_v_i = 0; goto __pyx_L46_exit_scope; __pyx_L42_error:; - __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_i); __pyx_9genexpr38__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_i); __pyx_9genexpr40__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L46_exit_scope:; } /* exit inner scope */ - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2049 + /* "collisions.py":2168 * closests.append((mycp, d)) * closests.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -68389,7 +72472,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2051 + /* "collisions.py":2170 * if returnAll: * return [i[0] for i in closests] * return closests[0][0] # <<<<<<<<<<<<<< @@ -68397,25 +72480,25 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * colls = self.whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_closests, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2051, __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, 2170, __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, 2170, __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_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "collisions.py":2041 - * elif checkShpType(othershape, Circle): + /* "collisions.py":2160 + * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * closests = [] * for ln in self.toLines(): */ } - /* "collisions.py":2053 + /* "collisions.py":2172 * return closests[0][0] * else: * colls = self.whereCollides(othershape) # <<<<<<<<<<<<<< @@ -68423,59 +72506,59 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * if returnAll: */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 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); + 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_1, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_othershape}; - __pyx_t_10 = __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_10)) __PYX_ERR(0, 2053, __pyx_L1_error) + 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, 2172, __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_v_colls = __pyx_t_10; __pyx_t_10 = 0; - /* "collisions.py":2054 + /* "collisions.py":2173 * 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, 2054, __pyx_L1_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __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, 2173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2054, __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, 2173, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":2055 + /* "collisions.py":2174 * 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, 2055, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2174, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2056 + /* "collisions.py":2175 * if colls != []: * if returnAll: * return colls # <<<<<<<<<<<<<< @@ -68487,7 +72570,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_r = __pyx_v_colls; goto __pyx_L0; - /* "collisions.py":2055 + /* "collisions.py":2174 * colls = self.whereCollides(othershape) * if colls != []: * if returnAll: # <<<<<<<<<<<<<< @@ -68496,7 +72579,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2057 + /* "collisions.py":2176 * if returnAll: * return colls * return colls[0] # <<<<<<<<<<<<<< @@ -68504,13 +72587,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * p2 = ln.closestPointTo(Point(*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, 2057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __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, 2176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2054 + /* "collisions.py":2173 * else: * colls = self.whereCollides(othershape) * if colls != []: # <<<<<<<<<<<<<< @@ -68519,47 +72602,47 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2058 + /* "collisions.py":2177 * 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_11ClosedShape_14closestPointTo_3calculate, 0, __pyx_n_s_ClosedShape_closestPointTo_local_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_calculate = __pyx_t_1; - __pyx_t_1 = 0; + __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, 2177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_calculate = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":2065 + /* "collisions.py":2184 * 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_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2065, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_tries = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_tries = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":2066 + /* "collisions.py":2185 * 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, 2066, __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, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = NULL; + __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_3)) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; @@ -68567,33 +72650,33 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2066, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + 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, 2185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_v_olns = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_olns = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":2067 + /* "collisions.py":2186 * 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, 2067, __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, 2186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = NULL; + __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_3)) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; @@ -68601,17 +72684,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + 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, 2186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_v_slns = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_slns = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":2068 + /* "collisions.py":2187 * olns = othershape.toLines() * slns = self.toLines() * for ln in slns: # <<<<<<<<<<<<<< @@ -68619,52 +72702,52 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * tries.extend([calculate(ln, oln.p2, False) for oln in olns]) */ if (likely(PyList_CheckExact(__pyx_v_slns)) || PyTuple_CheckExact(__pyx_v_slns)) { - __pyx_t_1 = __pyx_v_slns; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_slns; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2068, __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, 2068, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2187, __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, 2187, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + 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, 2068, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2187, __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_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2068, __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, 2187, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2068, __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, 2187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #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_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2068, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2187, __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_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2068, __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, 2187, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2068, __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, 2187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } } else { - __pyx_t_10 = __pyx_t_8(__pyx_t_1); + __pyx_t_10 = __pyx_t_8(__pyx_t_3); 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, 2068, __pyx_L1_error) + else __PYX_ERR(0, 2187, __pyx_L1_error) } break; } @@ -68673,7 +72756,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":2069 + /* "collisions.py":2188 * slns = self.toLines() * for ln in slns: * tries.extend([calculate(ln, oln.p1, False) for oln in olns]) # <<<<<<<<<<<<<< @@ -68681,93 +72764,93 @@ 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, 2069, __pyx_L53_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2188, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_v_olns)) || PyTuple_CheckExact(__pyx_v_olns)) { - __pyx_t_3 = __pyx_v_olns; __Pyx_INCREF(__pyx_t_3); + __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_3 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2069, __pyx_L53_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2069, __pyx_L53_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2188, __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, 2188, __pyx_L53_error) } for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 2069, __pyx_L53_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2188, __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_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2069, __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, 2188, __pyx_L53_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __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, 2188, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 2069, __pyx_L53_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2188, __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_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2069, __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, 2188, __pyx_L53_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __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, 2188, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_2 = __pyx_t_14(__pyx_t_3); + __pyx_t_2 = __pyx_t_14(__pyx_t_4); 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, 2069, __pyx_L53_error) + else __PYX_ERR(0, 2188, __pyx_L53_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_oln, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr41__pyx_v_oln, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr39__pyx_v_oln, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __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, 2188, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2069, __pyx_L53_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __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_4, 0, __pyx_v_ln)) __PYX_ERR(0, 2069, __pyx_L53_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ln)) __PYX_ERR(0, 2188, __pyx_L53_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L53_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L53_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_False)) __PYX_ERR(0, 2069, __pyx_L53_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_False)) __PYX_ERR(0, 2188, __pyx_L53_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L53_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2069, __pyx_L53_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2188, __pyx_L53_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_oln); __pyx_9genexpr39__pyx_v_oln = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_oln); __pyx_9genexpr41__pyx_v_oln = 0; goto __pyx_L57_exit_scope; __pyx_L53_error:; - __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_oln); __pyx_9genexpr39__pyx_v_oln = 0; + __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_oln); __pyx_9genexpr41__pyx_v_oln = 0; 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, 2069, __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, 2188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2070 + /* "collisions.py":2189 * 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]) # <<<<<<<<<<<<<< @@ -68775,93 +72858,93 @@ 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, 2070, __pyx_L60_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2189, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_v_olns)) || PyTuple_CheckExact(__pyx_v_olns)) { - __pyx_t_3 = __pyx_v_olns; __Pyx_INCREF(__pyx_t_3); + __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_3 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2070, __pyx_L60_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2070, __pyx_L60_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2189, __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, 2189, __pyx_L60_error) } for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 2070, __pyx_L60_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2189, __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_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2070, __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, 2189, __pyx_L60_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2070, __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, 2189, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 2070, __pyx_L60_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2189, __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_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2070, __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, 2189, __pyx_L60_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2070, __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, 2189, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_2 = __pyx_t_14(__pyx_t_3); + __pyx_t_2 = __pyx_t_14(__pyx_t_4); 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, 2070, __pyx_L60_error) + else __PYX_ERR(0, 2189, __pyx_L60_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr40__pyx_v_oln, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr42__pyx_v_oln, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr40__pyx_v_oln, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2070, __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, 2189, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2070, __pyx_L60_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __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_4, 0, __pyx_v_ln)) __PYX_ERR(0, 2070, __pyx_L60_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ln)) __PYX_ERR(0, 2189, __pyx_L60_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2070, __pyx_L60_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2189, __pyx_L60_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_False)) __PYX_ERR(0, 2070, __pyx_L60_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_False)) __PYX_ERR(0, 2189, __pyx_L60_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2070, __pyx_L60_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2189, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2070, __pyx_L60_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2189, __pyx_L60_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_oln); __pyx_9genexpr40__pyx_v_oln = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_oln); __pyx_9genexpr42__pyx_v_oln = 0; goto __pyx_L64_exit_scope; __pyx_L60_error:; - __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_oln); __pyx_9genexpr40__pyx_v_oln = 0; + __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_oln); __pyx_9genexpr42__pyx_v_oln = 0; 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, 2070, __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, 2189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2068 + /* "collisions.py":2187 * olns = othershape.toLines() * slns = self.toLines() * for ln in slns: # <<<<<<<<<<<<<< @@ -68869,9 +72952,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * tries.extend([calculate(ln, oln.p2, False) for oln in olns]) */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2071 + /* "collisions.py":2190 * 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: # <<<<<<<<<<<<<< @@ -68879,52 +72962,52 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * tries.extend([calculate(oln, ln.p2, True) for ln in slns]) */ if (likely(PyList_CheckExact(__pyx_v_olns)) || PyTuple_CheckExact(__pyx_v_olns)) { - __pyx_t_1 = __pyx_v_olns; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_olns; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2071, __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, 2071, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2190, __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, 2190, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + 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, 2071, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2190, __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_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2071, __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, 2190, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2071, __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, 2190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #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_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2071, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2190, __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_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2071, __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, 2190, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2071, __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, 2190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } } else { - __pyx_t_10 = __pyx_t_8(__pyx_t_1); + __pyx_t_10 = __pyx_t_8(__pyx_t_3); 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, 2071, __pyx_L1_error) + else __PYX_ERR(0, 2190, __pyx_L1_error) } break; } @@ -68933,7 +73016,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":2072 + /* "collisions.py":2191 * 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]) # <<<<<<<<<<<<<< @@ -68941,93 +73024,93 @@ 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, 2072, __pyx_L70_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2191, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_v_slns)) || PyTuple_CheckExact(__pyx_v_slns)) { - __pyx_t_3 = __pyx_v_slns; __Pyx_INCREF(__pyx_t_3); + __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_3 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2072, __pyx_L70_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2072, __pyx_L70_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2191, __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, 2191, __pyx_L70_error) } for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 2072, __pyx_L70_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2191, __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_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2072, __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, 2191, __pyx_L70_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2072, __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, 2191, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 2072, __pyx_L70_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2191, __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_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2072, __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, 2191, __pyx_L70_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2072, __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, 2191, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_2 = __pyx_t_14(__pyx_t_3); + __pyx_t_2 = __pyx_t_14(__pyx_t_4); 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, 2072, __pyx_L70_error) + else __PYX_ERR(0, 2191, __pyx_L70_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr41__pyx_v_ln, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_ln, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr41__pyx_v_ln, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2072, __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, 2191, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2072, __pyx_L70_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2191, __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_4, 0, __pyx_v_oln)) __PYX_ERR(0, 2072, __pyx_L70_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_oln)) __PYX_ERR(0, 2191, __pyx_L70_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2072, __pyx_L70_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2191, __pyx_L70_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_True)) __PYX_ERR(0, 2072, __pyx_L70_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_True)) __PYX_ERR(0, 2191, __pyx_L70_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2072, __pyx_L70_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2191, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2072, __pyx_L70_error) + __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_L70_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_ln); __pyx_9genexpr41__pyx_v_ln = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_ln); __pyx_9genexpr43__pyx_v_ln = 0; goto __pyx_L74_exit_scope; __pyx_L70_error:; - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_ln); __pyx_9genexpr41__pyx_v_ln = 0; + __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_ln); __pyx_9genexpr43__pyx_v_ln = 0; 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, 2072, __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, 2191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2073 + /* "collisions.py":2192 * 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]) # <<<<<<<<<<<<<< @@ -69035,93 +73118,93 @@ 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, 2073, __pyx_L77_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2192, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_v_slns)) || PyTuple_CheckExact(__pyx_v_slns)) { - __pyx_t_3 = __pyx_v_slns; __Pyx_INCREF(__pyx_t_3); + __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_3 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2073, __pyx_L77_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2073, __pyx_L77_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2192, __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, 2192, __pyx_L77_error) } for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 2073, __pyx_L77_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2192, __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_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2073, __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, 2192, __pyx_L77_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2073, __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, 2192, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 2073, __pyx_L77_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2192, __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_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2073, __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, 2192, __pyx_L77_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2073, __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, 2192, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_2 = __pyx_t_14(__pyx_t_3); + __pyx_t_2 = __pyx_t_14(__pyx_t_4); 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, 2073, __pyx_L77_error) + else __PYX_ERR(0, 2192, __pyx_L77_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr42__pyx_v_ln, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_ln, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr42__pyx_v_ln, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2073, __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, 2192, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2073, __pyx_L77_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __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_4, 0, __pyx_v_oln)) __PYX_ERR(0, 2073, __pyx_L77_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_oln)) __PYX_ERR(0, 2192, __pyx_L77_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2073, __pyx_L77_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2192, __pyx_L77_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_True)) __PYX_ERR(0, 2073, __pyx_L77_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_True)) __PYX_ERR(0, 2192, __pyx_L77_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2073, __pyx_L77_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2192, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2073, __pyx_L77_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2192, __pyx_L77_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_ln); __pyx_9genexpr42__pyx_v_ln = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_ln); __pyx_9genexpr44__pyx_v_ln = 0; goto __pyx_L81_exit_scope; __pyx_L77_error:; - __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_ln); __pyx_9genexpr42__pyx_v_ln = 0; + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_ln); __pyx_9genexpr44__pyx_v_ln = 0; 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, 2073, __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, 2192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2071 + /* "collisions.py":2190 * 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: # <<<<<<<<<<<<<< @@ -69129,40 +73212,40 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * tries.extend([calculate(oln, ln.p2, True) for ln in slns]) */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2074 + /* "collisions.py":2193 * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2074, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_7lambda23, 0, __pyx_n_s_ClosedShape_closestPointTo_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2074, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2193, __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, 2074, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2193, __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, 2193, __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, 2193, __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, 2193, __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_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2074, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2075 + /* "collisions.py":2194 * 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, 2075, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2194, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2076 + /* "collisions.py":2195 * tries.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in tries] # <<<<<<<<<<<<<< @@ -69171,44 +73254,44 @@ 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, 2076, __pyx_L86_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2195, __pyx_L86_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_10); __pyx_t_7 = 0; for (;;) { { 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, 2076, __pyx_L86_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2195, __pyx_L86_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_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2076, __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, 2195, __pyx_L86_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L86_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2195, __pyx_L86_error) + __Pyx_GOTREF(__pyx_t_3); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_i, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr43__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L86_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 2076, __pyx_L86_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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, 2195, __pyx_L86_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2195, __pyx_L86_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_i); __pyx_9genexpr43__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_i); __pyx_9genexpr45__pyx_v_i = 0; goto __pyx_L90_exit_scope; __pyx_L86_error:; - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_i); __pyx_9genexpr43__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_i); __pyx_9genexpr45__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L90_exit_scope:; } /* exit inner scope */ - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2075 + /* "collisions.py":2194 * tries.extend([calculate(oln, ln.p2, True) for ln in slns]) * tries.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -69217,7 +73300,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2077 + /* "collisions.py":2196 * if returnAll: * return [i[0] for i in tries] * return tries[0][0] # <<<<<<<<<<<<<< @@ -69225,17 +73308,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * def handleCollisionsPos(self, */ __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, 2077, __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, 2077, __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, 2196, __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, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; } - /* "collisions.py":1999 + /* "collisions.py":2118 * return ps[0][0] * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< @@ -69267,23 +73350,23 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __Pyx_XDECREF(__pyx_v_olns); __Pyx_XDECREF(__pyx_v_slns); __Pyx_XDECREF(__pyx_v_oln); - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_ln); - __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_oln); - __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_oln); - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_ln); - __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_ln); - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_ln); + __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_oln); + __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_oln); + __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_ln); + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_ln); + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_i); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2079 +/* "collisions.py":2198 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -69291,7 +73374,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * newShp: 'ClosedShape', */ -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; @@ -69302,42 +73385,42 @@ static PyObject *__pyx_pf_10collisions_52__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":2086 + /* "collisions.py":2205 * 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, 2079, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_vel); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 2079, __pyx_L1_error); + __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, 2198, __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, 2079, __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_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2079, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 2198, __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, 2198, __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, 2079, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 2198, __pyx_L1_error); - /* "collisions.py":2079 + /* "collisions.py":2198 * 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, 2079, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2198, __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, 2079, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2198, __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, 2079, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 2198, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -69401,7 +73484,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_defaults17 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self); + __pyx_defaults18 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults18, __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); @@ -69435,7 +73518,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2198, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -69443,9 +73526,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2198, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 2079, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 2198, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -69453,9 +73536,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2198, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 2079, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 2198, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -69463,42 +73546,42 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2198, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 2079, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 2198, __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, 2079, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2198, __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, 2079, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2198, __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, 2079, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2198, __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, 2079, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2198, __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, 2079, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 2198, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -69529,7 +73612,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, 2079, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 2198, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -69556,7 +73639,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":2124 +/* "collisions.py":2243 * hit = False * for oldLine, newLine in zip(oldShp.toLines(), newShp.toLines()): * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< @@ -69565,15 +73648,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_lambda24(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_lambda25(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_11ClosedShape_19handleCollisionsPos_lambda24 = {"lambda24", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_lambda24, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_lambda24(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_lambda25 = {"lambda25", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_lambda25, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_lambda25(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -69591,7 +73674,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda24 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda25 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -69617,12 +73700,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2124, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2243, __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, 2124, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda25") < 0)) __PYX_ERR(0, 2243, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -69633,7 +73716,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, 2124, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda25", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2243, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -69643,11 +73726,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda24", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda25", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda24(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda25(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -69660,16 +73743,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda24(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_lambda_funcdef_lambda25(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("lambda24", 1); + __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, 2124, __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, 2243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -69678,7 +73761,7 @@ static PyObject *__pyx_lambda_funcdef_lambda24(CYTHON_UNUSED PyObject *__pyx_sel /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda24", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda25", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -69686,7 +73769,7 @@ static PyObject *__pyx_lambda_funcdef_lambda24(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2125 +/* "collisions.py":2244 * 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])) # <<<<<<<<<<<<<< @@ -69695,15 +73778,15 @@ static PyObject *__pyx_lambda_funcdef_lambda24(CYTHON_UNUSED PyObject *__pyx_sel */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_1lambda25(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_1lambda26(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_11ClosedShape_19handleCollisionsPos_1lambda25 = {"lambda25", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_1lambda25, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_1lambda25(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_1lambda26 = {"lambda26", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_1lambda26, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_1lambda26(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -69721,7 +73804,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda25 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda26 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -69747,12 +73830,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2125, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2244, __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, 2125, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda26") < 0)) __PYX_ERR(0, 2244, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -69763,7 +73846,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, 2125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda26", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2244, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -69773,11 +73856,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda25", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda26", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda25(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda26(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -69790,16 +73873,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda25(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_lambda_funcdef_lambda26(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("lambda25", 1); + __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, 2125, __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, 2244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -69808,7 +73891,7 @@ static PyObject *__pyx_lambda_funcdef_lambda25(CYTHON_UNUSED PyObject *__pyx_sel /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda25", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda26", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -69816,7 +73899,7 @@ static PyObject *__pyx_lambda_funcdef_lambda25(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2149 +/* "collisions.py":2268 * return oldShp, [0, 0] * * points.sort(key=lambda x: (x[3], x[4])) # <<<<<<<<<<<<<< @@ -69825,15 +73908,15 @@ static PyObject *__pyx_lambda_funcdef_lambda25(CYTHON_UNUSED PyObject *__pyx_sel */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_2lambda26(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_2lambda27(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_11ClosedShape_19handleCollisionsPos_2lambda26 = {"lambda26", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_2lambda26, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_2lambda26(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_2lambda27 = {"lambda27", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_2lambda27, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_2lambda27(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -69851,7 +73934,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda26 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda27 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -69877,12 +73960,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2149, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2268, __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, 2149, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda27") < 0)) __PYX_ERR(0, 2268, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -69893,7 +73976,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, 2149, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda27", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2268, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -69903,11 +73986,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda26", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda27", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda26(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda27(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -69920,7 +74003,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda26(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_lambda_funcdef_lambda27(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -69929,18 +74012,18 @@ static PyObject *__pyx_lambda_funcdef_lambda26(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda26", 1); + __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, 2149, __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, 2268, __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, 2149, __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, 2268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2149, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2268, __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, 2149, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2268, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2149, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2268, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -69952,7 +74035,7 @@ static PyObject *__pyx_lambda_funcdef_lambda26(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda26", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda27", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -69960,24 +74043,24 @@ static PyObject *__pyx_lambda_funcdef_lambda26(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2168 - * 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 +/* "collisions.py":2290 + * 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 */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_3lambda27(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_3lambda28(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_11ClosedShape_19handleCollisionsPos_3lambda27 = {"lambda27", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_3lambda27, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_3lambda27(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_3lambda28 = {"lambda28", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_3lambda28, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_19handleCollisionsPos_3lambda28(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -69995,7 +74078,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda27 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda28 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -70021,12 +74104,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2168, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2290, __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, 2168, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda28") < 0)) __PYX_ERR(0, 2290, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -70037,7 +74120,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, 2168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda28", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2290, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -70047,11 +74130,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda27", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda28", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda27(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda28(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -70064,16 +74147,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda27(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_lambda_funcdef_lambda28(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("lambda27", 1); + __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, 2168, __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, 2290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -70082,7 +74165,7 @@ static PyObject *__pyx_lambda_funcdef_lambda27(CYTHON_UNUSED PyObject *__pyx_sel /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda27", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.handleCollisionsPos.lambda28", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -70090,7 +74173,7 @@ static PyObject *__pyx_lambda_funcdef_lambda27(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2079 +/* "collisions.py":2198 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -70114,8 +74197,8 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_v_newPoint = NULL; PyObject *__pyx_v_thisNormal = NULL; PyObject *__pyx_v_paralell = NULL; - PyObject *__pyx_v_cLines = NULL; PyObject *__pyx_v_thisIsOnP = NULL; + PyObject *__pyx_v_cLines = NULL; PyObject *__pyx_v_cLine = NULL; PyObject *__pyx_v_sortedOtherLn = NULL; PyObject *__pyx_v_otherLnNormal = NULL; @@ -70134,8 +74217,8 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_v_intermediateObj = NULL; PyObject *__pyx_v_out = NULL; PyObject *__pyx_v_outvel = NULL; - PyObject *__pyx_9genexpr44__pyx_v_i = NULL; - PyObject *__pyx_9genexpr45__pyx_v_i = NULL; + PyObject *__pyx_9genexpr46__pyx_v_i = NULL; + PyObject *__pyx_9genexpr47__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -70167,14 +74250,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_RefNannySetupContext("handleCollisionsPos", 0); __Pyx_INCREF(__pyx_v_vel); - /* "collisions.py":2112 + /* "collisions.py":2231 * """ * # 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, 2112, __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, 2231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -70194,22 +74277,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, 2112, __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_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2112, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":2113 + /* "collisions.py":2232 * # 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, 2113, __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, 2232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -70229,25 +74312,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, 2113, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2232, __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, 2113, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":2114 + /* "collisions.py":2233 * 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, 2114, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2233, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2115 + /* "collisions.py":2234 * if newShp.collides(objs): * if verbose: * return oldShp, [0, 0], [None, True] # <<<<<<<<<<<<<< @@ -70255,38 +74338,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, 2115, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2234, __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, 2115, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 2234, __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, 2115, __pyx_L1_error); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2115, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 2234, __pyx_L1_error); + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2234, __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, 2115, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2234, __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, 2115, __pyx_L1_error); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2115, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, Py_True)) __PYX_ERR(0, 2234, __pyx_L1_error); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2234, __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, 2115, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2234, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 2115, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 2234, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 2115, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 2234, __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":2114 + /* "collisions.py":2233 * if oldShp.collides(objs): * if newShp.collides(objs): * if verbose: # <<<<<<<<<<<<<< @@ -70295,7 +74378,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2116 + /* "collisions.py":2235 * if verbose: * return oldShp, [0, 0], [None, True] * return oldShp, [0, 0] # <<<<<<<<<<<<<< @@ -70303,27 +74386,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, 2116, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2235, __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, 2116, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 2235, __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, 2116, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2116, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 2235, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2235, __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, 2116, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2235, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 2116, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 2235, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2113 + /* "collisions.py":2232 * # 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): # <<<<<<<<<<<<<< @@ -70332,7 +74415,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2118 + /* "collisions.py":2237 * return oldShp, [0, 0] * else: * if verbose: # <<<<<<<<<<<<<< @@ -70340,10 +74423,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, 2118, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2237, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2119 + /* "collisions.py":2238 * else: * if verbose: * return newShp, vel, [None, False] # <<<<<<<<<<<<<< @@ -70351,30 +74434,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, 2119, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2238, __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, 2119, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2238, __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, 2119, __pyx_L1_error); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2119, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, Py_False)) __PYX_ERR(0, 2238, __pyx_L1_error); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2238, __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, 2119, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newShp)) __PYX_ERR(0, 2238, __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, 2119, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 2238, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 2119, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 2238, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2118 + /* "collisions.py":2237 * return oldShp, [0, 0] * else: * if verbose: # <<<<<<<<<<<<<< @@ -70383,7 +74466,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2120 + /* "collisions.py":2239 * if verbose: * return newShp, vel, [None, False] * return newShp, vel # <<<<<<<<<<<<<< @@ -70391,20 +74474,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, 2120, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2239, __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, 2120, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newShp)) __PYX_ERR(0, 2239, __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, 2120, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 2239, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } - /* "collisions.py":2112 + /* "collisions.py":2231 * """ * # 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): # <<<<<<<<<<<<<< @@ -70413,19 +74496,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2121 + /* "collisions.py":2240 * 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, 2121, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_points = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2122 + /* "collisions.py":2241 * return newShp, vel * points = [] * hit = False # <<<<<<<<<<<<<< @@ -70434,14 +74517,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ __pyx_v_hit = 0; - /* "collisions.py":2123 + /* "collisions.py":2242 * 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, 2123, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_4 = 0; @@ -70461,11 +74544,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, 2123, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2242, __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, 2123, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newShp, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -70485,19 +74568,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, 2123, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2242, __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, 2123, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __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, 2123, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2242, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2123, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2242, __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, 2123, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2242, __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)) { @@ -70505,9 +74588,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, 2123, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __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, 2123, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2242, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -70516,28 +74599,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, 2123, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2242, __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, 2123, __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, 2242, __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, 2123, __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, 2242, __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, 2123, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2242, __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, 2123, __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, 2242, __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, 2123, __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, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -70547,7 +74630,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, 2123, __pyx_L1_error) + else __PYX_ERR(0, 2242, __pyx_L1_error) } break; } @@ -70559,7 +74642,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, 2123, __pyx_L1_error) + __PYX_ERR(0, 2242, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -70572,15 +74655,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, 2123, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2123, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2242, __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, 2123, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2242, __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); @@ -70588,7 +74671,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, 2123, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2242, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; @@ -70596,7 +74679,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, 2123, __pyx_L1_error) + __PYX_ERR(0, 2242, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_oldLine, __pyx_t_3); @@ -70604,114 +74687,114 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF_SET(__pyx_v_newLine, __pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2124 + /* "collisions.py":2243 * 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, 2124, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2243, __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, 2124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2243, __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, 2124, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2124, __pyx_L1_error) + __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2243, __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, 2124, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_6)) __PYX_ERR(0, 2243, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 2124, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 2243, __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, 2124, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2243, __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, 2124, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 2243, __pyx_L1_error); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2124, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_lambda24, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2124, __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, 2243, __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, 2124, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_key, __pyx_t_6) < 0) __PYX_ERR(0, 2243, __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, 2124, __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, 2243, __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, 2124, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2243, __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, 2124, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2243, __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":2125 + /* "collisions.py":2244 * 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, 2125, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2244, __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, 2125, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2244, __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, 2125, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2125, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2244, __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, 2125, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 2244, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2125, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2244, __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, 2125, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __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, 2125, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 2244, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2125, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_1lambda25, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2125, __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, 2244, __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, 2125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2244, __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, 2125, __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, 2244, __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, 2125, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2244, __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, 2125, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2244, __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":2126 + /* "collisions.py":2245 * 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, 2126, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2245, __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, 2126, __pyx_L1_error) + __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_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, 2126, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2245, __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, 2126, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2245, __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, 2126, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; __pyx_t_4 = 0; @@ -70735,14 +74818,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, 2126, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2245, __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":2127 + /* "collisions.py":2246 * 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: # <<<<<<<<<<<<<< @@ -70754,9 +74837,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, 2127, __pyx_L1_error) + __pyx_t_14 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2246, __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, 2127, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2246, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_15)) { @@ -70764,28 +74847,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, 2127, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2246, __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, 2127, __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, 2246, __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, 2127, __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, 2246, __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, 2127, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2246, __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, 2127, __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, 2246, __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, 2127, __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, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -70795,7 +74878,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, 2127, __pyx_L1_error) + else __PYX_ERR(0, 2246, __pyx_L1_error) } break; } @@ -70804,14 +74887,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2128 + /* "collisions.py":2247 * 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, 2128, __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, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -70831,15 +74914,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, 2128, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2247, __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, 2128, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "collisions.py":2129 + /* "collisions.py":2248 * for o in objs: * if o.collides(mvement): * hit = True # <<<<<<<<<<<<<< @@ -70848,14 +74931,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ __pyx_v_hit = 1; - /* "collisions.py":2130 + /* "collisions.py":2249 * 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, 2130, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -70875,14 +74958,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, 2130, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2249, __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, 2130, __pyx_L16_error) + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2249, __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, 2130, __pyx_L16_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2249, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -70902,7 +74985,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, 2130, __pyx_L16_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2249, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -70911,9 +74994,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, 2130, __pyx_L16_error) + __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2249, __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, 2130, __pyx_L16_error) + __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2249, __pyx_L16_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { @@ -70922,28 +75005,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, 2130, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2249, __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, 2130, __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, 2249, __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, 2130, __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, 2249, __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, 2130, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2249, __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, 2130, __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, 2249, __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, 2130, __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, 2249, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_11); #endif } @@ -70953,21 +75036,21 @@ 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, 2130, __pyx_L16_error) + else __PYX_ERR(0, 2249, __pyx_L16_error) } break; } __Pyx_GOTREF(__pyx_t_11); } - __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_i, __pyx_t_11); + __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, 2130, __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, 2249, __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, 2130, __pyx_L16_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_Point); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2249, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_18 = __Pyx_PySequence_Tuple(__pyx_9genexpr44__pyx_v_i); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2130, __pyx_L16_error) + __pyx_t_18 = __Pyx_PySequence_Tuple(__pyx_9genexpr46__pyx_v_i); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2249, __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, 2130, __pyx_L16_error) + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_18, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2249, __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; @@ -70990,32 +75073,32 @@ 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, 2130, __pyx_L16_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2249, __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, 2130, __pyx_L16_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2249, __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_9genexpr44__pyx_v_i))) __PYX_ERR(0, 2130, __pyx_L16_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_9genexpr46__pyx_v_i))) __PYX_ERR(0, 2249, __pyx_L16_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_i); __pyx_9genexpr44__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_i); __pyx_9genexpr46__pyx_v_i = 0; goto __pyx_L21_exit_scope; __pyx_L16_error:; - __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_i); __pyx_9genexpr44__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_i); __pyx_9genexpr46__pyx_v_i = 0; 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, 2130, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2249, __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":2131 + /* "collisions.py":2250 * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: # <<<<<<<<<<<<<< @@ -71027,9 +75110,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, 2131, __pyx_L1_error) + __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2250, __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, 2131, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2250, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_17)) { @@ -71037,28 +75120,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, 2131, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2250, __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, 2131, __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, 2250, __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, 2131, __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, 2250, __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, 2131, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2250, __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, 2131, __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, 2250, __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, 2131, __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, 2250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); #endif } @@ -71068,7 +75151,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, 2131, __pyx_L1_error) + else __PYX_ERR(0, 2250, __pyx_L1_error) } break; } @@ -71077,20 +75160,20 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2132 + /* "collisions.py":2251 * 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, 2132, __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, 2251, __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, 2132, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Point); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2251, __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, 2132, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2251, __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, 2132, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2251, __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; @@ -71113,15 +75196,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, 2132, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2251, __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, 2132, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_5) { - /* "collisions.py":2133 + /* "collisions.py":2252 * for p in ps: * if oldShp.collides(Point(*p)): * continue # <<<<<<<<<<<<<< @@ -71130,7 +75213,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ goto __pyx_L22_continue; - /* "collisions.py":2132 + /* "collisions.py":2251 * 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)): # <<<<<<<<<<<<<< @@ -71139,39 +75222,39 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2135 + /* "collisions.py":2254 * 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, 2135, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2254, __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, 2135, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2254, __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, 2135, __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, 2254, __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, 2135, __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, 2254, __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, 2135, __pyx_L1_error) + __pyx_t_13 = PyNumber_Subtract(__pyx_t_11, __pyx_t_18); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2254, __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, 2135, __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, 2254, __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, 2135, __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, 2254, __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, 2135, __pyx_L1_error) + __pyx_t_20 = PyNumber_Subtract(__pyx_t_18, __pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2254, __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, 2135, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2254, __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, 2135, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13)) __PYX_ERR(0, 2254, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_20); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_20)) __PYX_ERR(0, 2135, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_20)) __PYX_ERR(0, 2254, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_20 = 0; __pyx_t_20 = NULL; @@ -71193,7 +75276,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, 2135, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -71216,173 +75299,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, 2135, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2254, __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":2136 + /* "collisions.py":2255 * # 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, 2136, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2255, __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, 2136, __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, 2255, __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, 2136, __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, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_19 = PyNumber_Subtract(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_12 = PyNumber_Power(__pyx_t_19, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2255, __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, 2136, __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, 2255, __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, 2136, __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, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_19 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2255, __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, 2136, __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, 2255, __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, 2136, __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, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_19 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2255, __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, 2136, __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, 2255, __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, 2136, __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, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_12 = PyNumber_Subtract(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_19 = PyNumber_Power(__pyx_t_12, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2255, __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, 2136, __pyx_L1_error) + __pyx_t_12 = PyNumber_Add(__pyx_t_3, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2255, __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":2137 + /* "collisions.py":2256 * 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, 2137, __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, 2256, __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, 2137, __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, 2256, __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, 2137, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error) + __pyx_t_19 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2256, __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, 2137, __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, 2256, __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, 2137, __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, 2256, __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, 2137, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error) + __pyx_t_12 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_precision)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_pdists)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error); - __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_12, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2137, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_precision)) __PYX_ERR(0, 2256, __pyx_L1_error); + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_12, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error) + __pyx_t_12 = PyList_New(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_v_p)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_v_o)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 2, __pyx_v_cPoint)) __PYX_ERR(0, 2256, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_6)) __PYX_ERR(0, 2137, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_6)) __PYX_ERR(0, 2256, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_19); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_19)) __PYX_ERR(0, 2137, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_19)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 5, __pyx_v_oldLine)) __PYX_ERR(0, 2256, __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, 2137, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 6, __pyx_v_newLine)) __PYX_ERR(0, 2256, __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, 2137, __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, 2256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2131 + /* "collisions.py":2250 * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: # <<<<<<<<<<<<<< @@ -71393,7 +75476,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2128 + /* "collisions.py":2247 * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) * for o in objs: * if o.collides(mvement): # <<<<<<<<<<<<<< @@ -71402,7 +75485,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2127 + /* "collisions.py":2246 * 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: # <<<<<<<<<<<<<< @@ -71412,7 +75495,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2123 + /* "collisions.py":2242 * points = [] * hit = False * for oldLine, newLine in zip(oldShp.toLines(), newShp.toLines()): # <<<<<<<<<<<<<< @@ -71422,7 +75505,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2139 + /* "collisions.py":2258 * 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: # <<<<<<<<<<<<<< @@ -71432,17 +75515,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_5 = (!__pyx_v_hit); if (__pyx_t_5) { - /* "collisions.py":2140 + /* "collisions.py":2259 * #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, 2140, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2259, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2141 + /* "collisions.py":2260 * if not hit: * if verbose: * return newShp, vel, [None, False] # <<<<<<<<<<<<<< @@ -71450,30 +75533,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, 2141, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2260, __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, 2141, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_None)) __PYX_ERR(0, 2260, __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, 2141, __pyx_L1_error); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2141, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, Py_False)) __PYX_ERR(0, 2260, __pyx_L1_error); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2260, __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, 2141, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_newShp)) __PYX_ERR(0, 2260, __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, 2141, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_vel)) __PYX_ERR(0, 2260, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1)) __PYX_ERR(0, 2141, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1)) __PYX_ERR(0, 2260, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":2140 + /* "collisions.py":2259 * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: * if verbose: # <<<<<<<<<<<<<< @@ -71482,7 +75565,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2142 + /* "collisions.py":2261 * if verbose: * return newShp, vel, [None, False] * return newShp, vel # <<<<<<<<<<<<<< @@ -71490,19 +75573,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, 2142, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2261, __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, 2142, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_newShp)) __PYX_ERR(0, 2261, __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, 2142, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_vel)) __PYX_ERR(0, 2261, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":2139 + /* "collisions.py":2258 * 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: # <<<<<<<<<<<<<< @@ -71511,32 +75594,32 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2144 + /* "collisions.py":2263 * 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, 2144, __pyx_L1_error) + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2263, __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, 2144, __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, 2263, __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, 2144, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":2145 + /* "collisions.py":2264 * # 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, 2145, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2264, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2146 + /* "collisions.py":2265 * if points == []: * if verbose: * return oldShp, [0, 0], [None, True] # <<<<<<<<<<<<<< @@ -71544,38 +75627,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, 2146, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2265, __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, 2146, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 2265, __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, 2146, __pyx_L1_error); - __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2146, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 2265, __pyx_L1_error); + __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2265, __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, 2146, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, Py_None)) __PYX_ERR(0, 2265, __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, 2146, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2146, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, Py_True)) __PYX_ERR(0, 2265, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2265, __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, 2146, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2265, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2146, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2265, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9)) __PYX_ERR(0, 2146, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9)) __PYX_ERR(0, 2265, __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":2145 + /* "collisions.py":2264 * # Don't let you move when you're in a wall * if points == []: * if verbose: # <<<<<<<<<<<<<< @@ -71584,7 +75667,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2147 + /* "collisions.py":2266 * if verbose: * return oldShp, [0, 0], [None, True] * return oldShp, [0, 0] # <<<<<<<<<<<<<< @@ -71592,27 +75675,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, 2147, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2266, __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, 2147, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0)) __PYX_ERR(0, 2266, __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, 2147, __pyx_L1_error); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2147, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_0)) __PYX_ERR(0, 2266, __pyx_L1_error); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2266, __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, 2147, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2266, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 2147, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 2266, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":2144 + /* "collisions.py":2263 * return newShp, vel * # Don't let you move when you're in a wall * if points == []: # <<<<<<<<<<<<<< @@ -71621,42 +75704,42 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2149 + /* "collisions.py":2268 * 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, 2149, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2149, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_2lambda26, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2149, __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, 2268, __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, 2149, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_1) < 0) __PYX_ERR(0, 2268, __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, 2149, __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, 2268, __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":2150 + /* "collisions.py":2269 * * 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, 2150, __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, 2269, __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, 2150, __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, 2269, __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, 2150, __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, 2269, __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, 2150, __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, 2269, __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); @@ -71664,84 +75747,84 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF_SET(__pyx_v_newLine, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2151 + /* "collisions.py":2270 * 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, 2151, __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, 2270, __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, 2151, __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, 2270, __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":2152 + /* "collisions.py":2271 * 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, 2152, __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, 2271, __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, 2152, __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, 2271, __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":2153 + /* "collisions.py":2272 * 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, 2153, __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, 2272, __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, 2153, __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, 2272, __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":2154 + /* "collisions.py":2273 * 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, 2154, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2273, __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, 2154, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Line); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2273, __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, 2154, __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, 2273, __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, 2154, __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, 2273, __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, 2154, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2273, __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, 2154, __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, 2273, __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, 2154, __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, 2273, __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, 2154, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2273, __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, 2154, __pyx_L1_error) + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2273, __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, 2154, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_3)) __PYX_ERR(0, 2273, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_11)) __PYX_ERR(0, 2154, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_11)) __PYX_ERR(0, 2273, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -71763,7 +75846,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, 2154, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } @@ -71786,55 +75869,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, 2154, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2273, __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":2156 + /* "collisions.py":2275 * 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 - * cLines = [] + * thisIsOnP = oldLine.isCorner(cPoint, precision) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2156, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2275, __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, 2156, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2275, __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, 2156, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2275, __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, 2156, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_atan2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2275, __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, 2156, __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, 2275, __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, 2156, __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, 2275, __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, 2156, __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, 2275, __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, 2156, __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, 2275, __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, 2156, __pyx_L1_error) + __pyx_t_12 = PyNumber_Subtract(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2275, __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, 2156, __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, 2275, __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, 2156, __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, 2275, __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, 2156, __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, 2275, __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, 2156, __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, 2275, __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, 2156, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2275, __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; @@ -71858,7 +75941,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, 2156, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } @@ -71881,43 +75964,31 @@ 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, 2156, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2275, __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":2157 + /* "collisions.py":2276 * * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) * paralell = False # <<<<<<<<<<<<<< - * cLines = [] * thisIsOnP = oldLine.isCorner(cPoint, precision) + * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): */ __Pyx_INCREF(Py_False); __pyx_v_paralell = Py_False; - /* "collisions.py":2158 + /* "collisions.py":2277 * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) * paralell = False - * cLines = [] # <<<<<<<<<<<<<< - * thisIsOnP = oldLine.isCorner(cPoint, precision) - * if checkShpType(closestObj, Line): - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_cLines = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "collisions.py":2159 - * paralell = False - * cLines = [] * thisIsOnP = oldLine.isCorner(cPoint, precision) # <<<<<<<<<<<<<< - * if checkShpType(closestObj, Line): - * cLines = [closestObj] + * 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, 2159, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -71937,88 +76008,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, 2159, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2277, __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":2160 - * cLines = [] - * thisIsOnP = oldLine.isCorner(cPoint, precision) - * if checkShpType(closestObj, 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, 2160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Line); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_19 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_19)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_19); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_v_closestObj, __pyx_t_9}; - __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, 2160, __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, 2160, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_5) { - - /* "collisions.py":2161 - * thisIsOnP = oldLine.isCorner(cPoint, precision) - * if checkShpType(closestObj, 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, 2161, __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, 2161, __pyx_L1_error); - __Pyx_DECREF_SET(__pyx_v_cLines, ((PyObject*)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "collisions.py":2160 - * cLines = [] + /* "collisions.py":2278 + * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) - * if checkShpType(closestObj, Line): # <<<<<<<<<<<<<< - * cLines = [closestObj] - * elif checkShpType(closestObj, ShpGroups.CLOSED): - */ - goto __pyx_L32; - } - - /* "collisions.py":2162 - * if checkShpType(closestObj, Line): - * cLines = [closestObj] - * elif checkShpType(closestObj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< - * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): + * 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, 2162, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2278, __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, 2162, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2278, __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, 2162, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_NOTSTRAIGHT); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -72040,586 +76048,734 @@ 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, 2162, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2278, __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, 2162, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "collisions.py":2163 - * cLines = [closestObj] - * elif checkShpType(closestObj, ShpGroups.CLOSED): - * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] # <<<<<<<<<<<<<< - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): - * paralell = True + /* "collisions.py":2279 + * thisIsOnP = oldLine.isCorner(cPoint, precision) + * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): + * paralell = not thisIsOnP # <<<<<<<<<<<<<< + * else: + * cLines = [] */ - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2163, __pyx_L35_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, 2163, __pyx_L35_error) - __Pyx_GOTREF(__pyx_t_19); - __pyx_t_9 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_19))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_19); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_19, function); - __pyx_t_4 = 1; - } - } - #endif - { - 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, 2163, __pyx_L35_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2279, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_2); + __pyx_t_2 = 0; + + /* "collisions.py":2278 + * paralell = False + * thisIsOnP = oldLine.isCorner(cPoint, precision) + * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): # <<<<<<<<<<<<<< + * paralell = not thisIsOnP + * else: + */ + goto __pyx_L32; + } + + /* "collisions.py":2281 + * paralell = not thisIsOnP + * else: + * cLines = [] # <<<<<<<<<<<<<< + * if checkShpType(closestObj, ShpTyps.Line): + * cLines = [closestObj] + */ + /*else*/ { + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_cLines = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "collisions.py":2282 + * 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, 2282, __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, 2282, __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, 2282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_19)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_19); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; } - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_19 = __pyx_t_1; __Pyx_INCREF(__pyx_t_19); - __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, 2163, __pyx_L35_error) - __Pyx_GOTREF(__pyx_t_19); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_19); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2163, __pyx_L35_error) + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_v_closestObj, __pyx_t_9}; + __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, 2282, __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, 2282, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "collisions.py":2283 + * 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, 2283, __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, 2283, __pyx_L1_error); + __Pyx_DECREF_SET(__pyx_v_cLines, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "collisions.py":2282 + * else: + * cLines = [] + * if checkShpType(closestObj, ShpTyps.Line): # <<<<<<<<<<<<<< + * cLines = [closestObj] + * elif checkShpType(closestObj, ShpGroups.CLOSED): + */ + goto __pyx_L33; + } + + /* "collisions.py":2284 + * 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, 2284, __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, 2284, __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, 2284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_19); + __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_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_4 = 1; } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_closestObj, __pyx_t_19}; + __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, 2284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_19))) { - { - 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, 2163, __pyx_L35_error) + } + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2284, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "collisions.py":2285 + * 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): + * paralell = True + */ + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2285, __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, 2285, __pyx_L36_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_9 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_19))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_19); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_19, function); + __pyx_t_4 = 1; + } + } + #endif + { + 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, 2285, __pyx_L36_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + } + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_19 = __pyx_t_1; __Pyx_INCREF(__pyx_t_19); + __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, 2285, __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, 2285, __pyx_L36_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_19))) { + { + 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, 2285, __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, 2285, __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, 2285, __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, 2285, __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, 2285, __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, 2285, __pyx_L36_error) + __Pyx_GOTREF(__pyx_t_1); #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, 2163, __pyx_L35_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, 2163, __pyx_L35_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, 2163, __pyx_L35_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; + __pyx_t_1 = __pyx_t_8(__pyx_t_19); + 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, 2285, __pyx_L36_error) + } + 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, 2163, __pyx_L35_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, 2163, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_1); - #endif } - } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_19); - 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, 2163, __pyx_L35_error) + __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, 2285, __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, 2285, __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, 2285, __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, 2285, __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; + __pyx_t_12 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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_4 = 1; } - break; } - __Pyx_GOTREF(__pyx_t_1); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_6}; + __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, 2285, __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, 2285, __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, 2285, __pyx_L36_error) + } + } + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_i); __pyx_9genexpr47__pyx_v_i = 0; + goto __pyx_L41_exit_scope; + __pyx_L36_error:; + __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_i); __pyx_9genexpr47__pyx_v_i = 0; + goto __pyx_L1_error; + __pyx_L41_exit_scope:; + } /* exit inner scope */ + __Pyx_DECREF_SET(__pyx_v_cLines, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "collisions.py":2284 + * 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): + */ + goto __pyx_L33; + } + + /* "collisions.py":2286 + * 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, 2286, __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, 2286, __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, 2286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __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_19))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_19); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_19, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_closestObj, __pyx_t_9}; + __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, 2286, __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, 2286, __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, 2286, __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":2287 + * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] + * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): + * paralell = True # <<<<<<<<<<<<<< + * if cLines != []: + * for cLine in cLines: + */ + __Pyx_INCREF(Py_True); + __Pyx_DECREF_SET(__pyx_v_paralell, Py_True); + + /* "collisions.py":2286 + * 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_L33:; + + /* "collisions.py":2288 + * 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, 2288, __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, 2288, __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, 2288, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + if (__pyx_t_5) { + + /* "collisions.py":2289 + * paralell = True + * 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])) + */ + __pyx_t_19 = __pyx_v_cLines; __Pyx_INCREF(__pyx_t_19); + __pyx_t_7 = 0; + for (;;) { + { + 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, 2289, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; } - __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_i, __pyx_t_1); + #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, 2289, __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, 2289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_XDECREF_SET(__pyx_v_cLine, __pyx_t_2); + __pyx_t_2 = 0; + + /* "collisions.py":2290 + * 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, 2290, __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, 2290, __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, 2290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2290, __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, 2290, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(0, 2290, __pyx_L1_error); + __pyx_t_9 = 0; __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr45__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2163, __pyx_L35_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2290, __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, 2290, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2290, __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, 2290, __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, 2163, __pyx_L35_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_v_closestP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2163, __pyx_L35_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, 2163, __pyx_L35_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2290, __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, 2290, __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, 2290, __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, 2290, __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":2291 + * 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, 2291, __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, 2291, __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, 2291, __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, 2291, __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, 2291, __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, 2291, __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, 2291, __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, 2291, __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, 2291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __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_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2291, __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, 2291, __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, 2291, __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, 2291, __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, 2291, __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; + __pyx_t_20 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_20)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_1, __pyx_t_11}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __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, 2291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } __pyx_t_12 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); + 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_9); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __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_1)) __PYX_ERR(0, 2163, __pyx_L35_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __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, 2163, __pyx_L35_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr45__pyx_v_i))) __PYX_ERR(0, 2163, __pyx_L35_error) + __Pyx_XDECREF_SET(__pyx_v_otherLnNormal, __pyx_t_9); + __pyx_t_9 = 0; + + /* "collisions.py":2292 + * 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, 2292, __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, 2292, __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, 2292, __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, 2292, __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, 2292, __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, 2292, __pyx_L1_error) + if (!__pyx_t_5) { + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else { + __Pyx_INCREF(__pyx_t_12); + __pyx_t_9 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L47_bool_binop_done; } - } - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_i); __pyx_9genexpr45__pyx_v_i = 0; - goto __pyx_L40_exit_scope; - __pyx_L35_error:; - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_i); __pyx_9genexpr45__pyx_v_i = 0; - goto __pyx_L1_error; - __pyx_L40_exit_scope:; - } /* exit inner scope */ - __Pyx_DECREF_SET(__pyx_v_cLines, ((PyObject*)__pyx_t_2)); - __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_otherLnNormal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2292, __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, 2292, __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, 2292, __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, 2292, __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, 2292, __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, 2292, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_9 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L47_bool_binop_done:; + __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_9); + __pyx_t_9 = 0; - /* "collisions.py":2162 - * if checkShpType(closestObj, Line): - * cLines = [closestObj] - * elif checkShpType(closestObj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< - * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): + /* "collisions.py":2293 + * 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 */ - goto __pyx_L32; - } + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2293, __pyx_L1_error) + if (__pyx_t_5) { - /* "collisions.py":2164 - * elif checkShpType(closestObj, ShpGroups.CLOSED): - * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< - * paralell = True - * if cLines != []: + /* "collisions.py":2294 + * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision + * if paralell: + * break # <<<<<<<<<<<<<< + * velDiff = 180 + * if paralell: # Line off line */ - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_19))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_19); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_19, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_closestObj, __pyx_t_1}; - __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; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2164, __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, 2164, __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_L41_bool_binop_done; - } - __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 2164, __pyx_L1_error) - __pyx_t_23 = (!__pyx_t_22); - __pyx_t_5 = __pyx_t_23; - __pyx_L41_bool_binop_done:; - if (__pyx_t_5) { + goto __pyx_L46_break; - /* "collisions.py":2165 - * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): - * paralell = True # <<<<<<<<<<<<<< - * if cLines != []: - * for cLine in cLines: + /* "collisions.py":2293 + * 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_INCREF(Py_True); - __Pyx_DECREF_SET(__pyx_v_paralell, Py_True); + } - /* "collisions.py":2164 - * elif checkShpType(closestObj, ShpGroups.CLOSED): - * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< - * paralell = True - * if cLines != []: + /* "collisions.py":2289 + * paralell = True + * 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])) */ + } + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L50_for_end; + __pyx_L46_break:; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L50_for_end; + __pyx_L50_for_end:; + + /* "collisions.py":2288 + * 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_L32:; - /* "collisions.py":2166 - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): - * paralell = True - * if cLines != []: # <<<<<<<<<<<<<< - * for cLine in cLines: - * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) + /* "collisions.py":2295 + * if paralell: + * break + * velDiff = 180 # <<<<<<<<<<<<<< + * if paralell: # Line off line + * collTyp = 3 */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2166, __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, 2166, __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, 2166, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_INCREF(__pyx_int_180); + __pyx_v_velDiff = __pyx_int_180; + + /* "collisions.py":2296 + * 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, 2296, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2167 - * paralell = True - * 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])) + /* "collisions.py":2297 + * 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) + * normal = thisNormal */ - __pyx_t_19 = __pyx_v_cLines; __Pyx_INCREF(__pyx_t_19); - __pyx_t_7 = 0; - for (;;) { - { - 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, 2167, __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, 2167, __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, 2167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - __Pyx_XDECREF_SET(__pyx_v_cLine, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_int_3); + __pyx_v_collTyp = __pyx_int_3; - /* "collisions.py":2168 - * 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 + /* "collisions.py":2299 + * 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 # <<<<<<<<<<<<<< + * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 + * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2168, __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, 2168, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_9)) __PYX_ERR(0, 2168, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2168, __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, 2168, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_3lambda27, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, __pyx_t_1) < 0) __PYX_ERR(0, 2168, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2168, __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_XDECREF_SET(__pyx_v_sortedOtherLn, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_thisNormal); + __pyx_v_normal = __pyx_v_thisNormal; - /* "collisions.py":2169 - * 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: + /* "collisions.py":2300 + * # 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_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2169, __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, 2169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_atan2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2169, __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, 2169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __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, 2169, __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, 2169, __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, 2169, __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, 2169, __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, 2169, __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; - __pyx_t_20 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_20)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_20); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_9, __pyx_t_11}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __pyx_t_12 = NULL; - __pyx_t_4 = 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_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_6}; - __pyx_t_1 = __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_1)) __PYX_ERR(0, 2169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_XDECREF_SET(__pyx_v_otherLnNormal, __pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":2170 - * 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, 2170, __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, 2170, __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, 2170, __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, 2170, __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, 2170, __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, 2170, __pyx_L1_error) - if (!__pyx_t_5) { - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else { - __Pyx_INCREF(__pyx_t_12); - __pyx_t_1 = __pyx_t_12; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - goto __pyx_L46_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, 2170, __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, 2170, __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, 2170, __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, 2170, __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, 2170, __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, 2170, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_L46_bool_binop_done:; - __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":2171 - * 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, 2171, __pyx_L1_error) - if (__pyx_t_5) { - - /* "collisions.py":2172 - * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision - * if paralell: - * break # <<<<<<<<<<<<<< - * velDiff = 180 - * if paralell: # Line off line - */ - goto __pyx_L45_break; - - /* "collisions.py":2171 - * 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 - */ - } - - /* "collisions.py":2167 - * paralell = True - * 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])) - */ - } - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - goto __pyx_L49_for_end; - __pyx_L45_break:; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - goto __pyx_L49_for_end; - __pyx_L49_for_end:; - - /* "collisions.py":2166 - * elif checkShpType(closestObj, Circle) and (not thisIsOnP): - * paralell = True - * if cLines != []: # <<<<<<<<<<<<<< - * for cLine in cLines: - * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) - */ - } - - /* "collisions.py":2173 - * if paralell: - * break - * velDiff = 180 # <<<<<<<<<<<<<< - * if paralell: # Line off line - * collTyp = 3 - */ - __Pyx_INCREF(__pyx_int_180); - __pyx_v_velDiff = __pyx_int_180; - - /* "collisions.py":2174 - * 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, 2174, __pyx_L1_error) - if (__pyx_t_5) { - - /* "collisions.py":2175 - * 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) - * normal = thisNormal - */ - __Pyx_INCREF(__pyx_int_3); - __pyx_v_collTyp = __pyx_int_3; - - /* "collisions.py":2177 - * 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 # <<<<<<<<<<<<<< - * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 - * else: - */ - __Pyx_INCREF(__pyx_v_thisNormal); - __pyx_v_normal = __pyx_v_thisNormal; - - /* "collisions.py":2178 - * # 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_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2178, __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, 2178, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2300, __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, 2300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2178, __pyx_L1_error) + __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, 2300, __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, 2178, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2300, __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, 2178, __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, 2300, __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, 2178, __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, 2300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2300, __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, 2178, __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, 2300, __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, 2178, __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, 2300, __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, 2178, __pyx_L1_error) + __pyx_t_20 = PyNumber_Subtract(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2300, __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; @@ -72638,13 +76794,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_9, __pyx_t_20}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_1, __pyx_t_20}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; @@ -72662,31 +76818,31 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1}; + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_9}; __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2178, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2300, __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, 2178, __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, 2300, __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":2174 - * break + /* "collisions.py":2296 + * 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) */ - goto __pyx_L50; + goto __pyx_L51; } - /* "collisions.py":2180 + /* "collisions.py":2302 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 * else: * otherIsOnP = closestObj.isCorner(closestP, precision) # <<<<<<<<<<<<<< @@ -72694,16 +76850,16 @@ 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, 2180, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_1 = NULL; + __pyx_t_9 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_19))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_19); - if (likely(__pyx_t_1)) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_19); + if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_19, function); __pyx_t_4 = 1; @@ -72711,35 +76867,35 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_closestP, __pyx_v_precision}; + 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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2180, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2302, __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":2181 + /* "collisions.py":2303 * 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, 2181, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2303, __pyx_L1_error) if (__pyx_t_23) { } else { __pyx_t_5 = __pyx_t_23; - goto __pyx_L52_bool_binop_done; + goto __pyx_L53_bool_binop_done; } - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2181, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2303, __pyx_L1_error) __pyx_t_5 = __pyx_t_23; - __pyx_L52_bool_binop_done:; + __pyx_L53_bool_binop_done:; if (__pyx_t_5) { - /* "collisions.py":2182 + /* "collisions.py":2304 * otherIsOnP = closestObj.isCorner(closestP, precision) * if thisIsOnP and otherIsOnP: # Point off point collision * collTyp = 0 # <<<<<<<<<<<<<< @@ -72749,7 +76905,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_0); __pyx_v_collTyp = __pyx_int_0; - /* "collisions.py":2184 + /* "collisions.py":2306 * 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 # <<<<<<<<<<<<<< @@ -72765,36 +76921,36 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_v_phi = __pyx_t_19; __pyx_t_19 = 0; - /* "collisions.py":2181 + /* "collisions.py":2303 * 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) */ - goto __pyx_L51; + goto __pyx_L52; } - /* "collisions.py":2185 + /* "collisions.py":2307 * # 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, 2185, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2307, __pyx_L1_error) if (__pyx_t_23) { } else { __pyx_t_5 = __pyx_t_23; - goto __pyx_L54_bool_binop_done; + goto __pyx_L55_bool_binop_done; } - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2307, __pyx_L1_error) __pyx_t_22 = (!__pyx_t_23); __pyx_t_5 = __pyx_t_22; - __pyx_L54_bool_binop_done:; + __pyx_L55_bool_binop_done:; if (__pyx_t_5) { - /* "collisions.py":2186 + /* "collisions.py":2308 * normal, phi = 0, 0 * elif thisIsOnP and (not otherIsOnP): # Point off line * collTyp = 1 # <<<<<<<<<<<<<< @@ -72804,23 +76960,23 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_1); __pyx_v_collTyp = __pyx_int_1; - /* "collisions.py":2188 + /* "collisions.py":2310 * 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, 2188, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = NULL; + __pyx_t_9 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_1)) { + __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_1); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -72828,51 +76984,51 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_closestP, __pyx_v_vel}; + 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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2188, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2310, __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, 2188, __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, 2310, __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":2189 + /* "collisions.py":2311 * # 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, 2189, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_math); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_degrees); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2311, __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, 2189, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2311, __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, 2189, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atan2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2311, __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, 2189, __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, 2311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = PyNumber_Subtract(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2189, __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, 2311, __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, 2311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __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, 2189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __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, 2189, __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, 2311, __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, 2311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = PyNumber_Subtract(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2189, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -72894,69 +77050,69 @@ 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, 2189, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __pyx_t_20 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1); + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_20)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_19}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __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, 2189, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2311, __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_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_phi = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_phi = __pyx_t_9; + __pyx_t_9 = 0; - /* "collisions.py":2185 + /* "collisions.py":2307 * # 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 */ - goto __pyx_L51; + goto __pyx_L52; } - /* "collisions.py":2190 + /* "collisions.py":2312 * 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, 2190, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 2312, __pyx_L1_error) __pyx_t_23 = (!__pyx_t_22); if (__pyx_t_23) { } else { __pyx_t_5 = __pyx_t_23; - goto __pyx_L56_bool_binop_done; + goto __pyx_L57_bool_binop_done; } - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2190, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2312, __pyx_L1_error) __pyx_t_5 = __pyx_t_23; - __pyx_L56_bool_binop_done:; + __pyx_L57_bool_binop_done:; if (__pyx_t_5) { - /* "collisions.py":2191 + /* "collisions.py":2313 * 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 # <<<<<<<<<<<<<< @@ -72966,49 +77122,49 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_2); __pyx_v_collTyp = __pyx_int_2; - /* "collisions.py":2193 + /* "collisions.py":2315 * 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_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_thisNormal, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_normal = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_thisNormal, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_v_normal = __pyx_t_9; + __pyx_t_9 = 0; - /* "collisions.py":2194 + /* "collisions.py":2316 * # 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, 2194, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2316, __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, 2194, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2316, __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, 2194, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_math); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2316, __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, 2194, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_atan2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2316, __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, 2194, __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, 2316, __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, 2194, __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, 2316, __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, 2194, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2316, __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, 2194, __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, 2316, __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, 2194, __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, 2316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2316, __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; __pyx_t_20 = NULL; @@ -73026,12 +77182,12 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_6, __pyx_t_9}; + PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_6, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 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, 2194, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -73051,20 +77207,20 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __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_1)) __PYX_ERR(0, 2194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2316, __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_1, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2194, __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, 2316, __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; __pyx_v_phi = __pyx_t_19; __pyx_t_19 = 0; - /* "collisions.py":2195 + /* "collisions.py":2317 * 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 # <<<<<<<<<<<<<< @@ -73074,17 +77230,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_velDiff, __pyx_int_0); - /* "collisions.py":2190 + /* "collisions.py":2312 * 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 */ - goto __pyx_L51; + goto __pyx_L52; } - /* "collisions.py":2200 + /* "collisions.py":2322 * # 'Cannot have a line reflecting off of another line when they aren\'t paralell; something bad must have occured!' * #) * collTyp = None # <<<<<<<<<<<<<< @@ -73095,51 +77251,150 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(Py_None); __pyx_v_collTyp = Py_None; - /* "collisions.py":2201 + /* "collisions.py":2323 * #) * collTyp = None * normal, phi = 0, 0 # <<<<<<<<<<<<<< * - * # the distance between the closest point on the other object and the corresponding point on the newLine + * if round(newPoint[0], precision) == round(closestP[0], precision) and round(newPoint[1], precision) == round(closestP[1], precision): */ __pyx_t_19 = __pyx_int_0; __Pyx_INCREF(__pyx_t_19); - __pyx_t_1 = __pyx_int_0; - __Pyx_INCREF(__pyx_t_1); + __pyx_t_9 = __pyx_int_0; + __Pyx_INCREF(__pyx_t_9); __pyx_v_normal = __pyx_t_19; __pyx_t_19 = 0; - __pyx_v_phi = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_phi = __pyx_t_9; + __pyx_t_9 = 0; } - __pyx_L51:; + __pyx_L52:; } - __pyx_L50:; + __pyx_L51:; - /* "collisions.py":2204 + /* "collisions.py":2325 + * 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, 2325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2325, __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, 2325, __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, 2325, __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, 2325, __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, 2325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2325, __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, 2325, __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, 2325, __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, 2325, __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, 2325, __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, 2325, __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, 2325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2325, __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, 2325, __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, 2325, __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, 2325, __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, 2325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2325, __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, 2325, __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, 2325, __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, 2325, __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, 2325, __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, 2325, __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":2326 + * + * 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, 2326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_9); + __pyx_t_9 = 0; + + /* "collisions.py":2325 + * 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 + * + */ + } + + /* "collisions.py":2329 * * # 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, 2204, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_math); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2329, __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, 2204, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_hypot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2329, __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, 2204, __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, 2329, __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, 2204, __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, 2329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_19, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_19, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2329, __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, 2204, __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, 2329, __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, 2204, __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, 2329, __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, 2204, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_11, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2329, __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; @@ -73158,64 +77413,64 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_t_9, __pyx_t_6}; - __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_19, __pyx_t_1, __pyx_t_6}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __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; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2329, __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, 2204, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2204, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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":2205 + /* "collisions.py":2330 * # 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, 2205, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2330, __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, 2205, __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, 2330, __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":2206 + /* "collisions.py":2331 * 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, 2206, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2206, __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, 2331, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "collisions.py":2207 + /* "collisions.py":2332 * 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, 2207, __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, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2206 + /* "collisions.py":2331 * 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? # <<<<<<<<<<<<<< @@ -73224,46 +77479,46 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2208 + /* "collisions.py":2333 * 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, 2208, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_rotate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __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, 2208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2208, __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, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_19 = PyNumber_Add(__pyx_t_9, __pyx_v_dist_left); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2208, __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, 2333, __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, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2208, __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, 2208, __pyx_L1_error); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2333, __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, 2333, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_19); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_19)) __PYX_ERR(0, 2208, __pyx_L1_error); - __pyx_t_1 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_19)) __PYX_ERR(0, 2333, __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, 2208, __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, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = PyNumber_Subtract(__pyx_t_19, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2208, __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, 2333, __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, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; + __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_6))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_1)) { + __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_1); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_4 = 1; @@ -73271,31 +77526,31 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_v_closestP, __pyx_t_9, __pyx_t_11}; + PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_closestP, __pyx_t_1, __pyx_t_11}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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, 2208, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2333, __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":2209 + /* "collisions.py":2334 * 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, 2209, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2334, __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, 2209, __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, 2334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = PyNumber_Subtract(__pyx_v_velDiff, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyNumber_Subtract(__pyx_v_velDiff, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -73312,157 +77567,157 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_vel, __pyx_t_9}; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_vel, __pyx_t_1}; __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2334, __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, 2209, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2334, __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":2210 + /* "collisions.py":2335 * 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, 2210, __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, 2335, __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, 2210, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2335, __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, 2210, __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, 2335, __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, 2210, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2335, __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, 2210, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2335, __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, 2210, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2335, __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, 2210, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2335, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_11)) __PYX_ERR(0, 2210, __pyx_L1_error); - __pyx_t_9 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_11)) __PYX_ERR(0, 2335, __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":2211 + /* "collisions.py":2336 * 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, 2211, __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, 2336, __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, 2211, __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, 2336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2336, __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, 2211, __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, 2336, __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, 2211, __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, 2336, __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, 2211, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2336, __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, 2211, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9)) __PYX_ERR(0, 2211, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2336, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 2211, __pyx_L1_error); - __pyx_t_9 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 2336, __pyx_L1_error); + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_diff2Point = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2212 + /* "collisions.py":2337 * 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, 2212, __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, 2337, __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, 2212, __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, 2337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2337, __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, 2212, __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, 2337, __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, 2212, __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, 2337, __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, 2212, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2337, __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, 2212, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9)) __PYX_ERR(0, 2212, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2337, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_11)) __PYX_ERR(0, 2212, __pyx_L1_error); - __pyx_t_9 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_11)) __PYX_ERR(0, 2337, __pyx_L1_error); + __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_v_odiff = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2213 + /* "collisions.py":2338 * 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, 2213, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2213, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2338, __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, 2213, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_9)) __PYX_ERR(0, 2213, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2213, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0)) __PYX_ERR(0, 2338, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2338, __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, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_19 = PyNumber_Subtract(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2213, __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, 2338, __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, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; + __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_11))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_1)) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_4 = 1; @@ -73470,26 +77725,26 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_2, __pyx_t_19}; + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_2, __pyx_t_19}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __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, 2213, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2338, __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":2214 + /* "collisions.py":2339 * 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, 2214, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_19 = NULL; __pyx_t_4 = 0; @@ -73509,49 +77764,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, 2214, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2339, __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":2215 + /* "collisions.py":2340 * 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, 2215, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_newobj, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2340, __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, 2215, __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, 2340, __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, 2215, __pyx_L1_error) + __pyx_t_19 = PyNumber_Add(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2340, __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, 2215, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_newobj, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2340, __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, 2215, __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, 2340, __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, 2215, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2340, __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, 2215, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_newobj, __pyx_n_s_x, __pyx_t_19) < 0) __PYX_ERR(0, 2340, __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, 2215, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_newobj, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 2340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2216 + /* "collisions.py":2341 * 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, 2216, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -73571,61 +77826,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, 2216, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2341, __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":2217 + /* "collisions.py":2342 * 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, 2217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2342, __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, 2217, __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, 2342, __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, 2217, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2342, __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, 2217, __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, 2342, __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, 2217, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2342, __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, 2217, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_y); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2342, __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, 2217, __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, 2342, __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, 2217, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2342, __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, 2217, __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, 2342, __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, 2217, __pyx_L1_error) + __pyx_t_19 = PyNumber_Add(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2342, __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, 2217, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_intermediateObj, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 2342, __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, 2217, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_intermediateObj, __pyx_n_s_y, __pyx_t_19) < 0) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - /* "collisions.py":2218 + /* "collisions.py":2343 * 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, 2218, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -73645,56 +77900,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, 2218, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __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":2219 + /* "collisions.py":2344 * 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, 2219, __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, 2344, __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, 2219, __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, 2344, __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":2220 + /* "collisions.py":2345 * 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, 2220, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2345, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2221 + /* "collisions.py":2346 * 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, 2221, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2346, __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, 2221, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_y); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2346, __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, 2221, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 2346, __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, 2221, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_19) < 0) __PYX_ERR(0, 2346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - /* "collisions.py":2220 + /* "collisions.py":2345 * o = self.handleCollisionsPos(intermediateObj, newobj, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< @@ -73703,17 +77958,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2222 + /* "collisions.py":2347 * 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, 2222, __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":2223 + /* "collisions.py":2348 * self.x, self.y = out.x, out.y * if verbose: * return out, outvel, [collTyp, True] # <<<<<<<<<<<<<< @@ -73721,30 +77976,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, 2223, __pyx_L1_error) + __pyx_t_19 = PyList_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2348, __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, 2223, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_19, 0, __pyx_v_collTyp)) __PYX_ERR(0, 2348, __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, 2223, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2223, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_19, 1, Py_True)) __PYX_ERR(0, 2348, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2348, __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, 2223, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 2348, __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, 2223, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 2348, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_19); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_19)) __PYX_ERR(0, 2223, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_19)) __PYX_ERR(0, 2348, __pyx_L1_error); __pyx_t_19 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2222 + /* "collisions.py":2347 * if replaceSelf: * self.x, self.y = out.x, out.y * if verbose: # <<<<<<<<<<<<<< @@ -73753,7 +78008,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2224 + /* "collisions.py":2349 * if verbose: * return out, outvel, [collTyp, True] * return out, outvel # <<<<<<<<<<<<<< @@ -73761,19 +78016,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, 2224, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2349, __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, 2224, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 2349, __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, 2224, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 2349, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2079 + /* "collisions.py":2198 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -73811,8 +78066,8 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_v_newPoint); __Pyx_XDECREF(__pyx_v_thisNormal); __Pyx_XDECREF(__pyx_v_paralell); - __Pyx_XDECREF(__pyx_v_cLines); __Pyx_XDECREF(__pyx_v_thisIsOnP); + __Pyx_XDECREF(__pyx_v_cLines); __Pyx_XDECREF(__pyx_v_cLine); __Pyx_XDECREF(__pyx_v_sortedOtherLn); __Pyx_XDECREF(__pyx_v_otherLnNormal); @@ -73831,15 +78086,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_v_intermediateObj); __Pyx_XDECREF(__pyx_v_out); __Pyx_XDECREF(__pyx_v_outvel); - __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_i); __Pyx_XDECREF(__pyx_v_vel); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2226 +/* "collisions.py":2351 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -73847,7 +78102,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * objs: Union[Shapes, Iterable[Shape]], */ -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; @@ -73858,39 +78113,39 @@ static PyObject *__pyx_pf_10collisions_54__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":2231 + /* "collisions.py":2356 * 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, 2226, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2351, __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, 2226, __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, 1, __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2226, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 2351, __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, 2351, __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, 2226, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 2351, __pyx_L1_error); - /* "collisions.py":2226 + /* "collisions.py":2351 * 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, 2226, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2351, __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, 2226, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2351, __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, 2226, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 2351, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -73952,7 +78207,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_defaults18 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self); + __pyx_defaults19 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults19, __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))); @@ -73981,7 +78236,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2226, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2351, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -73989,9 +78244,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2226, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2351, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 2226, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 2351, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -73999,35 +78254,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2226, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2351, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 2226, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 2351, __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, 2226, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2351, __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, 2226, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2351, __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, 2226, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2351, __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, 2226, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 2351, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -74053,7 +78308,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, 2226, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 2351, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -74098,14 +78353,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - /* "collisions.py":2250 + /* "collisions.py":2375 * 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, 2250, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -74125,49 +78380,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, 2250, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2375, __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":2251 + /* "collisions.py":2376 * """ * 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, 2251, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2376, __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, 2251, __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, 2376, __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, 2251, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2376, __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, 2251, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2376, __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, 2251, __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, 2376, __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, 2251, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2376, __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, 2251, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_n, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2376, __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, 2251, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_n, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 2376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2252 + /* "collisions.py":2377 * 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, 2252, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; @@ -74187,56 +78442,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, 2252, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2377, __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":2253 + /* "collisions.py":2378 * 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, 2253, __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, 2378, __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, 2253, __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, 2378, __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":2254 + /* "collisions.py":2379 * 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, 2254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2379, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2255 + /* "collisions.py":2380 * 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, 2255, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2380, __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, 2255, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2380, __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, 2255, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2380, __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, 2255, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2254 + /* "collisions.py":2379 * o = self.handleCollisionsPos(self, n, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< @@ -74245,17 +78500,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON */ } - /* "collisions.py":2256 + /* "collisions.py":2381 * 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, 2256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2381, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2257 + /* "collisions.py":2382 * self.x, self.y = out.x, out.y * if verbose: * return out, outvel, o[2] # <<<<<<<<<<<<<< @@ -74263,24 +78518,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, 2257, __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, 2382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2382, __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, 2257, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_out)) __PYX_ERR(0, 2382, __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, 2257, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_outvel)) __PYX_ERR(0, 2382, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5)) __PYX_ERR(0, 2257, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5)) __PYX_ERR(0, 2382, __pyx_L1_error); __pyx_t_5 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2256 + /* "collisions.py":2381 * if replaceSelf: * self.x, self.y = out.x, out.y * if verbose: # <<<<<<<<<<<<<< @@ -74289,27 +78544,27 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON */ } - /* "collisions.py":2258 + /* "collisions.py":2383 * if verbose: * return out, outvel, o[2] * return out, outvel # <<<<<<<<<<<<<< * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: + * def _containsPoint(self, point: Point) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2383, __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, 2258, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_out)) __PYX_ERR(0, 2383, __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, 2258, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_outvel)) __PYX_ERR(0, 2383, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2226 + /* "collisions.py":2351 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -74335,64 +78590,24 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON return __pyx_r; } -/* "collisions.py":2260 +/* "collisions.py":2385 * return out, outvel * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< - * """ - * Finds whether a point is on a corner of this shape. + * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< + * return self._collides(point) and self.whereCollides(point) == [] + * */ -static PyObject *__pyx_pf_10collisions_56__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, 2260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __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, 0, __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2260, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2260, __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, 2260, __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, 2260, __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_11ClosedShape_11isCorner(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_11_containsPoint(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_11ClosedShape_10isCorner, "\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_11ClosedShape_11isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_11isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11ClosedShape_10isCorner}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_11isCorner(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_11_containsPoint = {"_containsPoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_11_containsPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_11_containsPoint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -74401,18 +78616,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { 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}; + 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("isCorner (wrapper)", 0); + __Pyx_RefNannySetupContext("_containsPoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -74422,14 +78636,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_precision,0}; - __pyx_defaults19 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self); - values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,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); @@ -74444,7 +78654,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2260, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -74452,39 +78662,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2260, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 2260, __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, 2260, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, 1); __PYX_ERR(0, 2385, __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, 2260, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_containsPoint") < 0)) __PYX_ERR(0, 2385, __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_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, 2260, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2385, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -74494,11 +78692,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ClosedShape.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape._containsPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11ClosedShape_10isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); + __pyx_r = __pyx_pf_10collisions_11ClosedShape_10_containsPoint(__pyx_self, __pyx_v_self, __pyx_v_point); /* function exit code */ { @@ -74511,239 +78709,104 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_11ClosedShape_10isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision) { - PyObject *__pyx_v_i = NULL; +static PyObject *__pyx_pf_10collisions_11ClosedShape_10_containsPoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point) { 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; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; + 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("isCorner", 1); + __Pyx_RefNannySetupContext("_containsPoint", 1); - /* "collisions.py":2271 - * 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 + /* "collisions.py":2386 + * + * def _containsPoint(self, point: Point) -> bool: + * return self._collides(point) and self.whereCollides(point) == [] # <<<<<<<<<<<<<< + * + * def _contains(self, othershape: Shape) -> bool: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; + __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, 2386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 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); + 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_t_4 = 1; + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 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, 2271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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, 2386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - 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_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2386, __pyx_L1_error) + if (__pyx_t_6) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __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, 2271, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3_bool_binop_done; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_6)) { - 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, 2271, __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, 2271, __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, 2271, __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, 2271, __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, 2271, __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, 2271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_6(__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, 2271, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":2272 - * """ - * 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, 2272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2272, __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, 2272, __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, 2272, __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, 2272, __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, 2272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2272, __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, 2272, __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, 2272, __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, 2272, __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, 2272, __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, 2272, __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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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; } - __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, 2272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2272, __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, 2272, __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, 2272, __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, 2272, __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, 2272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2272, __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, 2272, __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, 2272, __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, 2272, __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, 2272, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + #endif + { + 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, 2386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __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, 2272, __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":2273 - * 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_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":2272 - * """ - * 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 - */ - } - - /* "collisions.py":2271 - * 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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2386, __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, 2386, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "collisions.py":2274 - * if round(i[0], precision) == round(point[0], precision) and round(i[1], precision) == round(point[1], precision): - * return True - * return False # <<<<<<<<<<<<<< - * - * def toLines(self) -> Iterable[Line]: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2260 + /* "collisions.py":2385 * return out, outvel * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< - * """ - * Finds whether a point is on a corner of this shape. + * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< + * return self._collides(point) and self.whereCollides(point) == [] + * */ /* function exit code */ @@ -74751,53 +78814,52 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_10isCorner(CYTHON_UNUSED Py __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("collisions.ClosedShape.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("collisions.ClosedShape._containsPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2276 - * return False +/* "collisions.py":2388 + * return self._collides(point) and self.whereCollides(point) == [] * - * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< - * """ - * Returns: + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return self._containsPoint(othershape) */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_13toLines(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_13_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*/ -PyDoc_STRVAR(__pyx_doc_10collisions_11ClosedShape_12toLines, "\n Returns:\n Iterable[Line]: Get a list of all the Lines that make up this object\n "); -static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_13toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_13toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11ClosedShape_12toLines}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_13toLines(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_13_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_13_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_13_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; + 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("toLines (wrapper)", 0); + __Pyx_RefNannySetupContext("_contains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -74807,10 +78869,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_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; @@ -74823,23 +78887,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2276, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2388, __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, 2388, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 2388, __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, "toLines") < 0)) __PYX_ERR(0, 2276, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 2388, __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_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2276, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2388, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -74849,11 +78925,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ClosedShape.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11ClosedShape_12toLines(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_11ClosedShape_12_contains(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -74865,710 +78941,780 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +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":2396 + * 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: + */ -static PyObject *__pyx_pf_10collisions_11ClosedShape_12toLines(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +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; 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":2281 - * Iterable[Line]: Get a list of all the Lines that make up this object - * """ - * return [] # <<<<<<<<<<<<<< - * - * def toPoints(self) -> Iterable[pointLike]: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); 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; - goto __pyx_L0; - - /* "collisions.py":2276 - * return False - * - * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< - * """ - * Returns: - */ + __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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 2396, __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_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, 2396, __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_AddTraceback("collisions.ClosedShape.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape._contains.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":2283 - * return [] - * - * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Returns: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_15toPoints(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_11ClosedShape_14toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object\n "); -static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_15toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_15toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11ClosedShape_14toPoints}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_15toPoints(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}; +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); + 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; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + unsigned int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __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--; + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2396, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2396, __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, 2396, __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, 2396, __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, 2396, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2283, __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, 2283, __pyx_L3_error) + #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, 2396, __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, 2396, __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, 2396, __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, 2396, __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, 2396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + __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, 2396, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); } - __pyx_v_self = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2283, __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_XGOTREF(__pyx_cur_scope->__pyx_v_p); + __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, 2396, __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, 2396, __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, 2396, __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, 2396, __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, 2396, __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; + __pyx_t_7 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } } - } - __Pyx_AddTraceback("collisions.ClosedShape.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11ClosedShape_14toPoints(__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]); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; + __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, 2396, __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, 2396, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (!__pyx_t_10); + if (__pyx_t_11) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; } } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_11ClosedShape_14toPoints(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED 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":2288 - * Iterable[pointLike]: Get a list of all the Points that make up this object - * """ - * return [] # <<<<<<<<<<<<<< - * - * def __getitem__(self, item: int) -> pointLike: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "collisions.py":2283 - * return [] - * - * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Returns: - */ + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ + goto __pyx_L0; __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.ClosedShape.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __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("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); + #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; } -/* "collisions.py":2290 - * return [] - * - * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< - * return self.toPoints()[item] +/* "collisions.py":2388 + * return self._collides(point) and self.whereCollides(point) == [] * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return self._containsPoint(othershape) */ -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_17__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_11ClosedShape_17__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_17__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_17__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, 2290, __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, 2290, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 2290, __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, 2290, __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, 2290, __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.ClosedShape.__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, 2290, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_11ClosedShape_16__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_11ClosedShape_16__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) { +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; + PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8 = 0; 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; + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getitem__", 1); + __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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 2388, __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":2291 - * - * def __getitem__(self, item: int) -> pointLike: - * return self.toPoints()[item] # <<<<<<<<<<<<<< + /* "collisions.py":2389 * - * def __iter__(self): + * def _contains(self, othershape: Shape) -> bool: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return self._containsPoint(othershape) + * if checkShpType(othershape, ShpTyps.Line): */ - __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, 2291, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2389, __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, 2389, __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, 2389, __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 (likely(PyMethod_Check(__pyx_t_2))) { + 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; + __pyx_t_5 = 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); + 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, 2291, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2389, __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, 2291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2389, __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_6) { - /* "collisions.py":2290 - * return [] - * - * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< - * return self.toPoints()[item] - * + /* "collisions.py":2390 + * def _contains(self, othershape: Shape) -> bool: + * 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)) */ + __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, 2390, __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_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, 2390, __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; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("collisions.ClosedShape.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":2293 - * return self.toPoints()[item] - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return iter(self.toPoints()) + /* "collisions.py":2389 * + * def _contains(self, othershape: Shape) -> bool: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return self._containsPoint(othershape) + * if checkShpType(othershape, ShpTyps.Line): */ + } -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_19__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_11ClosedShape_19__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_19__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 + /* "collisions.py":2391 + * 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, 2391, __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, 2391, __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, 2391, __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; + } + } #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, 2293, __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, 2293, __pyx_L3_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, 2391, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "collisions.py":2392 + * 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): + * 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, 2392, __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, 2392, __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, 2392, __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, 2392, __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, 2392, __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; + __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; } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; + __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, 2392, __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, 2392, __pyx_L1_error) + if (__pyx_t_6) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5_bool_binop_done; } - __pyx_v_self = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2293, __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_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2392, __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, 2392, __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, 2392, __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, 2392, __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, 2392, __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; + __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; + } } - } - __Pyx_AddTraceback("collisions.ClosedShape.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11ClosedShape_18__iter__(__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]); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; + __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, 2392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L5_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; -static PyObject *__pyx_pf_10collisions_11ClosedShape_18__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; - unsigned int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__iter__", 1); + /* "collisions.py":2391 + * 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): + */ + } - /* "collisions.py":2294 - * - * def __iter__(self): - * return iter(self.toPoints()) # <<<<<<<<<<<<<< - * - * def __str__(self): + /* "collisions.py":2393 + * 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_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2294, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2393, __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, 2393, __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, 2393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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 (likely(PyMethod_Check(__pyx_t_2))) { + 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; + __pyx_t_5 = 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); + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_8}; + __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, 2294, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2393, __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, 2294, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2393, __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, 2393, __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, 2393, __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, 2393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_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[3] = {__pyx_t_8, __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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2393, __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, 2393, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_t_6 = __pyx_t_9; + __pyx_L8_bool_binop_done:; + if (__pyx_t_6) { - /* "collisions.py":2293 - * return self.toPoints()[item] - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return iter(self.toPoints()) - * + /* "collisions.py":2394 + * 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): + * 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, 2394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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[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, 2394, __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) + 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_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, 2394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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[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, 2394, __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, 2394, __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, 2394, __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); + __pyx_t_1 = __pyx_t_8; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_L10_bool_binop_done:; + __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_AddTraceback("collisions.ClosedShape.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "collisions.py":2393 + * 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): + */ + } -/* "collisions.py":2296 - * return iter(self.toPoints()) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return '' + /* "collisions.py":2395 + * 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()) * */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11ClosedShape_21__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_11ClosedShape_21__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_21__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11ClosedShape_21__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, 2296, __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, 2296, __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_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2395, __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, 2395, __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, 2395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __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_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; } - __pyx_v_self = values[0]; } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2296, __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_3, __pyx_v_othershape, __pyx_t_2}; + __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, 2395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __Pyx_AddTraceback("collisions.ClosedShape.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11ClosedShape_20__str__(__pyx_self, __pyx_v_self); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2395, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + 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]); + /* "collisions.py":2396 + * 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: + */ + __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, 2396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; + } } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_11ClosedShape_20__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__", 1); + #endif + { + 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, 2396, __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, 2396, __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, 2396, __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":2297 - * - * def __str__(self): - * return '' # <<<<<<<<<<<<<< + /* "collisions.py":2395 + * 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()) * - * class Rect(ClosedShape): */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_kp_u_Closed_Shape); - __pyx_r = __pyx_kp_u_Closed_Shape; - goto __pyx_L0; + } - /* "collisions.py":2296 - * return iter(self.toPoints()) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return '' + /* "collisions.py":2388 + * return self._collides(point) and self.whereCollides(point) == [] * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return self._containsPoint(othershape) */ /* 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_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("collisions.ClosedShape._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2301 - * class Rect(ClosedShape): - * """A Rectangle. It is defined with an x, y, width and height.""" - * def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< +/* "collisions.py":2398 + * return all(self._contains(Point(*p)) for p in othershape.toPoints()) + * + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ - * Args: + * Finds whether a point is on a corner of this shape. */ static PyObject *__pyx_pf_10collisions_58__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { @@ -75581,23 +79727,21 @@ 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 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2301, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2301, __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, 0, __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2398, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2398, __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, 2301, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2301, __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, 2301, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2398, __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, 2301, __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, 2398, __pyx_L1_error); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ @@ -75613,16 +79757,16 @@ static PyObject *__pyx_pf_10collisions_58__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Rect_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_15isCorner(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_4Rect___init__, "\n Args:\n x (Number): The x ordinate.\n y (Number): The y ordinate.\n w (Number): The width.\n h (Number): The height.\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_4Rect_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect___init__}; -static PyObject *__pyx_pw_10collisions_4Rect_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_11ClosedShape_14isCorner, "\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_11ClosedShape_15isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_15isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11ClosedShape_14isCorner}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_15isCorner(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -75630,22 +79774,19 @@ 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_w = 0; - PyObject *__pyx_v_h = 0; - double __pyx_v_bounciness; + 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[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("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("isCorner (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -75655,17 +79796,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_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,&__pyx_n_s_bounciness,0}; + 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); + values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); 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); @@ -75682,87 +79818,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2301, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2398, __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_point)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2301, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2398, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 1); __PYX_ERR(0, 2301, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 2398, __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, 2301, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 2); __PYX_ERR(0, 2301, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2301, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 3); __PYX_ERR(0, 2301, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_h)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2301, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 4); __PYX_ERR(0, 2301, __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, 2301, __pyx_L3_error) + 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, 2398, __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, 2301, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 2398, __pyx_L3_error) } } else { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 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); + 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_x = values[1]; - __pyx_v_y = values[2]; - __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, 2301, __pyx_L3_error) - } else { - __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; - } + __pyx_v_point = values[1]; + __pyx_v_precision = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, __pyx_nargs); __PYX_ERR(0, 2301, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2398, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -75772,11 +79868,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Rect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Rect___init__(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h, __pyx_v_bounciness); + __pyx_r = __pyx_pf_10collisions_11ClosedShape_14isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); /* function exit code */ { @@ -75789,144 +79885,282 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -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) { +static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision) { + PyObject *__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; + unsigned int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("isCorner", 1); - /* "collisions.py":2310 - * 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":2409 + * bool: Whether the point is on a corner of this shape * """ - * super().__init__(bounciness) # <<<<<<<<<<<<<< - * self.x, self.y, self.w, self.h = x, y, w, h - * + * 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_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2310, __pyx_L1_error) } - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2310, __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, 2310, __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, 2310, __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, 2310, __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, 2310, __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, 2310, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; + __pyx_t_3 = NULL; + __pyx_t_4 = 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_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_3, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 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, 2310, __pyx_L1_error) + 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, 2409, __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; + } + 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_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, 2409, __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, 2409, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + 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, 2409, __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, 2409, __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, 2409, __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, 2409, __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, 2409, __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, 2409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_6(__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, 2409, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_1 = 0; - /* "collisions.py":2311 - * """ - * super().__init__(bounciness) - * self.x, self.y, self.w, self.h = x, y, w, h # <<<<<<<<<<<<<< - * - * 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_w; - __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, 2311, __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, 2311, __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, 2311, __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, 2311, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "collisions.py":2301 - * class Rect(ClosedShape): - * """A Rectangle. It is defined with an x, y, width and height.""" - * def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< + /* "collisions.py":2410 * """ - * Args: + * 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 */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + __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, 2410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2410, __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, 2410, __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, 2410, __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, 2410, __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, 2410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2410, __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, 2410, __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, 2410, __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, 2410, __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, 2410, __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, 2410, __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, 2410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2410, __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, 2410, __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, 2410, __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, 2410, __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, 2410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2410, __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, 2410, __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, 2410, __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, 2410, __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, 2410, __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, 2410, __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":2411 + * 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_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":2410 + * """ + * 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 + */ + } + + /* "collisions.py":2409 + * 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":2412 + * if round(i[0], precision) == round(point[0], precision) and round(i[1], precision) == round(point[1], precision): + * return True + * return False # <<<<<<<<<<<<<< + * + * def toLines(self) -> Iterable[Line]: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "collisions.py":2398 + * 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. + */ + + /* 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.Rect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("collisions.ClosedShape.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2313 - * self.x, self.y, self.w, self.h = x, y, w, h +/* "collisions.py":2414 + * return False * - * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ - * Returns the rectangle bounding box surrounding this rectangle, which is virtually just the rectangle itself in a different form. + * Returns: */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Rect_3rect(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_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_4Rect_2rect, "\n Returns the rectangle bounding box surrounding this rectangle, which is virtually just the rectangle itself in a different form.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); -static PyMethodDef __pyx_mdef_10collisions_4Rect_3rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_3rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_2rect}; -static PyObject *__pyx_pw_10collisions_4Rect_3rect(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_11ClosedShape_16toLines, "\n Returns:\n Iterable[Line]: Get a list of all the Lines that make up this object\n "); +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_17toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_17toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11ClosedShape_16toLines}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_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; + CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -75937,7 +80171,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rect (wrapper)", 0); + __Pyx_RefNannySetupContext("toLines (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -75963,12 +80197,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2313, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2414, __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, 2313, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2414, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -75979,7 +80213,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, 2313, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2414, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -75989,11 +80223,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Rect.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Rect_2rect(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_11ClosedShape_16toLines(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -76006,158 +80240,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_11ClosedShape_16toLines(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; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("rect", 1); + __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":2320 - * Iterable[Number]: (min x, min y, max x, max y) + /* "collisions.py":2419 + * Iterable[Line]: Get a list of all the Lines that make up this object * """ - * 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) # <<<<<<<<<<<<<< + * return [] # <<<<<<<<<<<<<< * - * def area(self) -> Number: + * 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, 2320, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2419, __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, 2320, __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, 2320, __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, 2320, __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, 2320, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2320, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - } - __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, 2320, __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, 2320, __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, 2320, __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, 2320, __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, 2320, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2320, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_5) { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __pyx_t_2; - } - __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, 2320, __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, 2320, __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, 2320, __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, 2320, __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, 2320, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2320, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_5) { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_4 = __pyx_t_6; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = __pyx_t_2; - } - __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, 2320, __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, 2320, __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, 2320, __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, 2320, __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, 2320, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2320, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_5) { - __Pyx_INCREF(__pyx_t_7); - __pyx_t_6 = __pyx_t_7; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = __pyx_t_2; - } - __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, 2320, __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, 2320, __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, 2320, __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, 2320, __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, 2320, __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; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2313 - * self.x, self.y, self.w, self.h = x, y, w, h + /* "collisions.py":2414 + * return False * - * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ - * Returns the rectangle bounding box surrounding this rectangle, which is virtually just the rectangle itself in a different form. + * Returns: */ /* 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.Rect.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -76165,32 +80282,32 @@ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":2322 - * 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) +/* "collisions.py":2421 + * return [] * - * def area(self) -> Number: # <<<<<<<<<<<<<< + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ - * Gets the area of the shape; width * height. + * Returns: */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Rect_5area(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_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*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Rect_4area, "\n Gets the area of the shape; width * height.\n\n Returns:\n Number: self.w * self.h\n "); -static PyMethodDef __pyx_mdef_10collisions_4Rect_5area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_5area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_4area}; -static PyObject *__pyx_pw_10collisions_4Rect_5area(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_11ClosedShape_18toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object\n "); +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_19toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_19toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11ClosedShape_18toPoints}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_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 ) { - PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -76201,7 +80318,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("area (wrapper)", 0); + __Pyx_RefNannySetupContext("toPoints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -76227,12 +80344,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2322, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2421, __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, 2322, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2421, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -76243,7 +80360,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, 2322, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2421, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -76253,11 +80370,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Rect.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Rect_4area(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_11ClosedShape_18toPoints(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -76270,51 +80387,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Rect_4area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_11ClosedShape_18toPoints(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("area", 1); + __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":2329 - * Number: self.w * self.h + /* "collisions.py":2426 + * Iterable[pointLike]: Get a list of all the Points that make up this object * """ - * return self.w * self.h # <<<<<<<<<<<<<< + * return [] # <<<<<<<<<<<<<< * - * def _collides(self, othershape: Shape) -> bool: + * def __getitem__(self, item: int) -> pointLike: */ __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, 2329, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2426, __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, 2329, __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, 2329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2322 - * 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) + /* "collisions.py":2421 + * return [] * - * def area(self) -> Number: # <<<<<<<<<<<<<< + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ - * Gets the area of the shape; width * height. + * 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.Rect.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -76322,24 +80429,24 @@ static PyObject *__pyx_pf_10collisions_4Rect_4area(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":2331 - * return self.w * self.h +/* "collisions.py":2428 + * return [] + * + * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< + * return self.toPoints()[item] * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * x, y, mx, my = self.rect() - * if checkShpType(othershape, Point): */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Rect_7_collides(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11ClosedShape_21__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_4Rect_7_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_7_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Rect_7_collides(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11ClosedShape_21__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_21__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_21__getitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -76347,7 +80454,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_item = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -76358,7 +80465,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_collides (wrapper)", 0); + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -76368,7 +80475,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_item,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -76386,22 +80493,22 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2331, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2428, __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_item)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2331, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2428, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2331, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 2428, __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, 2331, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 2428, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -76410,11 +80517,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_item = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2331, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2428, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -76424,13 +80531,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Rect._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ClosedShape.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Rect_6_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2428, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_11ClosedShape_20__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) { @@ -76440,272 +80552,204 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "collisions.py":2351 - * ) - * if checkShpType(othershape, Arc): - * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< - * return True - * for i in self.toLines(): - */ -static PyObject *__pyx_pf_10collisions_4Rect_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_10collisions_11ClosedShape_20__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; + 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("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_17_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_17_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2351, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + __Pyx_RefNannySetupContext("__getitem__", 1); + + /* "collisions.py":2429 + * + * def __getitem__(self, item: int) -> pointLike: + * return self.toPoints()[item] # <<<<<<<<<<<<<< + * + * 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, 2429, __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_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_16__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); + #endif { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_4Rect_9_collides_2generator7, 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, 2351, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; + 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, 2429, __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, 2429, __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":2428 + * return [] + * + * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< + * return self.toPoints()[item] + * + */ /* function exit code */ __pyx_L1_error:; - __Pyx_AddTraceback("collisions.Rect._collides.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("collisions.ClosedShape.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_4Rect_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_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_17_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; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - unsigned int __pyx_t_9; - int __pyx_t_10; +/* "collisions.py":2431 + * return self.toPoints()[item] + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return iter(self.toPoints()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_11ClosedShape_23__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_11ClosedShape_23__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_23__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_23__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("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2351, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2351, __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, 2351, __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, 2351, __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, 2351, __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, 2351, __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, 2351, __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, 2351, __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, 2351, __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, 2351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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; } - } 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, 2351, __pyx_L1_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--; } - break; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2431, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); - __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, 2351, __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, 2351, __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, 2351, __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, 2351, __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, 2351, __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; - __pyx_t_7 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_9 = 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, "__iter__") < 0)) __PYX_ERR(0, 2431, __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_7, __pyx_t_8}; - __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, 2351, __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, 2351, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_10) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } + __pyx_v_self = values[0]; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2431, __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]); + } } - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + __Pyx_AddTraceback("collisions.ClosedShape.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_11ClosedShape_22__iter__(__pyx_self, __pyx_v_self); /* function exit code */ - 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_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - #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; } -/* "collisions.py":2331 - * return self.w * self.h - * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * x, y, mx, my = self.rect() - * if checkShpType(othershape, Point): - */ - -static PyObject *__pyx_pf_10collisions_4Rect_6_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *__pyx_cur_scope; - PyObject *__pyx_v_x = NULL; - PyObject *__pyx_v_y = NULL; - PyObject *__pyx_v_mx = NULL; - PyObject *__pyx_v_my = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_ox = NULL; - PyObject *__pyx_v_oy = NULL; - PyObject *__pyx_v_omx = NULL; - PyObject *__pyx_v_omy = NULL; - PyObject *__pyx_9genexpr46__pyx_v_i = NULL; - PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator7 = 0; +static PyObject *__pyx_pf_10collisions_11ClosedShape_22__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; unsigned int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *(*__pyx_t_8)(PyObject *); - int __pyx_t_9; - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_collides", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_16__collides(__pyx_ptype_10collisions___pyx_scope_struct_16__collides, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2331, __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("__iter__", 1); - /* "collisions.py":2332 + /* "collisions.py":2432 * - * def _collides(self, othershape: Shape) -> bool: - * x, y, mx, my = self.rect() # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): - * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y + * def __iter__(self): + * return iter(self.toPoints()) # <<<<<<<<<<<<<< + * + * def __str__(self): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2332, __pyx_L1_error) + __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, 2432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -76725,1432 +80769,918 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_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, 2332, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - 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 != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2332, __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); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); - } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_5 = PyList_GET_ITEM(sequence, 2); - __pyx_t_6 = PyList_GET_ITEM(sequence, 3); - } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - #else - { - 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, 2332, __pyx_L1_error) - __Pyx_GOTREF(item); - *(temps[i]) = item; - } - } - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } 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, 2332, __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); - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2332, __pyx_L1_error) - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2332, __pyx_L1_error) - __pyx_L4_unpacking_done:; - } - __pyx_v_x = __pyx_t_2; + __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2432, __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; - __pyx_v_y = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_mx = __pyx_t_5; - __pyx_t_5 = 0; - __pyx_v_my = __pyx_t_6; - __pyx_t_6 = 0; + goto __pyx_L0; - /* "collisions.py":2333 - * def _collides(self, othershape: Shape) -> bool: - * x, y, mx, my = self.rect() - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< - * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y - * if checkShpType(othershape, Line): + /* "collisions.py":2431 + * return self.toPoints()[item] + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return iter(self.toPoints()) + * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_5}; - __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, 2333, __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, 2333, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { - /* "collisions.py":2334 - * x, y, mx, my = self.rect() - * if checkShpType(othershape, Point): - * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y # <<<<<<<<<<<<<< - * if checkShpType(othershape, Line): - * 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, 2334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_x, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2334, __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_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2334, __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, 2334, __pyx_L1_error) - if (__pyx_t_9) { - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = __pyx_t_5; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_y, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2334, __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, 2334, __pyx_L1_error) - if (__pyx_t_9) { - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_1 = __pyx_t_6; - __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, 2334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_my, __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2334, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = __pyx_t_5; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_L6_bool_binop_done:; - __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_AddTraceback("collisions.ClosedShape.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":2333 - * def _collides(self, othershape: Shape) -> bool: - * x, y, mx, my = self.rect() - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< - * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y - * if checkShpType(othershape, Line): +/* "collisions.py":2434 + * return iter(self.toPoints()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '' + * */ - } - /* "collisions.py":2335 - * if checkShpType(othershape, Point): - * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y - * if checkShpType(othershape, 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_5, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - __pyx_t_4 = 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); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_4 = 1; - } - } +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_11ClosedShape_25__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_11ClosedShape_25__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11ClosedShape_25__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11ClosedShape_25__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_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2335, __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, 2335, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { - - /* "collisions.py":2336 - * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y - * if checkShpType(othershape, 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 \ - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_4 = 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; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __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, 2336, __pyx_L1_error) - if (__pyx_t_9) { - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = __pyx_t_5; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L10_bool_binop_done; - } - - /* "collisions.py":2337 - * if checkShpType(othershape, 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __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, 2337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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, 2337, __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, 2337, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_9) { - goto __pyx_L12_next_or; - } else { - } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __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, 2337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_v_mx, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __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, 2337, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_9) { - goto __pyx_L12_next_or; + 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, 2434, __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, 2434, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __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, 2337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_v_y, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __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, 2337, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_9) { - goto __pyx_L12_next_or; - } else { + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2434, __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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __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, 2337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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, 2337, __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, 2337, __pyx_L1_error) - if (!__pyx_t_9) { - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = __pyx_t_5; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L10_bool_binop_done; + } + __Pyx_AddTraceback("collisions.ClosedShape.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_11ClosedShape_24__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_L12_next_or:; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":2338 - * 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()]) - * ) +static PyObject *__pyx_pf_10collisions_11ClosedShape_24__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__", 1); + + /* "collisions.py":2435 + * + * def __str__(self): + * return '' # <<<<<<<<<<<<<< + * + * class Rect(ClosedShape): */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2338, __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, 2338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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, 2338, __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, 2338, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_9) { - goto __pyx_L16_next_or; - } else { - } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2338, __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, 2338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_v_mx, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2338, __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, 2338, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_9) { - goto __pyx_L16_next_or; - } else { - } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2338, __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, 2338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_v_y, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2338, __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, 2338, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_9) { - goto __pyx_L16_next_or; - } else { - } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2338, __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, 2338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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, 2338, __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, 2338, __pyx_L1_error) - if (!__pyx_t_9) { - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = __pyx_t_5; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L10_bool_binop_done; - } - __pyx_L16_next_or:; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_u_Closed_Shape); + __pyx_r = __pyx_kp_u_Closed_Shape; + goto __pyx_L0; - /* "collisions.py":2339 - * (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()]) # <<<<<<<<<<<<<< - * ) - * if checkShpType(othershape, Circle): + /* "collisions.py":2434 + * return iter(self.toPoints()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '' + * */ - { /* enter inner scope */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2339, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2339, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = NULL; - __pyx_t_4 = 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_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_6 = __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_6)) __PYX_ERR(0, 2339, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { - __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); - __pyx_t_10 = 0; - __pyx_t_11 = NULL; - } else { - __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2339, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2339, __pyx_L22_error) + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2440 + * """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: + */ + +static PyObject *__pyx_pf_10collisions_60__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_defaults21, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2440, __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, 2440, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2440, __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, 2440, __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, 2440, __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_4Rect_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_4Rect___init__, "\n Args:\n x (Number): The x ordinate.\n y (Number): The y ordinate.\n w (Number): The width.\n h (Number): The height.\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_4Rect_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect___init__}; +static PyObject *__pyx_pw_10collisions_4Rect_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_w = 0; + PyObject *__pyx_v_h = 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[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); + #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_w,&__pyx_n_s_h,&__pyx_n_s_bounciness,0}; + __pyx_defaults21 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self); + 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; } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - 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, 2339, __pyx_L22_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, 2339, __pyx_L22_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, 2339, __pyx_L22_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, 2339, __pyx_L22_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, 2339, __pyx_L22_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, 2339, __pyx_L22_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, 2339, __pyx_L22_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_6); + 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--; } - __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_i, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr46__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2339, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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_4 = 1; - } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2440, __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--; } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; - __pyx_t_6 = __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_6)) __PYX_ERR(0, 2339, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 1); __PYX_ERR(0, 2440, __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, 2440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 2); __PYX_ERR(0, 2440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 3); __PYX_ERR(0, 2440, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_h)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2440, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 4); __PYX_ERR(0, 2440, __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, 2440, __pyx_L3_error) } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 2339, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_i); __pyx_9genexpr46__pyx_v_i = 0; - goto __pyx_L26_exit_scope; - __pyx_L22_error:; - __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_i); __pyx_9genexpr46__pyx_v_i = 0; - goto __pyx_L1_error; - __pyx_L26_exit_scope:; - } /* exit inner scope */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_L10_bool_binop_done:; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + 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, 2440, __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); + 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_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, 2440, __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, 2440, __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.Rect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Rect___init__(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h, __pyx_v_bounciness); - /* "collisions.py":2335 - * if checkShpType(othershape, Point): - * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y - * if checkShpType(othershape, 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 \ - */ + /* 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":2341 - * any([i.collides(othershape) for i in self.toLines()]) - * ) - * if checkShpType(othershape, 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 \ +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) { + 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":2449 + * 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.w, self.h = x, y, w, h + * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2341, __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, 2449, __pyx_L1_error) } + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Circle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2449, __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, 2449, __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, 2449, __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, 2449, __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, 2449, __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_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { + 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_6); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_othershape, __pyx_t_5}; - __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, 2341, __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; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2449, __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, 2341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { - /* "collisions.py":2342 - * ) - * if checkShpType(othershape, 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 \ + /* "collisions.py":2450 + * """ + * super().__init__(bounciness) + * self.x, self.y, self.w, self.h = x, y, w, h # <<<<<<<<<<<<<< + * + * def rect(self) -> Iterable[Number]: */ - __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, 2342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_4 = 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_4 = 1; - } - } - #endif - { - 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, 2342, __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, 2342, __pyx_L1_error) - if (__pyx_t_9) { - __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_L28_bool_binop_done; - } + __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_w; + __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, 2450, __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, 2450, __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, 2450, __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, 2450, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2343 - * if checkShpType(othershape, 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 \ + /* "collisions.py":2440 + * """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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __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, 2343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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, 2343, __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, 2343, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_9) { - goto __pyx_L30_next_or; - } else { - } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Add(__pyx_v_mx, __pyx_t_6); 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_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2343, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __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, 2343, __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, 2343, __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, 2343, __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, 2343, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!__pyx_t_9) { - goto __pyx_L30_next_or; - } else { - } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2343, __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, 2343, __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, 2343, __pyx_L1_error) - if (!__pyx_t_9) { - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = __pyx_t_5; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L28_bool_binop_done; - } - __pyx_L30_next_or:; - /* "collisions.py":2344 - * 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 \ + /* 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.Rect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2452 + * 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_x, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __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, 2344, __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_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_mx, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2344, __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, 2344, __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, 2344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Subtract(__pyx_v_y, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __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_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __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, 2344, __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_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Add(__pyx_v_my, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __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, 2344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __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, 2344, __pyx_L1_error) - if (!__pyx_t_9) { - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_1 = __pyx_t_6; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L28_bool_binop_done; - } - __pyx_L34_next_or:; - /* "collisions.py":2345 - * (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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2345, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_x, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2345, __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, 2345, __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, 2345, __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, 2345, __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, 2345, __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, 2345, __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, 2345, __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, 2345, __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, 2345, __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, 2345, __pyx_L1_error) - if (!__pyx_t_9) { - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Rect_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_4Rect_2rect, "\n Returns the rectangle bounding box surrounding this rectangle, which is virtually just the rectangle itself in a different form.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); +static PyMethodDef __pyx_mdef_10collisions_4Rect_3rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_3rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_2rect}; +static PyObject *__pyx_pw_10collisions_4Rect_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 +) { + 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, 2452, __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, 2452, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; } else { - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L28_bool_binop_done; + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - - /* "collisions.py":2346 - * (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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2346, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Subtract(__pyx_v_mx, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2346, __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, 2346, __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, 2346, __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, 2346, __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, 2346, __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, 2346, __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, 2346, __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, 2346, __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, 2346, __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, 2346, __pyx_L1_error) - if (!__pyx_t_9) { - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_1 = __pyx_t_6; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L28_bool_binop_done; + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2452, __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.Rect.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Rect_2rect(__pyx_self, __pyx_v_self); - /* "collisions.py":2347 - * ((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, 2347, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_x, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2347, __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, 2347, __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, 2347, __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, 2347, __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, 2347, __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, 2347, __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, 2347, __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, 2347, __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, 2347, __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, 2347, __pyx_L1_error) - if (!__pyx_t_9) { - __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_L28_bool_binop_done; + /* 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":2348 - * (((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, Arc): - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Subtract(__pyx_v_mx, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2348, __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, 2348, __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, 2348, __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, 2348, __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, 2348, __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, 2348, __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, 2348, __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, 2348, __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, 2348, __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_6); - __pyx_t_1 = __pyx_t_6; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_L28_bool_binop_done:; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; +static PyObject *__pyx_pf_10collisions_4Rect_2rect(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_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":2341 - * any([i.collides(othershape) for i in self.toLines()]) - * ) - * if checkShpType(othershape, 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 \ + /* "collisions.py":2459 + * 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) # <<<<<<<<<<<<<< + * + * 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, 2459, __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, 2459, __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, 2459, __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, 2459, __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, 2459, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2459, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; } - - /* "collisions.py":2350 - * (((mx) - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) - * ) - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< - * if any(self._collides(Point(*i)) for i in othershape.endPoints()): - * return True - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2350, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2350, __pyx_L1_error) + __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, 2459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - __pyx_t_4 = 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_4 = 1; - } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2459, __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, 2459, __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, 2459, __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, 2459, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2459, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_othershape, __pyx_t_3}; - __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, 2350, __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_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, 2459, __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, 2459, __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, 2459, __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, 2459, __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, 2459, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2459, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_6); + __pyx_t_4 = __pyx_t_6; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_4 = __pyx_t_2; + } + __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, 2459, __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, 2459, __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, 2459, __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, 2459, __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, 2459, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2459, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_7); + __pyx_t_6 = __pyx_t_7; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = __pyx_t_2; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2350, __pyx_L1_error) + __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, 2459, __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, 2459, __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, 2459, __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, 2459, __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, 2459, __pyx_L1_error); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; - /* "collisions.py":2351 - * ) - * if checkShpType(othershape, Arc): - * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< - * return True - * for i in self.toLines(): + /* "collisions.py":2452 + * 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __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, 2351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_6 = __pyx_pf_10collisions_4Rect_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2351, __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, 2351, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { - /* "collisions.py":2352 - * if checkShpType(othershape, Arc): - * if any(self._collides(Point(*i)) for i in othershape.endPoints()): - * return True # <<<<<<<<<<<<<< - * for i in self.toLines(): - * if othershape.collides(i): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - 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_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("collisions.Rect.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":2351 - * ) - * if checkShpType(othershape, Arc): - * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< - * return True - * for i in self.toLines(): +/* "collisions.py":2461 + * 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. */ - } - /* "collisions.py":2353 - * 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_4 = 1; +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Rect_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_4Rect_4area, "\n Gets the area of the shape; width * height.\n\n Returns:\n Number: self.w * self.h\n "); +static PyMethodDef __pyx_mdef_10collisions_4Rect_5area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_5area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_4area}; +static PyObject *__pyx_pw_10collisions_4Rect_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; + #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("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, 2461, __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, 2461, __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, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __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, 2353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); - __pyx_t_10 = 0; - __pyx_t_11 = NULL; - } else { - __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2353, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - { - 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, 2353, __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_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2353, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #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, 2353, __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_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2353, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_11(__pyx_t_6); - 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, 2353, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":2354 - * 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, 2354, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2354, __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, 2354, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { - - /* "collisions.py":2355 - * for i in self.toLines(): - * if othershape.collides(i): - * return True # <<<<<<<<<<<<<< - * return False - * if checkShpType(othershape, Rect): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L0; - - /* "collisions.py":2354 - * return True - * for i in self.toLines(): - * if othershape.collides(i): # <<<<<<<<<<<<<< - * return True - * return False - */ - } - - /* "collisions.py":2353 - * 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "collisions.py":2356 - * if othershape.collides(i): - * return True - * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Rect): - * ox, oy, omx, omy = othershape.rect() - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "collisions.py":2350 - * (((mx) - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) - * ) - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< - * if any(self._collides(Point(*i)) for i in othershape.endPoints()): - * return True - */ - } - - /* "collisions.py":2357 - * return True - * return False - * if checkShpType(othershape, 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, 2357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } + __pyx_v_self = values[0]; } - #endif + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2461, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_othershape, __pyx_t_3}; - __pyx_t_6 = __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2357, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_9) { - - /* "collisions.py":2358 - * return False - * if checkShpType(othershape, 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, 2358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 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_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { - PyObject* sequence = __pyx_t_6; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2358, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); - } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_5 = PyList_GET_ITEM(sequence, 2); - __pyx_t_2 = PyList_GET_ITEM(sequence, 3); - } - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); - #else - { - Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_5,&__pyx_t_2}; - for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2358, __pyx_L1_error) - __Pyx_GOTREF(item); - *(temps[i]) = item; - } - } - #endif - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else { - Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_5,&__pyx_t_2}; - __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L48_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2358, __pyx_L1_error) - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L49_unpacking_done; - __pyx_L48_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2358, __pyx_L1_error) - __pyx_L49_unpacking_done:; + 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_ox = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_oy = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_omx = __pyx_t_5; - __pyx_t_5 = 0; - __pyx_v_omy = __pyx_t_2; - __pyx_t_2 = 0; + } + __Pyx_AddTraceback("collisions.Rect.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Rect_4area(__pyx_self, __pyx_v_self); - /* "collisions.py":2359 - * if checkShpType(othershape, Rect): - * ox, oy, omx, omy = othershape.rect() - * return x <= omx and mx >= ox and y <= omy and my >= oy # <<<<<<<<<<<<<< - * return othershape._collides(self) - * - */ - __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, 2359, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2359, __pyx_L1_error) - if (__pyx_t_9) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = __pyx_t_2; - __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, 2359, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2359, __pyx_L1_error) - if (__pyx_t_9) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = __pyx_t_2; - __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, 2359, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2359, __pyx_L1_error) - if (__pyx_t_9) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L50_bool_binop_done; + /* 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 = PyObject_RichCompare(__pyx_v_my, __pyx_v_oy, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2359, __pyx_L1_error) - __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_L50_bool_binop_done:; - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L0; - - /* "collisions.py":2357 - * return True - * return False - * if checkShpType(othershape, Rect): # <<<<<<<<<<<<<< - * ox, oy, omx, omy = othershape.rect() - * return x <= omx and mx >= ox and y <= omy and my >= oy - */ } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":2360 - * ox, oy, omx, omy = othershape.rect() - * return x <= omx and mx >= ox and y <= omy and my >= oy - * return othershape._collides(self) # <<<<<<<<<<<<<< +static PyObject *__pyx_pf_10collisions_4Rect_4area(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("area", 1); + + /* "collisions.py":2468 + * Number: self.w * self.h + * """ + * return self.w * self.h # <<<<<<<<<<<<<< * - * def toLines(self) -> Iterable[Line]: + * def _containsPoint(self, point: Point) -> bool: */ __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, 2360, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2468, __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, 2468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_self}; - __pyx_t_6 = __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_6)) __PYX_ERR(0, 2360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2331 - * return self.w * self.h + /* "collisions.py":2461 + * 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 _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * x, y, mx, my = self.rect() - * if checkShpType(othershape, Point): + * def area(self) -> Number: # <<<<<<<<<<<<<< + * """ + * Gets the area of the shape; width * height. */ /* function exit code */ @@ -78158,48 +81688,32 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_collides(CYTHON_UNUSED PyObject * __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("collisions.Rect._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Rect.area", __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_mx); - __Pyx_XDECREF(__pyx_v_my); - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_ox); - __Pyx_XDECREF(__pyx_v_oy); - __Pyx_XDECREF(__pyx_v_omx); - __Pyx_XDECREF(__pyx_v_omy); - __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_i); - __Pyx_XDECREF(__pyx_gb_10collisions_4Rect_9_collides_2generator7); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2362 - * return othershape._collides(self) +/* "collisions.py":2470 + * return self.w * self.h * - * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< - * """ - * Returns: + * 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 */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Rect_9toLines(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Rect_7_containsPoint(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_4Rect_8toLines, "\n Returns:\n Iterable[Line]: Get a list of all the Lines that make up this object\n "); -static PyMethodDef __pyx_mdef_10collisions_4Rect_9toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_9toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_8toLines}; -static PyObject *__pyx_pw_10collisions_4Rect_9toLines(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Rect_7_containsPoint = {"_containsPoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_7_containsPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Rect_7_containsPoint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -78207,17 +81721,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; + 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}; + 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("toLines (wrapper)", 0); + __Pyx_RefNannySetupContext("_containsPoint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -78227,10 +81742,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_point,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; @@ -78243,23 +81760,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2362, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2470, __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, 2470, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, 1); __PYX_ERR(0, 2470, __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, "toLines") < 0)) __PYX_ERR(0, 2362, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_containsPoint") < 0)) __PYX_ERR(0, 2470, __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_point = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2362, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2470, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -78269,11 +81798,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Rect.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Rect._containsPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Rect_8toLines(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_4Rect_6_containsPoint(__pyx_self, __pyx_v_self, __pyx_v_point); /* function exit code */ { @@ -78286,344 +81815,182 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Rect_8toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_mx = NULL; + PyObject *__pyx_v_my = 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_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("toLines", 1); - - /* "collisions.py":2367 - * 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_XDECREF(__pyx_r); + __Pyx_RefNannySetupContext("_containsPoint", 1); - /* "collisions.py":2368 - * """ - * 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)), + /* "collisions.py":2471 + * + * 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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2368, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2471, __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, 2368, __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, 2368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2368, __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, 2368, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2368, __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, 2368, __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, 2368, __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, 2368, __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, 2368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2368, __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, 2368, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 2368, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_3 = 0; __pyx_t_3 = NULL; - __pyx_t_7 = 0; + __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__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_2, function); - __pyx_t_7 = 1; + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + 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; - __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, 2368, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - - /* "collisions.py":2369 - * 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, 2369, __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, 2369, __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, 2369, __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, 2369, __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, 2369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2369, __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, 2369, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 2369, __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, 2369, __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, 2369, __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, 2369, __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, 2369, __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, 2369, __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, 2369, __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, 2369, __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, 2369, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9)) __PYX_ERR(0, 2369, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = NULL; - __pyx_t_7 = 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); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 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 != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 2471, __pyx_L1_error) } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __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, 2369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - - /* "collisions.py":2370 - * 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, 2370, __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, 2370, __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, 2370, __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, 2370, __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, 2370, __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, 2370, __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, 2370, __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, 2370, __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, 2370, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6)) __PYX_ERR(0, 2370, __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, 2370, __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, 2370, __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, 2370, __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, 2370, __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, 2370, __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, 2370, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10)) __PYX_ERR(0, 2370, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_10 = 0; - __pyx_t_10 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(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_7 = 1; + #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); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_5 = PyList_GET_ITEM(sequence, 2); + __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + { + 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, 2471, __pyx_L1_error) + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } 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, 2471, __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); + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2471, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 2471, __pyx_L1_error) + __pyx_L4_unpacking_done:; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_5, __pyx_t_9}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __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, 2370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } + __pyx_v_x = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_y = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_mx = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_my = __pyx_t_6; + __pyx_t_6 = 0; - /* "collisions.py":2371 - * 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)) # <<<<<<<<<<<<<< - * ] + /* "collisions.py":2472 + * 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 # <<<<<<<<<<<<<< * + * def _collides(self, othershape: Shape) -> bool: */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Line); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2371, __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, 2371, __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, 2371, __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, 2371, __pyx_L1_error) + __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, 2472, __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, 2371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 2472, __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, 2472, __pyx_L1_error) + } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2371, __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, 2371, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8)) __PYX_ERR(0, 2371, __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, 2371, __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, 2371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2371, __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, 2371, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5)) __PYX_ERR(0, 2371, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_7 = 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_7 = 1; - } + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2472, __pyx_L1_error) + if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __Pyx_INCREF(__pyx_t_5); + __pyx_t_1 = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5_bool_binop_done; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_10}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_point, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2472, __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, 2472, __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, 2472, __pyx_L1_error) + if (__pyx_t_9) { __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, 2371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __Pyx_INCREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5_bool_binop_done; } - - /* "collisions.py":2367 - * 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, 2367, __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, 2367, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 2367, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_4)) __PYX_ERR(0, 2367, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 3, __pyx_t_3)) __PYX_ERR(0, 2367, __pyx_L1_error); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_point, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2472, __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, 2472, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_1 = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_L5_bool_binop_done:; + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":2362 - * return othershape._collides(self) + /* "collisions.py":2470 + * return self.w * self.h * - * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< - * """ - * Returns: + * 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 */ /* function exit code */ @@ -78631,39 +81998,39 @@ static PyObject *__pyx_pf_10collisions_4Rect_8toLines(CYTHON_UNUSED PyObject *__ __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_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("collisions.Rect.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("collisions.Rect._containsPoint", __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_mx); + __Pyx_XDECREF(__pyx_v_my); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2374 - * ] +/* "collisions.py":2474 + * return x < point.x < mx and y < point.y and my > point.y * - * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Returns: + * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * x, y, mx, my = self.rect() + * if checkShpType(othershape, ShpTyps.Point): */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Rect_11toPoints(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Rect_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*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Rect_10toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object\n "); -static PyMethodDef __pyx_mdef_10collisions_4Rect_11toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_11toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_10toPoints}; -static PyObject *__pyx_pw_10collisions_4Rect_11toPoints(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Rect_9_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_9_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Rect_9_collides(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -78671,17 +82038,18 @@ 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[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("_collides (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -78691,10 +82059,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_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; @@ -78707,23 +82077,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2374, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2474, __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, 2474, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2474, __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, 2374, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 2474, __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_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2374, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2474, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -78733,11 +82115,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Rect.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Rect._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Rect_10toPoints(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_4Rect_8_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -78749,900 +82131,3224 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_10collisions_4Rect_10toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +/* "collisions.py":2494 + * ) + * if checkShpType(othershape, ShpTyps.Arc): + * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< + * return True + * for i in self.toLines(): + */ + +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; 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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 2494, __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_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, 2494, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("collisions.Rect._collides.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_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); + PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = 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; PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + unsigned int __pyx_t_9; + int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("toPoints", 1); - - /* "collisions.py":2379 - * 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_XDECREF(__pyx_r); - - /* "collisions.py":2380 - * """ - * 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, 2380, __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, 2380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2380, __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, 2380, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - - /* "collisions.py":2381 - * 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, 2381, __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, 2381, __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, 2381, __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, 2381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2381, __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, 2381, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2381, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_1 = 0; - - /* "collisions.py":2382 - * [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, 2382, __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, 2382, __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, 2382, __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, 2382, __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, 2382, __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, 2382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2494, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2494, __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, 2494, __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, 2494, __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, 2494, __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, 2494, __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, 2494, __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, 2494, __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, 2494, __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, 2494, __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, 2494, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); + __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, 2494, __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, 2494, __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, 2494, __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, 2494, __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, 2494, __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; + __pyx_t_7 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; + __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, 2494, __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, 2494, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2382, __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, 2382, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2382, __pyx_L1_error); - __pyx_t_5 = 0; - __pyx_t_6 = 0; - - /* "collisions.py":2383 - * [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, 2383, __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, 2383, __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, 2383, __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, 2383, __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, 2383, __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, 2383, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_7)) __PYX_ERR(0, 2383, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_7 = 0; - - /* "collisions.py":2379 - * 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, 2379, __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, 2379, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 2379, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_1)) __PYX_ERR(0, 2379, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_4)) __PYX_ERR(0, 2379, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - __pyx_t_1 = 0; - __pyx_t_4 = 0; - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L0; - - /* "collisions.py":2374 - * ] - * - * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Returns: - */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ + goto __pyx_L0; __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); __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_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("collisions.Rect.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); + #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; } -/* "collisions.py":2386 - * ] +/* "collisions.py":2474 + * return x < point.x < mx and y < point.y and my > point.y * - * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< - * """ - * Clone this object using the latest cloning technology. + * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * x, y, mx, my = self.rect() + * if checkShpType(othershape, ShpTyps.Point): */ -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Rect_13copy(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_4Rect_12copy, "\n Clone this object using the latest cloning technology.\n "); -static PyMethodDef __pyx_mdef_10collisions_4Rect_13copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_13copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_12copy}; -static PyObject *__pyx_pw_10collisions_4Rect_13copy(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("copy (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, 2386, __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, 2386, __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, 2386, __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.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Rect_12copy(__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_4Rect_12copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +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; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_mx = NULL; + PyObject *__pyx_v_my = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_ox = NULL; + PyObject *__pyx_v_oy = NULL; + PyObject *__pyx_v_omx = NULL; + PyObject *__pyx_v_omy = NULL; + PyObject *__pyx_9genexpr49__pyx_v_i = NULL; + PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9 = 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_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - unsigned int __pyx_t_9; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 1); + __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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 2474, __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":2390 - * Clone this object using the latest cloning technology. - * """ - * return Rect(self.x, self.y, self.w, self.h, self.bounciness) # <<<<<<<<<<<<<< + /* "collisions.py":2475 * - * def __setitem__(self, item: int, new: pointLike) -> None: + * 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_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2390, __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, 2475, __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, 2390, __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, 2390, __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, 2390, __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, 2390, __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, 2390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - __pyx_t_9 = 0; + __pyx_t_3 = NULL; + __pyx_t_4 = 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)) { + 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_8); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_9 = 1; + __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 5+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 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; - __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, 2390, __pyx_L1_error) + 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, 2475, __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":2386 - * ] - * - * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< - * """ - * Clone this object using the latest cloning technology. - */ - - /* 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_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("collisions.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":2392 - * 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] - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Rect_15__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_4Rect_15__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_15__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Rect_15__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, 2392, __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, 2392, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2392, __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, 2392, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2392, __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, 2392, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; + 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 != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 2475, __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); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } 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_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_5 = PyList_GET_ITEM(sequence, 2); + __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } - __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, 2392, __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_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + { + 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, 2475, __pyx_L1_error) + __Pyx_GOTREF(item); + *(temps[i]) = item; + } } - } - __Pyx_AddTraceback("collisions.Rect.__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, 2392, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_4Rect_14__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]); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } 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, 2475, __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); + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2475, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 2475, __pyx_L1_error) + __pyx_L4_unpacking_done:; } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_4Rect_14__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; - 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("__setitem__", 1); + __pyx_v_x = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_y = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_mx = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_my = __pyx_t_6; + __pyx_t_6 = 0; - /* "collisions.py":2393 - * - * def __setitem__(self, item: int, new: pointLike) -> None: - * if item == 0: # <<<<<<<<<<<<<< - * self.x, self.y = new[0], new[1] - * elif item == 1: + /* "collisions.py":2476 + * 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_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, 2393, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2393, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2476, __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, 2476, __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, 2476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_4 = 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_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_othershape, __pyx_t_3}; + __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, 2476, __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, 2476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { + if (__pyx_t_9) { - /* "collisions.py":2394 - * 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] + /* "collisions.py":2477 + * 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): + * return self.check_rects(othershape) and ( */ - __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, 2394, __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, 2394, __pyx_L1_error) + __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, 2477, __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, 2477, __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, 2477, __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, 2477, __pyx_L1_error) + if (__pyx_t_9) { + __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_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, 2477, __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, 2394, __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, 2394, __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, 2477, __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, 2477, __pyx_L1_error) + if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + __Pyx_INCREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __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, 2477, __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, 2477, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L6_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":2393 - * - * def __setitem__(self, item: int, new: pointLike) -> None: - * if item == 0: # <<<<<<<<<<<<<< - * self.x, self.y = new[0], new[1] - * elif item == 1: + /* "collisions.py":2476 + * 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): */ - goto __pyx_L3; } - /* "collisions.py":2395 - * 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, 2395, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2395, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "collisions.py":2396 - * 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 + /* "collisions.py":2478 + * 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_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, 2396, __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, 2396, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2478, __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, 2478, __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, 2478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_4 = 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_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_othershape, __pyx_t_5}; + __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, 2478, __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, 2396, __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, 2396, __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, 2396, __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, 2396, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "collisions.py":2395 - * 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: - */ - goto __pyx_L3; } + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2478, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { - /* "collisions.py":2397 - * 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: + /* "collisions.py":2479 + * 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 \ + * (x < othershape.p2[0] and mx > othershape.p2[0] and y < othershape.p2[1] and my > othershape.p2[1]) or \ */ - __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, 2397, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2397, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { + __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, 2479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_4 = 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_4 = 1; + } + } + #endif + { + 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, 2479, __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, 2479, __pyx_L1_error) + if (__pyx_t_9) { + __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_L10_bool_binop_done; + } - /* "collisions.py":2398 - * 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 + /* "collisions.py":2480 + * 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_1 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2398, __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, 2398, __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, 2398, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2480, __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, 2398, __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, 2398, __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, 2398, __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, 2480, __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, 2398, __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, 2398, __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, 2480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "collisions.py":2397 - * 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: - */ - goto __pyx_L3; - } - - /* "collisions.py":2399 - * 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, 2399, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2399, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (likely(__pyx_t_2)) { - - /* "collisions.py":2400 - * 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, 2400, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2480, __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, 2480, __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, 2480, __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, 2480, __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, 2480, __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, 2480, __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, 2480, __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, 2400, __pyx_L1_error) + __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, 2480, __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, 2480, __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, 2480, __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, 2400, __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, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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, 2480, __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; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_5) < 0) __PYX_ERR(0, 2400, __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, 2480, __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, 2400, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2480, __pyx_L1_error) + if (!__pyx_t_9) { + __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_L10_bool_binop_done; + } + __pyx_L12_next_or:; - /* "collisions.py":2399 - * 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: + /* "collisions.py":2481 + * 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()]) + * ) */ - goto __pyx_L3; - } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __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, 2481, __pyx_L1_error) + if (!__pyx_t_9) { + __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_L10_bool_binop_done; + } + __pyx_L16_next_or:; - /* "collisions.py":2402 - * 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) + /* "collisions.py":2482 + * (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()]) # <<<<<<<<<<<<<< * ) + * if checkShpType(othershape, ShpTyps.Circle): */ - /*else*/ { + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __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, 2482, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_4 = 1; + } + } + #endif + { + 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, 2482, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { + __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); + __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, 2482, __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, 2482, __pyx_L22_error) + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + for (;;) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { + { + 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, 2482, __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, 2482, __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, 2482, __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, 2482, __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, 2482, __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, 2482, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_11(__pyx_t_6); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 2482, __pyx_L22_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __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, 2482, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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_4 = 1; + } + } + #endif + { + 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, 2482, __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, 2482, __pyx_L22_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_i); __pyx_9genexpr49__pyx_v_i = 0; + goto __pyx_L26_exit_scope; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_i); __pyx_9genexpr49__pyx_v_i = 0; + 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, 2482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_L10_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":2403 - * else: - * raise IndexError( - * 'List index out of range! Must be 0-3, found: '+str(item) # <<<<<<<<<<<<<< - * ) - * + /* "collisions.py":2478 + * 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_t_4 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2403, __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, 2403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } - /* "collisions.py":2402 - * 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) + /* "collisions.py":2484 + * 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_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2484, __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, 2484, __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, 2484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __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_6))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_5}; + __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; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 2402, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_L3:; - - /* "collisions.py":2392 - * 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] - */ - - /* 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_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("collisions.Rect.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2484, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { -/* "collisions.py":2406 + /* "collisions.py":2485 * ) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return f'' - * + * 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 \ */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Rect_17__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_4Rect_17__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_17__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Rect_17__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, 2406, __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, 2406, __pyx_L3_error) + __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, 2485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_4 = 1; } - } 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, 2406, __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_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, 2485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - } - __Pyx_AddTraceback("collisions.Rect.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Rect_16__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_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2485, __pyx_L1_error) + if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + __Pyx_INCREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L28_bool_binop_done; } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_4Rect_16__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":2407 - * - * def __str__(self): - * return f'' # <<<<<<<<<<<<<< - * - * class RotatedRect(ClosedShape): + /* "collisions.py":2486 + * 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_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2407, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __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, 2486, __pyx_L1_error) + if (!__pyx_t_9) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __Pyx_INCREF(__pyx_t_5); + __pyx_t_1 = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L28_bool_binop_done; + } + __pyx_L30_next_or:; + + /* "collisions.py":2487 + * 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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __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, 2487, __pyx_L1_error) + if (!__pyx_t_9) { + __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_L28_bool_binop_done; + } + __pyx_L34_next_or:; + + /* "collisions.py":2488 + * (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, 2488, __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, 2488, __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, 2488, __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, 2488, __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, 2488, __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, 2488, __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, 2488, __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, 2488, __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, 2488, __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, 2488, __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, 2488, __pyx_L1_error) + if (!__pyx_t_9) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + __Pyx_INCREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L28_bool_binop_done; + } + + /* "collisions.py":2489 + * (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, 2489, __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, 2489, __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, 2489, __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, 2489, __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, 2489, __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, 2489, __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, 2489, __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, 2489, __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, 2489, __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, 2489, __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) + if (!__pyx_t_9) { + __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_L28_bool_binop_done; + } + + /* "collisions.py":2490 + * ((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, 2490, __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_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_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_GOTREF(__pyx_t_6); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_my, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2490, __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_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_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_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_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_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) + if (!__pyx_t_9) { + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + __Pyx_INCREF(__pyx_t_6); + __pyx_t_1 = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L28_bool_binop_done; + } + + /* "collisions.py":2491 + * (((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, 2491, __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_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_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_GOTREF(__pyx_t_3); + __pyx_t_5 = PyNumber_Subtract(__pyx_v_my, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2491, __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_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_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_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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L28_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":2484 + * 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 \ + */ + } + + /* "collisions.py":2493 + * (((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, 2493, __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, 2493, __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, 2493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_4 = 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_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_othershape, __pyx_t_5}; + __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, 2493, __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, 2493, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "collisions.py":2494 + * ) + * 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, 2494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #endif + { + 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, 2494, __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, 2494, __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, 2494, __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, 2494, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "collisions.py":2495 + * if checkShpType(othershape, ShpTyps.Arc): + * if any(self._collides(Point(*i)) for i in othershape.endPoints()): + * return True # <<<<<<<<<<<<<< + * for i in self.toLines(): + * if othershape.collides(i): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "collisions.py":2494 + * ) + * if checkShpType(othershape, ShpTyps.Arc): + * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< + * return True + * for i in self.toLines(): + */ + } + + /* "collisions.py":2496 + * 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, 2496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #endif + { + 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) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + 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_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, 2496, __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, 2496, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + 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, 2496, __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, 2496, __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, 2496, __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, 2496, __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, 2496, __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, 2496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_11(__pyx_t_3); + 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, 2496, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":2497 + * 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, 2497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_4 = 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_4 = 1; + } + } + #endif + { + 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, 2497, __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, 2497, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_9) { + + /* "collisions.py":2498 + * for i in self.toLines(): + * if othershape.collides(i): + * return True # <<<<<<<<<<<<<< + * return False + * if checkShpType(othershape, ShpTyps.Rect): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":2497 + * return True + * for i in self.toLines(): + * if othershape.collides(i): # <<<<<<<<<<<<<< + * return True + * return False + */ + } + + /* "collisions.py":2496 + * 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":2499 + * if othershape.collides(i): + * return True + * return False # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Rect): + * ox, oy, omx, omy = othershape.rect() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "collisions.py":2493 + * (((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 + */ + } + + /* "collisions.py":2500 + * 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, 2500, __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, 2500, __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, 2500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_othershape, __pyx_t_6}; + __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, 2500, __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, 2500, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_9) { + + /* "collisions.py":2501 + * 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, 2501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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_4 = 1; + } + } + #endif + { + 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, 2501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 2501, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); + } else { + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + __pyx_t_5 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = PyList_GET_ITEM(sequence, 3); + } + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + #else + { + 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, 2501, __pyx_L1_error) + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } 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, 2501, __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); + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L48_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2501, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L49_unpacking_done; + __pyx_L48_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 2501, __pyx_L1_error) + __pyx_L49_unpacking_done:; + } + __pyx_v_ox = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_oy = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_v_omx = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_omy = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":2502 + * 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_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, 2502, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2502, __pyx_L1_error) + if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + __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, 2502, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2502, __pyx_L1_error) + if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + __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, 2502, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2502, __pyx_L1_error) + if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + __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, 2502, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L50_bool_binop_done:; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":2500 + * 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 + */ + } + + /* "collisions.py":2503 + * ox, oy, omx, omy = othershape.rect() + * return x <= omx and mx >= ox and y <= omy and my >= oy + * return othershape._collides(self) # <<<<<<<<<<<<<< + * + * 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, 2503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + 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, 2503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":2474 + * 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): + */ + + /* 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_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("collisions.Rect._collides", __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_mx); + __Pyx_XDECREF(__pyx_v_my); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_ox); + __Pyx_XDECREF(__pyx_v_oy); + __Pyx_XDECREF(__pyx_v_omx); + __Pyx_XDECREF(__pyx_v_omy); + __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_i); + __Pyx_XDECREF(__pyx_gb_10collisions_4Rect_9_collides_2generator9); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2505 + * return othershape._collides(self) + * + * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Rect_11toLines(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_4Rect_10toLines, "\n Returns:\n Iterable[Line]: Get a list of all the Lines that make up this object\n "); +static PyMethodDef __pyx_mdef_10collisions_4Rect_11toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_11toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_10toLines}; +static PyObject *__pyx_pw_10collisions_4Rect_11toLines(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, 2505, __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, 2505, __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, 2505, __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.Rect.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Rect_10toLines(__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_4Rect_10toLines(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; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + unsigned int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("toLines", 1); + + /* "collisions.py":2510 + * 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_XDECREF(__pyx_r); + + /* "collisions.py":2511 + * """ + * 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, 2511, __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, 2511, __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, 2511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2511, __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, 2511, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2511, __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, 2511, __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, 2511, __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, 2511, __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, 2511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2511, __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, 2511, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 2511, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_7 = 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_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __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, 2511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "collisions.py":2512 + * 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, 2512, __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, 2512, __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, 2512, __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, 2512, __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, 2512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2512, __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, 2512, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 2512, __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, 2512, __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, 2512, __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, 2512, __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, 2512, __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, 2512, __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, 2512, __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, 2512, __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, 2512, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9)) __PYX_ERR(0, 2512, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_7 = 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); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __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, 2512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "collisions.py":2513 + * 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, 2513, __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, 2513, __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, 2513, __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, 2513, __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, 2513, __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, 2513, __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, 2513, __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, 2513, __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, 2513, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6)) __PYX_ERR(0, 2513, __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, 2513, __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, 2513, __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, 2513, __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, 2513, __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, 2513, __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, 2513, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10)) __PYX_ERR(0, 2513, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(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_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_5, __pyx_t_9}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __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, 2513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + + /* "collisions.py":2514 + * 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, 2514, __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, 2514, __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, 2514, __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, 2514, __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, 2514, __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, 2514, __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, 2514, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8)) __PYX_ERR(0, 2514, __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, 2514, __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, 2514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2514, __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, 2514, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5)) __PYX_ERR(0, 2514, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_7 = 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_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __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, 2514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + + /* "collisions.py":2510 + * 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, 2510, __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, 2510, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 2510, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_4)) __PYX_ERR(0, 2510, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 3, __pyx_t_3)) __PYX_ERR(0, 2510, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "collisions.py":2505 + * return othershape._collides(self) + * + * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + + /* 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_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("collisions.Rect.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2517 + * ] + * + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Rect_13toPoints(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_4Rect_12toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object\n "); +static PyMethodDef __pyx_mdef_10collisions_4Rect_13toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_13toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_12toPoints}; +static PyObject *__pyx_pw_10collisions_4Rect_13toPoints(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("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, 2517, __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, 2517, __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("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2517, __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.Rect.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Rect_12toPoints(__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_4Rect_12toPoints(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; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("toPoints", 1); + + /* "collisions.py":2522 + * 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_XDECREF(__pyx_r); + + /* "collisions.py":2523 + * """ + * 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, 2523, __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, 2523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2523, __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, 2523, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2523, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + + /* "collisions.py":2524 + * 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, 2524, __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, 2524, __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, 2524, __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, 2524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2524, __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, 2524, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2524, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + + /* "collisions.py":2525 + * [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, 2525, __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, 2525, __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, 2525, __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, 2525, __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, 2525, __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, 2525, __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, 2525, __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, 2525, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2525, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + + /* "collisions.py":2526 + * [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, 2526, __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, 2526, __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, 2526, __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, 2526, __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, 2526, __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, 2526, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_7)) __PYX_ERR(0, 2526, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + + /* "collisions.py":2522 + * 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, 2522, __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, 2522, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 2522, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_1)) __PYX_ERR(0, 2522, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_4)) __PYX_ERR(0, 2522, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + + /* "collisions.py":2517 + * ] + * + * 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_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("collisions.Rect.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2529 + * ] + * + * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< + * """ + * Clone this object using the latest cloning technology. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Rect_15copy(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_4Rect_14copy, "\n Clone this object using the latest cloning technology.\n "); +static PyMethodDef __pyx_mdef_10collisions_4Rect_15copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_15copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Rect_14copy}; +static PyObject *__pyx_pw_10collisions_4Rect_15copy(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("copy (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, 2529, __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, 2529, __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, 2529, __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.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Rect_14copy(__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_4Rect_14copy(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; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + unsigned int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 1); + + /* "collisions.py":2533 + * Clone this object using the latest cloning technology. + * """ + * return Rect(self.x, self.y, self.w, self.h, self.bounciness) # <<<<<<<<<<<<<< + * + * 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, 2533, __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, 2533, __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, 2533, __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, 2533, __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, 2533, __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, 2533, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 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_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 5+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 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; + __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, 2533, __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":2529 + * ] + * + * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< + * """ + * Clone this object using the latest cloning technology. + */ + + /* 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_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("collisions.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2535 + * 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] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Rect_17__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_4Rect_17__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_17__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Rect_17__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, 2535, __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, 2535, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2535, __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, 2535, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2535, __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, 2535, __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, 2535, __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.Rect.__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, 2535, __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 */ + 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_4Rect_16__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; + 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("__setitem__", 1); + + /* "collisions.py":2536 + * + * 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, 2536, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2536, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "collisions.py":2537 + * 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, 2537, __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, 2537, __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, 2537, __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, 2537, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":2536 + * + * def __setitem__(self, item: int, new: pointLike) -> None: + * if item == 0: # <<<<<<<<<<<<<< + * self.x, self.y = new[0], new[1] + * elif item == 1: + */ + goto __pyx_L3; + } + + /* "collisions.py":2538 + * 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, 2538, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2538, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "collisions.py":2539 + * 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, 2539, __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, 2539, __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, 2539, __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, 2539, __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, 2539, __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, 2539, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":2538 + * 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: + */ + goto __pyx_L3; + } + + /* "collisions.py":2540 + * 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, 2540, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2540, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "collisions.py":2541 + * 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, 2541, __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, 2541, __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, 2541, __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, 2541, __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, 2541, __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, 2541, __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, 2541, __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, 2541, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "collisions.py":2540 + * 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: + */ + goto __pyx_L3; + } + + /* "collisions.py":2542 + * 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, 2542, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2542, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (likely(__pyx_t_2)) { + + /* "collisions.py":2543 + * 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, 2543, __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, 2543, __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, 2543, __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, 2543, __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, 2543, __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, 2543, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "collisions.py":2542 + * 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: + */ + goto __pyx_L3; + } + + /* "collisions.py":2545 + * 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) + * ) + */ + /*else*/ { + + /* "collisions.py":2546 + * 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, 2546, __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, 2546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "collisions.py":2545 + * 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, 2545, __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, 2545, __pyx_L1_error) + } + __pyx_L3:; + + /* "collisions.py":2535 + * 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] + */ + + /* 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_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("collisions.Rect.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2549 + * ) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return f'' + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Rect_19__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_4Rect_19__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Rect_19__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Rect_19__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, 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, "__str__") < 0)) __PYX_ERR(0, 2549, __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, 2549, __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.Rect.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Rect_18__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_4Rect_18__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":2550 + * + * def __str__(self): + * return f'' # <<<<<<<<<<<<<< + * + * class RotatedRect(ClosedShape): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -79650,9 +85356,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__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, 2407, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2550, __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, 2407, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2550, __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; @@ -79660,13 +85366,13 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__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__3); + __Pyx_INCREF(__pyx_kp_u__6); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__3); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2407, __pyx_L1_error) + __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, 2550, __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, 2407, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2550, __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; @@ -79678,9 +85384,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__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, 2407, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2550, __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, 2407, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2550, __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; @@ -79692,9 +85398,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__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, 2407, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2550, __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, 2407, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2550, __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; @@ -79702,18 +85408,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__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__16); + __Pyx_INCREF(__pyx_kp_u__5); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__16); - PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__16); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2407, __pyx_L1_error) + __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, 2550, __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":2406 + /* "collisions.py":2549 * ) * * def __str__(self): # <<<<<<<<<<<<<< @@ -79734,15 +85440,15 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__str__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2413 - * It is rotated around it's x and y coordinates. +/* "collisions.py":2557 * 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: */ -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; @@ -79752,20 +85458,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, 2413, __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, 2557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2557, __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, 2413, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2557, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2413, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2557, __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, 2413, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 2557, __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, 2413, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 2557, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -79828,7 +85534,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_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) { @@ -79856,7 +85562,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2413, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2557, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -79864,9 +85570,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2413, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2557, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 1); __PYX_ERR(0, 2413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 1); __PYX_ERR(0, 2557, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -79874,9 +85580,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2413, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2557, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 2); __PYX_ERR(0, 2413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 2); __PYX_ERR(0, 2557, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -79884,9 +85590,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2413, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2557, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 3); __PYX_ERR(0, 2413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 3); __PYX_ERR(0, 2557, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -79894,9 +85600,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2413, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2557, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 4); __PYX_ERR(0, 2413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 4); __PYX_ERR(0, 2557, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: @@ -79904,21 +85610,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2413, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2557, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 5); __PYX_ERR(0, 2413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 5); __PYX_ERR(0, 2557, __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, 2413, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2557, __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, 2413, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 2557, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -79941,14 +85647,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, 2413, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2557, __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, 2413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, __pyx_nargs); __PYX_ERR(0, 2557, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -79989,7 +85695,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect___init__(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":2423 + /* "collisions.py":2567 * 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) # <<<<<<<<<<<<<< @@ -79997,23 +85703,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, 2423, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2567, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2423, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2567, __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, 2423, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2567, __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, 2423, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 2567, __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, 2423, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2567, __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, 2423, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2567, __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, 2423, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -80034,13 +85740,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, 2423, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2567, __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":2424 + /* "collisions.py":2568 * """ * super().__init__(bounciness) * self.x, self.y, self.w, self.h, self.rot = x, y, w, h, rotation # <<<<<<<<<<<<<< @@ -80057,44 +85763,44 @@ 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, 2424, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2568, __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, 2424, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2568, __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, 2424, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_w, __pyx_t_2) < 0) __PYX_ERR(0, 2568, __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, 2424, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_h, __pyx_t_4) < 0) __PYX_ERR(0, 2568, __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, 2424, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rot, __pyx_t_6) < 0) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2425 + /* "collisions.py":2569 * 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, 2425, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2569, __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, 2425, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cachedPoints, __pyx_t_6) < 0) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2426 + /* "collisions.py":2570 * 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, 2426, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2570, __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, 2426, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cacheRequirements, __pyx_t_6) < 0) __PYX_ERR(0, 2570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2413 - * It is rotated around it's x and y coordinates. + /* "collisions.py":2557 * 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: @@ -80117,7 +85823,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect___init__(CYTHON_UNUSED PyOb return __pyx_r; } -/* "collisions.py":2428 +/* "collisions.py":2572 * self.cacheRequirements = [] * * def getCache(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -80179,12 +85885,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2428, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2572, __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, 2428, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCache") < 0)) __PYX_ERR(0, 2572, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -80195,7 +85901,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, 2428, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getCache", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2572, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -80222,7 +85928,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":2442 +/* "collisions.py":2586 * cos = math.cos(angle) * sin = math.sin(angle) * def rot(x, y): # <<<<<<<<<<<<<< @@ -80286,7 +85992,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, 2586, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -80294,14 +86000,14 @@ 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, 2586, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, 1); __PYX_ERR(0, 2442, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, 1); __PYX_ERR(0, 2586, __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, 2442, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot") < 0)) __PYX_ERR(0, 2586, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -80314,7 +86020,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, 2442, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2586, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -80342,8 +86048,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_18_getCache *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -80354,10 +86060,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_18_getCache *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":2443 + /* "collisions.py":2587 * sin = math.sin(angle) * def rot(x, y): * return cos * x - sin * y, sin * x + cos * y # <<<<<<<<<<<<<< @@ -80365,39 +86071,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, 2443, __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, 2443, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_cos)) { __Pyx_RaiseClosureNameError("cos"); __PYX_ERR(0, 2587, __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, 2587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_sin)) { __Pyx_RaiseClosureNameError("sin"); __PYX_ERR(0, 2443, __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, 2443, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_sin)) { __Pyx_RaiseClosureNameError("sin"); __PYX_ERR(0, 2587, __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, 2587, __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, 2443, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2587, __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, 2443, __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, 2443, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_sin)) { __Pyx_RaiseClosureNameError("sin"); __PYX_ERR(0, 2587, __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, 2587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_cos)) { __Pyx_RaiseClosureNameError("cos"); __PYX_ERR(0, 2443, __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, 2443, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_cos)) { __Pyx_RaiseClosureNameError("cos"); __PYX_ERR(0, 2587, __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, 2587, __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, 2443, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2587, __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, 2443, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2587, __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, 2443, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2587, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 2443, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 2587, __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":2442 + /* "collisions.py":2586 * cos = math.cos(angle) * sin = math.sin(angle) * def rot(x, y): # <<<<<<<<<<<<<< @@ -80419,7 +86125,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8getCache_rot(PyObject *__p return __pyx_r; } -/* "collisions.py":2428 +/* "collisions.py":2572 * self.cacheRequirements = [] * * def getCache(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -80428,11 +86134,11 @@ 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_18_getCache *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *__pyx_cur_scope; PyObject *__pyx_v_check = NULL; PyObject *__pyx_v_angle = NULL; PyObject *__pyx_v_rot = 0; - PyObject *__pyx_9genexpr48__pyx_v_i = NULL; + PyObject *__pyx_9genexpr51__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -80449,79 +86155,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_18_getCache *)__pyx_tp_new_10collisions___pyx_scope_struct_18_getCache(__pyx_ptype_10collisions___pyx_scope_struct_18_getCache, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2428, __pyx_L1_error) + __PYX_ERR(0, 2572, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "collisions.py":2436 + /* "collisions.py":2580 * 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, 2436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2580, __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, 2436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2580, __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, 2436, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2436, __pyx_L1_error) + __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2580, __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, 2436, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 2580, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2436, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2580, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 2436, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 2580, __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":2437 + /* "collisions.py":2581 * """ * 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, 2437, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cacheRequirements); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2581, __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, 2437, __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, 2581, __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, 2437, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "collisions.py":2438 + /* "collisions.py":2582 * 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, 2438, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cacheRequirements, __pyx_v_check) < 0) __PYX_ERR(0, 2582, __pyx_L1_error) - /* "collisions.py":2439 + /* "collisions.py":2583 * 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, 2439, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2583, __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, 2439, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2583, __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, 2439, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_6 = 0; @@ -80542,23 +86248,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, 2439, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2583, __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":2440 + /* "collisions.py":2584 * 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, 2440, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2584, __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, 2440, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -80579,7 +86285,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, 2440, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -80587,16 +86293,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":2441 + /* "collisions.py":2585 * 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, 2441, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2585, __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, 2441, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -80617,7 +86323,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, 2441, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -80625,85 +86331,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":2442 + /* "collisions.py":2586 * 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__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2442, __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__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rot = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2446 + /* "collisions.py":2590 * 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, 2446, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2590, __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, 2446, __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, 2590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2447 + /* "collisions.py":2591 * (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, 2447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2591, __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, 2447, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2591, __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, 2447, __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, 2591, __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":2448 + /* "collisions.py":2592 * 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, 2448, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2592, __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, 2448, __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, 2592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2444 + /* "collisions.py":2588 * 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, 2444, __pyx_L1_error) + __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2588, __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, 2444, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_tuple__2)) __PYX_ERR(0, 2588, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2444, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2588, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 2444, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 2588, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_3)) __PYX_ERR(0, 2444, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_3)) __PYX_ERR(0, 2588, __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, 2444, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cache, __pyx_t_4) < 0) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2437 + /* "collisions.py":2581 * """ * check = [self.w, self.h, self.rot] * if check != self.cacheRequirements: # <<<<<<<<<<<<<< @@ -80712,7 +86418,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO */ } - /* "collisions.py":2450 + /* "collisions.py":2594 * rot(0, self.h) * ] * return [[i[0]+self.x, i[1]+self.y] for i in self.cache] # <<<<<<<<<<<<<< @@ -80721,18 +86427,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, 2450, __pyx_L6_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2594, __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, 2450, __pyx_L6_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2594, __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, 2450, __pyx_L6_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2594, __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, 2450, __pyx_L6_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2594, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -80741,28 +86447,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, 2450, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2594, __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, 2450, __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, 2594, __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, 2450, __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, 2594, __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, 2450, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2594, __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, 2450, __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, 2594, __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, 2450, __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, 2594, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -80772,46 +86478,46 @@ 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, 2450, __pyx_L6_error) + else __PYX_ERR(0, 2594, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_i, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr51__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_9genexpr48__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2450, __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, 2594, __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, 2450, __pyx_L6_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2594, __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, 2450, __pyx_L6_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2594, __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_9genexpr48__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2450, __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, 2594, __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, 2450, __pyx_L6_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2594, __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, 2450, __pyx_L6_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2594, __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, 2450, __pyx_L6_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2594, __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, 2450, __pyx_L6_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 2594, __pyx_L6_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_10)) __PYX_ERR(0, 2450, __pyx_L6_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_10)) __PYX_ERR(0, 2594, __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, 2450, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2594, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_i); __pyx_9genexpr48__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_i); __pyx_9genexpr51__pyx_v_i = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_i); __pyx_9genexpr48__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_i); __pyx_9genexpr51__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ @@ -80819,7 +86525,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2428 + /* "collisions.py":2572 * self.cacheRequirements = [] * * def getCache(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -80841,14 +86547,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO __Pyx_XDECREF(__pyx_v_check); __Pyx_XDECREF(__pyx_v_angle); __Pyx_XDECREF(__pyx_v_rot); - __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_i); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2452 +/* "collisions.py":2596 * return [[i[0]+self.x, i[1]+self.y] for i in self.cache] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -80910,12 +86616,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2452, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2596, __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, 2452, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 2596, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -80926,7 +86632,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, 2452, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2596, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -80955,10 +86661,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_ps = NULL; - PyObject *__pyx_9genexpr49__pyx_v_i = NULL; - PyObject *__pyx_9genexpr50__pyx_v_i = NULL; - PyObject *__pyx_9genexpr51__pyx_v_i = NULL; PyObject *__pyx_9genexpr52__pyx_v_i = NULL; + PyObject *__pyx_9genexpr53__pyx_v_i = NULL; + PyObject *__pyx_9genexpr54__pyx_v_i = NULL; + PyObject *__pyx_9genexpr55__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -80975,14 +86681,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":2459 + /* "collisions.py":2603 * 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, 2459, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -81002,14 +86708,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, 2459, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __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":2460 + /* "collisions.py":2604 * """ * 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]) # <<<<<<<<<<<<<< @@ -81018,16 +86724,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, 2460, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L5_error) + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L5_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2604, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -81035,28 +86741,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, 2460, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2604, __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, 2460, __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, 2604, __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, 2460, __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, 2604, __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, 2460, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2604, __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, 2460, __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, 2604, __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, 2460, __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, 2604, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -81066,41 +86772,41 @@ 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, 2460, __pyx_L5_error) + else __PYX_ERR(0, 2604, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_i, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr52__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_9genexpr49__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2460, __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, 2604, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2460, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2604, __pyx_L5_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_i); __pyx_9genexpr49__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_i); __pyx_9genexpr52__pyx_v_i = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_i); __pyx_9genexpr49__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_i); __pyx_9genexpr52__pyx_v_i = 0; 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, 2460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L12_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L12_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L12_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2604, __pyx_L12_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -81108,28 +86814,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, 2460, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2604, __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, 2460, __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, 2604, __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, 2460, __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, 2604, __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, 2460, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2604, __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, 2460, __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, 2604, __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, 2460, __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, 2604, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -81139,41 +86845,41 @@ 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, 2460, __pyx_L12_error) + else __PYX_ERR(0, 2604, __pyx_L12_error) } break; } __Pyx_GOTREF(__pyx_t_7); } - __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_i, __pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr50__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2460, __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, 2604, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2460, __pyx_L12_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2604, __pyx_L12_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_i); __pyx_9genexpr50__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_i); __pyx_9genexpr53__pyx_v_i = 0; goto __pyx_L16_exit_scope; __pyx_L12_error:; - __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_i); __pyx_9genexpr50__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_i); __pyx_9genexpr53__pyx_v_i = 0; 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, 2460, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L19_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L19_error) + __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L19_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2604, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -81181,28 +86887,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, 2460, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2604, __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, 2460, __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, 2604, __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, 2460, __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, 2604, __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, 2460, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2604, __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, 2460, __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, 2604, __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, 2460, __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, 2604, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -81212,41 +86918,41 @@ 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, 2460, __pyx_L19_error) + else __PYX_ERR(0, 2604, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_8); } - __Pyx_XDECREF_SET(__pyx_9genexpr51__pyx_v_i, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr54__pyx_v_i, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr51__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2460, __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, 2604, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 2460, __pyx_L19_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 2604, __pyx_L19_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_i); __pyx_9genexpr51__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_i); __pyx_9genexpr54__pyx_v_i = 0; goto __pyx_L23_exit_scope; __pyx_L19_error:; - __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_i); __pyx_9genexpr51__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_i); __pyx_9genexpr54__pyx_v_i = 0; 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, 2460, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L26_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L26_error) + __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L26_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2604, __pyx_L26_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -81254,28 +86960,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, 2460, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2604, __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, 2460, __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, 2604, __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, 2460, __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, 2604, __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, 2460, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2604, __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, 2460, __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, 2604, __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, 2460, __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, 2604, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -81285,40 +86991,40 @@ 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, 2460, __pyx_L26_error) + else __PYX_ERR(0, 2604, __pyx_L26_error) } break; } __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_9genexpr52__pyx_v_i, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr55__pyx_v_i, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_9genexpr52__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2460, __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, 2604, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2460, __pyx_L26_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2604, __pyx_L26_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_i); __pyx_9genexpr52__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr55__pyx_v_i); __pyx_9genexpr55__pyx_v_i = 0; goto __pyx_L30_exit_scope; __pyx_L26_error:; - __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_i); __pyx_9genexpr52__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr55__pyx_v_i); __pyx_9genexpr55__pyx_v_i = 0; 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, 2460, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2604, __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, 2460, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 2604, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 2460, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 2604, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7)) __PYX_ERR(0, 2460, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7)) __PYX_ERR(0, 2604, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8)) __PYX_ERR(0, 2460, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8)) __PYX_ERR(0, 2604, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_7 = 0; @@ -81327,7 +87033,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2452 + /* "collisions.py":2596 * return [[i[0]+self.x, i[1]+self.y] for i in self.cache] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -81347,16 +87053,16 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ps); - __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_i); __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr55__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2462 +/* "collisions.py":2606 * 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: # <<<<<<<<<<<<<< @@ -81418,12 +87124,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2462, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2606, __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, 2462, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 2606, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -81434,7 +87140,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, 2462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2606, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -81472,19 +87178,19 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_6area(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":2469 + /* "collisions.py":2613 * Number: self.w * self.h * """ * return self.w * self.h # <<<<<<<<<<<<<< * - * def _collides(self, othershape: Shape) -> bool: + * 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, 2469, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2613, __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, 2469, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2613, __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, 2469, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2613, __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; @@ -81492,7 +87198,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_6area(CYTHON_UNUSED PyObjec __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2462 + /* "collisions.py":2606 * 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: # <<<<<<<<<<<<<< @@ -81513,24 +87219,305 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_6area(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":2471 +/* "collisions.py":2615 * 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) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_11RotatedRect_9_containsPoint(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_11RotatedRect_9_containsPoint = {"_containsPoint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_9_containsPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11RotatedRect_9_containsPoint(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; + #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("_containsPoint (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,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, 2615, __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, 2615, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, 1); __PYX_ERR(0, 2615, __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, 2615, __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_point = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2615, __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.RotatedRect._containsPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_11RotatedRect_8_containsPoint(__pyx_self, __pyx_v_self, __pyx_v_point); + + /* 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_11RotatedRect_8_containsPoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point) { + PyObject *__pyx_v_newp = 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; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_containsPoint", 1); + + /* "collisions.py":2616 + * + * 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, 2616, __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, 2616, __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, 2616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2616, __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, 2616, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2616, __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, 2616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_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[4] = {__pyx_t_4, __pyx_t_5, __pyx_v_point, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); + __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, 2616, __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":2617 + * 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) # <<<<<<<<<<<<<< + * + * 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, 2617, __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, 2617, __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, 2617, __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, 2617, __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, 2617, __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, 2617, __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, 2617, __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, 2617, __pyx_L1_error) + if (__pyx_t_9) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + __Pyx_INCREF(__pyx_t_5); + __pyx_t_1 = __pyx_t_5; + __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, 2617, __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, 2617, __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, 2617, __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, 2617, __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, 2617, __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, 2617, __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, 2617, __pyx_L1_error) + __Pyx_DECREF(__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; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":2615 + * 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) + */ + + /* 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_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("collisions.RotatedRect._containsPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_newp); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2619 + * 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 */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11RotatedRect_9_collides(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11RotatedRect_11_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_11RotatedRect_9_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_9_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11RotatedRect_9_collides(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11RotatedRect_11_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_11_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11RotatedRect_11_collides(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -81577,7 +87564,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2471, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2619, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -81585,14 +87572,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2471, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2619, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2471, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2619, __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, 2471, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 2619, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -81605,7 +87592,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, 2471, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2619, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -81619,7 +87606,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11RotatedRect_8_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_11RotatedRect_10_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -81631,40 +87618,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +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":2499 +/* "collisions.py":2640 * return False - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ static PyObject *__pyx_pf_10collisions_11RotatedRect_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_24_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_20_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_20_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2499, __pyx_L1_error) + __PYX_ERR(0, 2640, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_23__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_2generator8, 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, 2499, __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, 2640, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -81680,9 +87667,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_9_collides_genexpr(PyObject return __pyx_r; } -static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -81706,16 +87693,16 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator8(__py return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2499, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2499, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2640, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2640, __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, 2499, __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, 2640, __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, 2499, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2640, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -81723,28 +87710,28 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_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, 2499, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2640, __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, 2499, __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, 2640, __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, 2499, __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, 2640, __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, 2499, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2640, __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, 2499, __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, 2640, __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, 2499, __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, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -81754,7 +87741,7 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_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, 2499, __pyx_L1_error) + else __PYX_ERR(0, 2640, __pyx_L1_error) } break; } @@ -81764,14 +87751,14 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator8(__py __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, 2499, __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, 2499, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2640, __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, 2640, __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, 2499, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2640, __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, 2499, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2640, __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, 2499, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2640, __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; @@ -81794,11 +87781,11 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_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, 2499, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2640, __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, 2499, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_10) { __Pyx_XDECREF(__pyx_r); @@ -81839,22 +87826,20 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator8(__py return __pyx_r; } -/* "collisions.py":2471 - * return self.w * self.h +/* "collisions.py":2619 + * 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 */ -static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *__pyx_cur_scope; - PyObject *__pyx_v_ps = NULL; - int __pyx_v_c; - Py_ssize_t __pyx_v_j; - PyObject *__pyx_v_i = NULL; +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; + PyObject *__pyx_v_newp = NULL; PyObject *__pyx_v_li = NULL; - PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator8 = 0; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -81864,22 +87849,21 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_collides", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_19__collides(__pyx_ptype_10collisions___pyx_scope_struct_19__collides, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2471, __pyx_L1_error) + __PYX_ERR(0, 2619, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -81887,14 +87871,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":2472 + /* "collisions.py":2620 * * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Point): + * 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, 2472, __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, 2620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -81914,55 +87898,58 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py 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, 2472, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2620, __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, 2472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "collisions.py":2473 + /* "collisions.py":2621 * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): - * ps = self.toPoints() + * if checkShpType(othershape, ShpTyps.Point): + * newp = rotate((self.x, self.y), othershape, -self.rot) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2472 + /* "collisions.py":2620 * * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): */ } - /* "collisions.py":2474 + /* "collisions.py":2622 * if not self.check_rects(othershape): * return False - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< - * ps = self.toPoints() - * c = 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, 2474, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2622, __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, 2474, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __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_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_7)) { + __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_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -81970,31 +87957,48 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_7}; __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2474, __pyx_L1_error) + __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, 2622, __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, 2474, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2622, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2475 + /* "collisions.py":2623 * return False - * if checkShpType(othershape, Point): - * ps = self.toPoints() # <<<<<<<<<<<<<< - * c = False - * j = len(ps) - 1 + * 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2475, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2623, __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, 2623, __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, 2623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2623, __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, 2623, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 2623, __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, 2623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { + 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); @@ -82006,402 +88010,212 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #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); + PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_8, __pyx_v_othershape, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2475, __pyx_L1_error) + __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, 2623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_v_ps = __pyx_t_1; + __pyx_v_newp = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2476 - * if checkShpType(othershape, Point): - * ps = self.toPoints() - * c = False # <<<<<<<<<<<<<< - * j = len(ps) - 1 - * for i in range(len(ps)): - */ - __pyx_v_c = 0; - - /* "collisions.py":2477 - * ps = self.toPoints() - * 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, 2477, __pyx_L1_error) - __pyx_v_j = (__pyx_t_8 - 1); - - /* "collisions.py":2478 - * 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]): + /* "collisions.py":2624 + * 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): + * for li in self.toLines(): */ - __pyx_t_8 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2478, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2478, __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, 2478, __pyx_L1_error) + __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, 2624, __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)) { - __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); - __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, 2478, __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, 2478, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - 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, 2478, __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, 2478, __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, 2478, __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, 2478, __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, 2478, __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, 2478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } - } else { - __pyx_t_2 = __pyx_t_9(__pyx_t_1); - 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, 2478, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); - __pyx_t_2 = 0; - - /* "collisions.py":2479 - * 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, 2479, __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, 2479, __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_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2479, __pyx_L1_error) - __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_ps, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2479, __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, 2479, __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_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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, 2479, __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_L8_bool_binop_done; - } - - /* "collisions.py":2480 - * 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, 2480, __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, 2480, __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, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __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, 2480, __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, 2480, __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, 2624, __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, 2624, __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, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2480, __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, 2624, __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, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __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, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __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, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Multiply(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __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, 2624, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2480, __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_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2624, __pyx_L1_error) + if (__pyx_t_6) { + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else { + __Pyx_INCREF(__pyx_t_8); + __pyx_t_1 = __pyx_t_8; + __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, 2624, __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, 2624, __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, 2624, __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, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2480, __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, 2624, __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, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __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, 2624, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2480, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2480, __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":2479 - * 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 - */ - if (__pyx_t_6) { - - /* "collisions.py":2481 - * 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 - * return c - */ - __pyx_v_c = (!__pyx_v_c); - - /* "collisions.py":2479 - * 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 - */ - } - - /* "collisions.py":2482 - * (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, 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, 2482, __pyx_L1_error) - __pyx_v_j = __pyx_t_12; - - /* "collisions.py":2478 - * 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "collisions.py":2483 - * c = not c - * j = i - * return c # <<<<<<<<<<<<<< - * if checkShpType(othershape, Line): - * 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, 2483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L5_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2474 + /* "collisions.py":2622 * if not self.check_rects(othershape): * return False - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< - * ps = self.toPoints() - * c = 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) */ } - /* "collisions.py":2484 - * j = i - * return c - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< + /* "collisions.py":2625 + * 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_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2484, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2625, __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, 2625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = NULL; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; __pyx_t_4 = 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); + 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_11, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_7}; - __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, 2484, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_8}; + __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, 2625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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, 2484, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2485 - * return c - * if checkShpType(othershape, Line): + /* "collisions.py":2626 + * 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_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = NULL; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_7); + 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_11, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { - 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, 2485, __pyx_L1_error) + 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, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); - __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2485, __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, 2485, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2626, __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, 2626, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_11))) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); + 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, 2485, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2626, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_11 >= __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, 2485, __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, 2626, __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, 2485, __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, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); + 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, 2485, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2626, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_11 >= __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, 2485, __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, 2626, __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, 2485, __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, 2626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_1 = __pyx_t_9(__pyx_t_11); + __pyx_t_1 = __pyx_t_12(__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, 2485, __pyx_L1_error) + else __PYX_ERR(0, 2626, __pyx_L1_error) } break; } @@ -82410,42 +88224,42 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2486 - * if checkShpType(othershape, Line): + /* "collisions.py":2627 + * 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = NULL; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __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_2); + if (likely(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_7, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2486, __pyx_L1_error) + 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, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __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, 2486, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2487 + /* "collisions.py":2628 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -82455,11 +88269,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2486 - * if checkShpType(othershape, Line): + /* "collisions.py":2627 + * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True @@ -82467,35 +88281,35 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py */ } - /* "collisions.py":2485 - * return c - * if checkShpType(othershape, Line): + /* "collisions.py":2626 + * 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_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2488 + /* "collisions.py":2629 * 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, 2488, __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, 2629, __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, 2488, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2629, __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, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2488, __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, 2488, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2629, __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_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2488, __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_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2629, __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; __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -82512,42 +88326,42 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7}; + __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2629, __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_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2488, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2629, __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_L17_bool_binop_done; + 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, 2488, __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, 2629, __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, 2488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __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, 2488, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2629, __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, 2629, __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, 2629, __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_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2629, __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; - __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; __pyx_t_4 = 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)) { + __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_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -82555,33 +88369,33 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; - __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; + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3}; + __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_11)) __PYX_ERR(0, 2488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2629, __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_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2488, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2629, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_5; - __pyx_L17_bool_binop_done:; + __pyx_L13_bool_binop_done:; if (__pyx_t_6) { - /* "collisions.py":2489 + /* "collisions.py":2630 * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): * return True # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Circle): + * if checkShpType(othershape, ShpTyps.Circle): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2488 + /* "collisions.py":2629 * if li.collides(othershape): * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): # <<<<<<<<<<<<<< @@ -82590,11 +88404,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py */ } - /* "collisions.py":2490 + /* "collisions.py":2631 * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): * return True * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Circle): + * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): */ __Pyx_XDECREF(__pyx_r); @@ -82602,34 +88416,37 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2484 - * j = i - * return c - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< + /* "collisions.py":2625 + * 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): */ } - /* "collisions.py":2491 + /* "collisions.py":2632 * return True * return False - * if checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * 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, 2491, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2632, __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, 2491, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { + __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_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -82637,65 +88454,65 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; - __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2491, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_8}; + __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, 2632, __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_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2491, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2632, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2492 + /* "collisions.py":2633 * return False - * if checkShpType(othershape, Circle): + * 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, 2492, __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, 2633, __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, 2492, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2633, __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, 2633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_13 = NULL; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - 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_7); - __Pyx_INCREF(__pyx_t_13); + if (unlikely(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_7, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_2, __pyx_t_10}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_7, __pyx_t_9}; + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __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, 2633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_7 = NULL; + __pyx_t_3 = NULL; __pyx_t_4 = 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)) { + __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_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -82703,20 +88520,20 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; - __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, 2492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8}; + __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, 2633, __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_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2492, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2633, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2493 - * if checkShpType(othershape, Circle): + /* "collisions.py":2634 + * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): * return True # <<<<<<<<<<<<<< * for li in self.toLines(): @@ -82727,32 +88544,32 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2492 + /* "collisions.py":2633 * return False - * if checkShpType(othershape, Circle): + * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): # <<<<<<<<<<<<<< * return True * for li in self.toLines(): */ } - /* "collisions.py":2494 + /* "collisions.py":2635 * 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, 2494, __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, 2635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; + __pyx_t_8 = NULL; __pyx_t_4 = 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)) { + __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_3); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -82760,110 +88577,110 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + 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, 2635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) { - __pyx_t_1 = __pyx_t_11; __Pyx_INCREF(__pyx_t_1); - __pyx_t_8 = 0; - __pyx_t_9 = NULL; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2494, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2635, __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, 2494, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2635, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_9)) { + if (likely(!__pyx_t_12)) { 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, 2494, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2635, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_11 >= __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, 2494, __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, 2635, __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, 2494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2635, __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, 2494, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2635, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_11 >= __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, 2494, __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, 2635, __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, 2494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2635, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_11 = __pyx_t_9(__pyx_t_1); - if (unlikely(!__pyx_t_11)) { + __pyx_t_2 = __pyx_t_12(__pyx_t_1); + 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, 2494, __pyx_L1_error) + else __PYX_ERR(0, 2635, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_11); - __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_2); + __pyx_t_2 = 0; - /* "collisions.py":2495 + /* "collisions.py":2636 * return True * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = NULL; __pyx_t_4 = 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); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __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, 2495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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, 2636, __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_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2495, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2636, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2496 + /* "collisions.py":2637 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); @@ -82871,7 +88688,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2495 + /* "collisions.py":2636 * return True * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< @@ -82880,7 +88697,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py */ } - /* "collisions.py":2494 + /* "collisions.py":2635 * if self._collides(Point(othershape.x, othershape.y)): * return True * for li in self.toLines(): # <<<<<<<<<<<<<< @@ -82890,11 +88707,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2497 + /* "collisions.py":2638 * if li.collides(othershape): * return True * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): */ __Pyx_XDECREF(__pyx_r); @@ -82902,96 +88719,99 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2491 + /* "collisions.py":2632 * return True * return False - * if checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * if self._collides(Point(othershape.x, othershape.y)): * return True */ } - /* "collisions.py":2498 + /* "collisions.py":2639 * return True * return False - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * 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, 2498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2639, __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, 2639, __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, 2639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_7); + 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_11, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_othershape, __pyx_t_3}; + __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, 2498, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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, 2498, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2499 + /* "collisions.py":2640 * return False - * if checkShpType(othershape, Arc): + * 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, 2499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2640, __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_11))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); + 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_11); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, 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_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __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, 2499, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_11 = __pyx_pf_10collisions_11RotatedRect_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __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, 2640, __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_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2499, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2640, __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, 2499, __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, 2640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2500 - * if checkShpType(othershape, Arc): + /* "collisions.py":2641 + * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True # <<<<<<<<<<<<<< * for i in self.toLines(): @@ -83002,94 +88822,94 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2499 + /* "collisions.py":2640 * return False - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ } - /* "collisions.py":2501 + /* "collisions.py":2642 * 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, 2501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2642, __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_11))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); + 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_11); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, 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_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __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, 2501, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); - __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2501, __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, 2501, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2642, __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, 2642, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_11))) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); + 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, 2501, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2642, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_11 >= __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, 2501, __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, 2642, __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, 2501, __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, 2642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); + 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, 2501, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2642, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_11 >= __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, 2501, __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, 2642, __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, 2501, __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, 2642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_1 = __pyx_t_9(__pyx_t_11); + __pyx_t_1 = __pyx_t_12(__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, 2501, __pyx_L1_error) + else __PYX_ERR(0, 2642, __pyx_L1_error) } break; } @@ -83098,23 +88918,23 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2502 + /* "collisions.py":2643 * 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, 2502, __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, 2643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_8 = NULL; __pyx_t_4 = 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)) { + __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_7); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; @@ -83122,31 +88942,31 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_i}; + 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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2502, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2643, __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, 2502, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2643, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2503 + /* "collisions.py":2644 * for i in self.toLines(): * if othershape.collides(i): * return True # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2502 + /* "collisions.py":2643 * return True * for i in self.toLines(): * if othershape.collides(i): # <<<<<<<<<<<<<< @@ -83155,7 +88975,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py */ } - /* "collisions.py":2501 + /* "collisions.py":2642 * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True * for i in self.toLines(): # <<<<<<<<<<<<<< @@ -83163,13 +88983,13 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py * return True */ } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2504 + /* "collisions.py":2645 * if othershape.collides(i): * return True * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): */ __Pyx_XDECREF(__pyx_r); @@ -83177,68 +88997,42 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2498 + /* "collisions.py":2639 * return True * return False - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True */ } - /* "collisions.py":2505 + /* "collisions.py":2646 * return True * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): # <<<<<<<<<<<<<< + * 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, 2505, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2505, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; - __pyx_t_4 = 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_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; - __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2505, __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, 2505, __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_L32_bool_binop_done; - } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RotatedRect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2505, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2646, __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, 2646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RotRect); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __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_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { + __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_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -83246,37 +89040,36 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; - __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_8, __pyx_t_9}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); + __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, 2646, __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_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2505, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_6 = __pyx_t_5; - __pyx_L32_bool_binop_done:; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2646, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2506 + /* "collisions.py":2647 * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + * 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, 2506, __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, 2647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; + __pyx_t_9 = NULL; __pyx_t_4 = 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)) { + __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_3); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -83284,105 +89077,105 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + 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, 2647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) { - __pyx_t_1 = __pyx_t_11; __Pyx_INCREF(__pyx_t_1); - __pyx_t_8 = 0; - __pyx_t_9 = NULL; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2506, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2647, __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, 2506, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2647, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_9)) { + if (likely(!__pyx_t_12)) { 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, 2506, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2647, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_11 >= __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, 2506, __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, 2647, __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, 2506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2647, __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, 2506, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2647, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_11 >= __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, 2506, __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, 2647, __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, 2506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_11 = __pyx_t_9(__pyx_t_1); - if (unlikely(!__pyx_t_11)) { + __pyx_t_2 = __pyx_t_12(__pyx_t_1); + 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, 2506, __pyx_L1_error) + else __PYX_ERR(0, 2647, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_11); - __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_2); + __pyx_t_2 = 0; - /* "collisions.py":2507 - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + /* "collisions.py":2648 + * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = NULL; __pyx_t_4 = 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); + if (likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __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, 2507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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, 2648, __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_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2507, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2648, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2508 + /* "collisions.py":2649 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -83395,8 +89188,8 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2507 - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + /* "collisions.py":2648 + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True @@ -83404,9 +89197,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py */ } - /* "collisions.py":2506 + /* "collisions.py":2647 * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True @@ -83414,7 +89207,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2509 + /* "collisions.py":2650 * if li.collides(othershape): * return True * return othershape.collides(Point(self.x, self.y)) or self.collides(Point(othershape.x, othershape.y)) # <<<<<<<<<<<<<< @@ -83422,143 +89215,143 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2509, __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, 2650, __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, 2650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2509, __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, 2650, __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, 2650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = NULL; + __pyx_t_13 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_14); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_2, __pyx_t_13}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_7, __pyx_t_10}; + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __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, 2650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_10 = NULL; + __pyx_t_3 = NULL; __pyx_t_4 = 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); + if (likely(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_3, function); + __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8}; + __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, 2650, __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_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2509, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2650, __pyx_L1_error) if (!__pyx_t_6) { - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __Pyx_INCREF(__pyx_t_11); - __pyx_t_1 = __pyx_t_11; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - goto __pyx_L38_bool_binop_done; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L32_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2509, __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, 2650, __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, 2650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2509, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_14); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_13, __pyx_t_2}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_10, __pyx_t_7}; + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __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, 2650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_10 = NULL; + __pyx_t_3 = NULL; __pyx_t_4 = 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); + if (likely(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_3, function); + __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8}; + __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, 2650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_INCREF(__pyx_t_11); - __pyx_t_1 = __pyx_t_11; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_L38_bool_binop_done:; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L32_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2505 + /* "collisions.py":2646 * return True * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): # <<<<<<<<<<<<<< * for li in self.toLines(): * if li.collides(othershape): */ } - /* "collisions.py":2510 + /* "collisions.py":2651 * return True * return othershape.collides(Point(self.x, self.y)) or self.collides(Point(othershape.x, othershape.y)) * return othershape._collides(self) # <<<<<<<<<<<<<< @@ -83566,36 +89359,36 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py * def toPoints(self) -> Iterable[pointLike]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = NULL; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(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); + 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_11, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_self}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __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, 2510, __pyx_L1_error) + 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, 2651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2471 - * return self.w * self.h + /* "collisions.py":2619 + * 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): @@ -83608,24 +89401,24 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __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_13); - __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("collisions.RotatedRect._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ps); - __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_newp); __Pyx_XDECREF(__pyx_v_li); - __Pyx_XDECREF(__pyx_gb_10collisions_11RotatedRect_9_collides_2generator8); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2512 +/* "collisions.py":2653 * return othershape._collides(self) * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -83634,16 +89427,16 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_collides(CYTHON_UNUSED Py */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11RotatedRect_11toPoints(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11RotatedRect_13toPoints(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_11RotatedRect_10toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object\n "); -static PyMethodDef __pyx_mdef_10collisions_11RotatedRect_11toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_11toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11RotatedRect_10toPoints}; -static PyObject *__pyx_pw_10collisions_11RotatedRect_11toPoints(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_11RotatedRect_12toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object\n "); +static PyMethodDef __pyx_mdef_10collisions_11RotatedRect_13toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_13toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11RotatedRect_12toPoints}; +static PyObject *__pyx_pw_10collisions_11RotatedRect_13toPoints(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -83687,12 +89480,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2512, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2653, __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, 2512, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2653, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -83703,7 +89496,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, 2512, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2653, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -83717,7 +89510,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11RotatedRect_10toPoints(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_11RotatedRect_12toPoints(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -83730,7 +89523,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_11RotatedRect_10toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_11RotatedRect_12toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -83742,7 +89535,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10toPoints(CYTHON_UNUSED Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":2517 + /* "collisions.py":2658 * Iterable[pointLike]: Get a list of all the Points that make up this object * """ * return self.getCache() # <<<<<<<<<<<<<< @@ -83750,7 +89543,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10toPoints(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, 2517, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -83770,7 +89563,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10toPoints(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, 2517, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -83778,7 +89571,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10toPoints(CYTHON_UNUSED Py __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2512 + /* "collisions.py":2653 * return othershape._collides(self) * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -83799,7 +89592,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10toPoints(CYTHON_UNUSED Py return __pyx_r; } -/* "collisions.py":2519 +/* "collisions.py":2660 * return self.getCache() * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -83808,16 +89601,16 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10toPoints(CYTHON_UNUSED Py */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11RotatedRect_13toLines(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11RotatedRect_15toLines(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_11RotatedRect_12toLines, "\n Returns:\n Iterable[Line]: Get a list of all the Lines that make up this object\n "); -static PyMethodDef __pyx_mdef_10collisions_11RotatedRect_13toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_13toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11RotatedRect_12toLines}; -static PyObject *__pyx_pw_10collisions_11RotatedRect_13toLines(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_11RotatedRect_14toLines, "\n Returns:\n Iterable[Line]: Get a list of all the Lines that make up this object\n "); +static PyMethodDef __pyx_mdef_10collisions_11RotatedRect_15toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_15toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11RotatedRect_14toLines}; +static PyObject *__pyx_pw_10collisions_11RotatedRect_15toLines(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -83861,12 +89654,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, 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, "toLines") < 0)) __PYX_ERR(0, 2519, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2660, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -83877,7 +89670,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, 2519, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2660, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -83891,7 +89684,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11RotatedRect_12toLines(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_11RotatedRect_14toLines(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -83904,9 +89697,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_11RotatedRect_14toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_ps = NULL; - Py_ssize_t __pyx_9genexpr54__pyx_v_i; + Py_ssize_t __pyx_9genexpr57__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -83925,14 +89718,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":2524 + /* "collisions.py":2665 * 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, 2524, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -83952,14 +89745,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(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, 2524, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2665, __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":2525 + /* "collisions.py":2666 * """ * ps = self.getCache() * return [ # <<<<<<<<<<<<<< @@ -83968,35 +89761,35 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(CYTHON_UNUSED PyO */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2525, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "collisions.py":2527 + /* "collisions.py":2668 * 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, 2527, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2668, __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_9genexpr54__pyx_v_i = __pyx_t_7; + __pyx_9genexpr57__pyx_v_i = __pyx_t_7; - /* "collisions.py":2526 + /* "collisions.py":2667 * 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, 2526, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_9genexpr54__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2526, __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, 2667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = (__pyx_9genexpr54__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, 2526, __pyx_L1_error) + __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, 2667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -84018,29 +89811,29 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(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, 2526, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __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, 2525, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } /* exit inner scope */ - /* "collisions.py":2528 + /* "collisions.py":2669 * 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, 2528, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __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, 2528, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2669, __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, 2528, __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, 2669, __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, 2528, __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, 2669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -84062,16 +89855,16 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(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, 2528, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __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, 2528, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __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, 2528, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2669, __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, 2528, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __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; @@ -84079,7 +89872,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(CYTHON_UNUSED PyO __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2519 + /* "collisions.py":2660 * return self.getCache() * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -84104,7 +89897,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":2530 +/* "collisions.py":2671 * ] + [Line(ps[len(ps)-1], ps[0])] * * def copy(self) -> 'RotatedRect': # <<<<<<<<<<<<<< @@ -84113,16 +89906,16 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toLines(CYTHON_UNUSED PyO */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11RotatedRect_15copy(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11RotatedRect_17copy(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_11RotatedRect_14copy, "\n Spawn in a duplicate object\n "); -static PyMethodDef __pyx_mdef_10collisions_11RotatedRect_15copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_15copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11RotatedRect_14copy}; -static PyObject *__pyx_pw_10collisions_11RotatedRect_15copy(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_11RotatedRect_16copy, "\n Spawn in a duplicate object\n "); +static PyMethodDef __pyx_mdef_10collisions_11RotatedRect_17copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_17copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_11RotatedRect_16copy}; +static PyObject *__pyx_pw_10collisions_11RotatedRect_17copy(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -84166,12 +89959,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2530, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2671, __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, 2530, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2671, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -84182,7 +89975,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, 2530, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2671, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -84196,7 +89989,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11RotatedRect_14copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_11RotatedRect_16copy(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -84209,7 +90002,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_11RotatedRect_14copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_11RotatedRect_16copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -84227,7 +90020,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14copy(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":2534 + /* "collisions.py":2675 * Spawn in a duplicate object * """ * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) # <<<<<<<<<<<<<< @@ -84235,19 +90028,19 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14copy(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, 2534, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RotatedRect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2675, __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, 2534, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2675, __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, 2534, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2675, __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, 2534, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2675, __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, 2534, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2675, __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, 2534, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2675, __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, 2534, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -84273,7 +90066,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14copy(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, 2534, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -84281,7 +90074,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14copy(CYTHON_UNUSED PyObje __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2530 + /* "collisions.py":2671 * ] + [Line(ps[len(ps)-1], ps[0])] * * def copy(self) -> 'RotatedRect': # <<<<<<<<<<<<<< @@ -84308,7 +90101,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14copy(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":2536 +/* "collisions.py":2677 * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -84317,15 +90110,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14copy(CYTHON_UNUSED PyObje */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11RotatedRect_17__setitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11RotatedRect_19__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_11RotatedRect_17__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_17__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11RotatedRect_17__setitem__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11RotatedRect_19__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_19__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11RotatedRect_19__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -84375,7 +90168,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2536, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2677, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -84383,9 +90176,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2536, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2677, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2536, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2677, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -84393,14 +90186,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2536, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2677, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2536, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2677, __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, 2536, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2677, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -84415,7 +90208,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, 2536, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2677, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -84429,8 +90222,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, 2536, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_11RotatedRect_16__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, 2677, __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 */ goto __pyx_L0; @@ -84447,7 +90240,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":2537 +/* "collisions.py":2678 * * def __setitem__(self, item: int, new: pointLike) -> None: * def rot(x, y): # <<<<<<<<<<<<<< @@ -84511,7 +90304,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, 2678, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -84519,14 +90312,14 @@ 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, 2678, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, 1); __PYX_ERR(0, 2537, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, 1); __PYX_ERR(0, 2678, __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, 2537, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot") < 0)) __PYX_ERR(0, 2678, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -84539,7 +90332,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, 2537, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2678, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -84567,8 +90360,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_21___setitem__ *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -84582,10 +90375,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_21___setitem__ *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":2538 + /* "collisions.py":2679 * def __setitem__(self, item: int, new: pointLike) -> None: * def rot(x, y): * return rotate([self.x, self.y], [x, y], self.rot) # <<<<<<<<<<<<<< @@ -84593,32 +90386,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, 2538, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2538, __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, 2538, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2679, __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, 2679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2538, __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, 2538, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2679, __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, 2679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2538, __pyx_L1_error) + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2679, __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, 2538, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 2679, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2538, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2679, __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, 2538, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2679, __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, 2538, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_x)) __PYX_ERR(0, 2679, __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, 2538, __pyx_L1_error); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2538, __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, 2538, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_y)) __PYX_ERR(0, 2679, __pyx_L1_error); + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2679, __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, 2679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -84641,7 +90434,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, 2538, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -84649,7 +90442,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2537 + /* "collisions.py":2678 * * def __setitem__(self, item: int, new: pointLike) -> None: * def rot(x, y): # <<<<<<<<<<<<<< @@ -84673,7 +90466,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject return __pyx_r; } -/* "collisions.py":2536 +/* "collisions.py":2677 * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -84681,8 +90474,8 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject * return rotate([self.x, self.y], [x, y], self.rot) */ -static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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_21___setitem__ *__pyx_cur_scope; +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; PyObject *__pyx_v_rot = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -84696,11 +90489,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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_21___setitem__ *)__pyx_tp_new_10collisions___pyx_scope_struct_21___setitem__(__pyx_ptype_10collisions___pyx_scope_struct_21___setitem__, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2536, __pyx_L1_error) + __PYX_ERR(0, 2677, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -84708,42 +90501,42 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":2537 + /* "collisions.py":2678 * * 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__31)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2537, __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__33)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rot = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2539 + /* "collisions.py":2680 * 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, 2539, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2539, __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, 2680, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2680, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2540 + /* "collisions.py":2681 * 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, 2540, __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, 2681, __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, 2540, __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, 2681, __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, 2540, __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, 2681, __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; @@ -84753,7 +90546,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2540, __pyx_L1_error) + __PYX_ERR(0, 2681, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -84766,15 +90559,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2540, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2540, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2681, __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, 2540, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2681, __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); @@ -84782,7 +90575,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2540, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2681, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; @@ -84790,15 +90583,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2540, __pyx_L1_error) + __PYX_ERR(0, 2681, __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, 2540, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2681, __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, 2540, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2681, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2539 + /* "collisions.py":2680 * def rot(x, y): * return rotate([self.x, self.y], [x, y], self.rot) * if item == 0: # <<<<<<<<<<<<<< @@ -84808,30 +90601,30 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED goto __pyx_L3; } - /* "collisions.py":2541 + /* "collisions.py":2682 * 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, 2541, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2541, __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, 2682, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2542 + /* "collisions.py":2683 * 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, 2542, __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, 2683, __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, 2542, __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, 2683, __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, 2542, __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, 2683, __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; @@ -84841,7 +90634,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2542, __pyx_L1_error) + __PYX_ERR(0, 2683, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -84854,15 +90647,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2542, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2542, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2683, __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, 2542, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2683, __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); @@ -84870,7 +90663,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2542, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2683, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_unpacking_done; @@ -84878,33 +90671,33 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2542, __pyx_L1_error) + __PYX_ERR(0, 2683, __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, 2542, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2683, __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, 2542, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 2683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2543 + /* "collisions.py":2684 * 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, 2543, __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, 2684, __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, 2543, __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, 2684, __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, 2543, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2684, __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, 2543, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2684, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2541 + /* "collisions.py":2682 * if item == 0: * self.x, self.y = rot(new[0], new[1]) * elif item == 1: # <<<<<<<<<<<<<< @@ -84914,30 +90707,30 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED goto __pyx_L3; } - /* "collisions.py":2544 + /* "collisions.py":2685 * 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, 2544, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2544, __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, 2685, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2685, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2545 + /* "collisions.py":2686 * 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, 2545, __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, 2686, __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, 2545, __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, 2686, __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, 2545, __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, 2686, __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; @@ -84947,7 +90740,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2545, __pyx_L1_error) + __PYX_ERR(0, 2686, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -84960,15 +90753,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2545, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2545, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2686, __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, 2545, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2686, __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); @@ -84976,7 +90769,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2545, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2686, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9_unpacking_done; @@ -84984,51 +90777,51 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2545, __pyx_L1_error) + __PYX_ERR(0, 2686, __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, 2545, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 2686, __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, 2545, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2546 + /* "collisions.py":2687 * 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, 2546, __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, 2687, __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, 2546, __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, 2687, __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, 2546, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2687, __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, 2546, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 2687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2547 + /* "collisions.py":2688 * 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, 2547, __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, 2688, __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, 2547, __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, 2688, __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, 2547, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2688, __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, 2547, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2544 + /* "collisions.py":2685 * self.x, self.y = rot(new[0], new[1]) * self.x -= self.w * elif item == 2: # <<<<<<<<<<<<<< @@ -85038,30 +90831,30 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED goto __pyx_L3; } - /* "collisions.py":2548 + /* "collisions.py":2689 * 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, 2548, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2548, __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, 2689, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":2549 + /* "collisions.py":2690 * 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, 2549, __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, 2690, __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, 2549, __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, 2690, __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, 2549, __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, 2690, __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; @@ -85071,7 +90864,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2549, __pyx_L1_error) + __PYX_ERR(0, 2690, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -85084,15 +90877,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2549, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2549, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2690, __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, 2549, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2690, __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); @@ -85100,7 +90893,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2549, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2690, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L11_unpacking_done; @@ -85108,33 +90901,33 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__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, 2549, __pyx_L1_error) + __PYX_ERR(0, 2690, __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, 2549, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2690, __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, 2549, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2550 + /* "collisions.py":2691 * 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, 2550, __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, 2691, __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, 2550, __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, 2691, __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, 2550, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2691, __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, 2550, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2691, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2548 + /* "collisions.py":2689 * self.x -= self.w * self.y -= self.h * elif item == 3: # <<<<<<<<<<<<<< @@ -85144,7 +90937,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED goto __pyx_L3; } - /* "collisions.py":2552 + /* "collisions.py":2693 * self.y -= self.h * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -85153,36 +90946,36 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED */ /*else*/ { - /* "collisions.py":2553 + /* "collisions.py":2694 * 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, 2553, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2694, __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, 2553, __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, 2694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2552 + /* "collisions.py":2693 * 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, 2552, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2693, __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, 2552, __pyx_L1_error) + __PYX_ERR(0, 2693, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":2536 + /* "collisions.py":2677 * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -85208,7 +91001,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":2556 +/* "collisions.py":2697 * ) * * def __str__(self): # <<<<<<<<<<<<<< @@ -85217,15 +91010,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16__setitem__(CYTHON_UNUSED */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_11RotatedRect_19__str__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_11RotatedRect_21__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_11RotatedRect_19__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_19__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_11RotatedRect_19__str__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_11RotatedRect_21__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_11RotatedRect_21__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_11RotatedRect_21__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -85269,12 +91062,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2556, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2697, __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, 2556, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2697, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -85285,7 +91078,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, 2556, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2697, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -85299,7 +91092,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_11RotatedRect_18__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_11RotatedRect_20__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -85312,7 +91105,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_11RotatedRect_18__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -85327,7 +91120,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__str__(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":2557 + /* "collisions.py":2698 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -85335,7 +91128,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__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, 2557, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -85343,9 +91136,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__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, 2557, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2698, __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, 2557, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2698, __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; @@ -85353,13 +91146,13 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__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__3); + __Pyx_INCREF(__pyx_kp_u__6); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__3); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2557, __pyx_L1_error) + __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, 2698, __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, 2557, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2698, __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; @@ -85371,9 +91164,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__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, 2557, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2698, __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, 2557, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2698, __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; @@ -85385,9 +91178,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__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, 2557, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2698, __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, 2557, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2698, __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; @@ -85399,9 +91192,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__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, 2557, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2698, __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, 2557, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2698, __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; @@ -85414,7 +91207,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__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, 2557, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -85434,11 +91227,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__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, 2557, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2698, __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, 2557, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2698, __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 +91239,18 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__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__16); + __Pyx_INCREF(__pyx_kp_u__5); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__16); - PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_kp_u__16); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 13, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2557, __pyx_L1_error) + __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, 2698, __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":2556 + /* "collisions.py":2697 * ) * * def __str__(self): # <<<<<<<<<<<<<< @@ -85479,15 +91272,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__str__(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":2561 - * class Polygon(ClosedShape): +/* "collisions.py":2703 * """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: */ -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; @@ -85497,20 +91290,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 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2561, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2703, __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, 2561, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2561, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_errorOnLT3, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 2703, __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, 2703, __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, 2561, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bounciness, __pyx_t_2) < 0) __PYX_ERR(0, 2703, __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, 2561, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2703, __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, 2561, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2703, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2561, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2703, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -85576,7 +91369,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_defaults22 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_self); + __pyx_defaults23 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_self); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); if (__pyx_kwds) { Py_ssize_t kw_args; @@ -85593,7 +91386,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2561, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2703, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args > 0 && likely(kw_args <= 2)) { @@ -85601,13 +91394,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, 2561, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2703, __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, 2561, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 2703, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; @@ -85617,14 +91410,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, 2561, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2703, __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, 2561, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 2703, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -85671,7 +91464,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":2572 + /* "collisions.py":2714 * ValueError: When you have a polygon with <3 points. * """ * super().__init__(bounciness) # <<<<<<<<<<<<<< @@ -85679,23 +91472,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, 2572, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2714, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2572, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2714, __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, 2572, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2714, __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, 2572, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 2714, __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, 2572, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2714, __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, 2572, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2714, __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, 2572, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -85716,39 +91509,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, 2572, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2714, __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":2573 + /* "collisions.py":2715 * """ * 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, 2573, __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, 2715, __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, 2573, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_errorOnLT3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 2715, __pyx_L1_error) __pyx_t_6 = __pyx_t_8; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_6)) { - /* "collisions.py":2575 + /* "collisions.py":2717 * 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, 2575, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_9 = 127; @@ -85756,8 +91549,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, 2575, __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, 2575, __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, 2717, __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, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -85767,25 +91560,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, 2575, __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, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2574 + /* "collisions.py":2716 * 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, 2574, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2716, __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, 2574, __pyx_L1_error) + __PYX_ERR(0, 2716, __pyx_L1_error) - /* "collisions.py":2573 + /* "collisions.py":2715 * """ * super().__init__(bounciness) * if len(points) < 3 and errorOnLT3: # <<<<<<<<<<<<<< @@ -85794,21 +91587,21 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":2577 + /* "collisions.py":2719 * 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, 2577, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_v_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2719, __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, 2577, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_points_2, __pyx_t_1) < 0) __PYX_ERR(0, 2719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2561 - * class Polygon(ClosedShape): + /* "collisions.py":2703 * """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: @@ -85830,7 +91623,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":2579 +/* "collisions.py":2721 * self.points = list(points) * * @property # <<<<<<<<<<<<<< @@ -85892,12 +91685,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2579, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2721, __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, 2579, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 2721, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -85908,7 +91701,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, 2579, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2721, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -85936,7 +91729,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_9genexpr55__pyx_v_i = NULL; + PyObject *__pyx_9genexpr58__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -85949,7 +91742,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("x", 1); - /* "collisions.py":2582 + /* "collisions.py":2724 * 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]) # <<<<<<<<<<<<<< @@ -85958,18 +91751,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, 2582, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2724, __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, 2582, __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, 2724, __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, 2582, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2724, __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, 2582, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2724, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -85978,28 +91771,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, 2582, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2724, __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, 2582, __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, 2724, __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, 2582, __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, 2724, __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, 2582, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2724, __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, 2582, __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, 2724, __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, 2582, __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, 2724, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -86009,35 +91802,35 @@ 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, 2582, __pyx_L5_error) + else __PYX_ERR(0, 2724, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr55__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr58__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr55__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2582, __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, 2724, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2582, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2724, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr55__pyx_v_i); __pyx_9genexpr55__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr58__pyx_v_i); __pyx_9genexpr58__pyx_v_i = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr55__pyx_v_i); __pyx_9genexpr55__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr58__pyx_v_i); __pyx_9genexpr58__pyx_v_i = 0; 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, 2582, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2724, __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":2579 + /* "collisions.py":2721 * self.points = list(points) * * @property # <<<<<<<<<<<<<< @@ -86053,13 +91846,13 @@ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx __Pyx_AddTraceback("collisions.Polygon.x", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_9genexpr55__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr58__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2583 +/* "collisions.py":2725 * """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 # <<<<<<<<<<<<<< @@ -86123,7 +91916,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2583, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2725, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -86131,14 +91924,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2583, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2725, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, 1); __PYX_ERR(0, 2583, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, 1); __PYX_ERR(0, 2725, __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, 2583, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 2725, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -86151,7 +91944,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, 2583, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2725, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -86180,7 +91973,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_new) { PyObject *__pyx_v_diff = NULL; - PyObject *__pyx_9genexpr56__pyx_v_i = NULL; + PyObject *__pyx_9genexpr59__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -86195,22 +91988,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("x", 1); - /* "collisions.py":2585 + /* "collisions.py":2727 * @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, 2585, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2727, __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, 2585, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_new, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2727, __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":2586 + /* "collisions.py":2728 * def x(self, new): * diff = new - self.x * self.points = [[i[0]+diff, i[1]] for i in self.points] # <<<<<<<<<<<<<< @@ -86218,18 +92011,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, 2586, __pyx_L5_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2728, __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, 2586, __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, 2728, __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, 2586, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2728, __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, 2586, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2728, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -86238,28 +92031,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, 2586, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2728, __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, 2586, __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, 2728, __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, 2586, __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, 2728, __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, 2586, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2728, __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, 2586, __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, 2728, __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, 2586, __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, 2728, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -86269,44 +92062,44 @@ 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, 2586, __pyx_L5_error) + else __PYX_ERR(0, 2728, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_9genexpr56__pyx_v_i, __pyx_t_1); + __Pyx_XDECREF_SET(__pyx_9genexpr59__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr56__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2586, __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, 2728, __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, 2586, __pyx_L5_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_v_diff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2728, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr56__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2586, __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, 2728, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2586, __pyx_L5_error) + __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2728, __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, 2586, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 2728, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_1)) __PYX_ERR(0, 2586, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_1)) __PYX_ERR(0, 2728, __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, 2586, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2728, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr56__pyx_v_i); __pyx_9genexpr56__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr59__pyx_v_i); __pyx_9genexpr59__pyx_v_i = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr56__pyx_v_i); __pyx_9genexpr56__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr59__pyx_v_i); __pyx_9genexpr59__pyx_v_i = 0; 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, 2586, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_points_2, __pyx_t_2) < 0) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2583 + /* "collisions.py":2725 * """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 # <<<<<<<<<<<<<< @@ -86327,13 +92120,13 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_diff); - __Pyx_XDECREF(__pyx_9genexpr56__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr59__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2587 +/* "collisions.py":2729 * diff = new - self.x * self.points = [[i[0]+diff, i[1]] for i in self.points] * @property # <<<<<<<<<<<<<< @@ -86395,12 +92188,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2587, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2729, __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, 2587, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 2729, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -86411,7 +92204,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, 2587, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2729, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -86439,7 +92232,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_9genexpr57__pyx_v_i = NULL; + PyObject *__pyx_9genexpr60__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -86452,7 +92245,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("y", 1); - /* "collisions.py":2590 + /* "collisions.py":2732 * 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]) # <<<<<<<<<<<<<< @@ -86461,18 +92254,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, 2590, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2732, __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, 2590, __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, 2732, __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, 2590, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2732, __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, 2590, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2732, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -86481,28 +92274,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, 2590, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2732, __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, 2590, __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, 2732, __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, 2590, __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, 2732, __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, 2590, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2732, __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, 2590, __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, 2732, __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, 2590, __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, 2732, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -86512,35 +92305,35 @@ 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, 2590, __pyx_L5_error) + else __PYX_ERR(0, 2732, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr57__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr60__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr57__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2590, __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, 2732, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2590, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2732, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr57__pyx_v_i); __pyx_9genexpr57__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr60__pyx_v_i); __pyx_9genexpr60__pyx_v_i = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr57__pyx_v_i); __pyx_9genexpr57__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr60__pyx_v_i); __pyx_9genexpr60__pyx_v_i = 0; 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, 2590, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2732, __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":2587 + /* "collisions.py":2729 * diff = new - self.x * self.points = [[i[0]+diff, i[1]] for i in self.points] * @property # <<<<<<<<<<<<<< @@ -86556,13 +92349,13 @@ static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx __Pyx_AddTraceback("collisions.Polygon.y", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_9genexpr57__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr60__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2591 +/* "collisions.py":2733 * """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 # <<<<<<<<<<<<<< @@ -86626,7 +92419,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2591, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2733, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -86634,14 +92427,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2591, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2733, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, 1); __PYX_ERR(0, 2591, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, 1); __PYX_ERR(0, 2733, __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, 2591, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 2733, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -86654,7 +92447,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, 2591, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2733, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -86683,7 +92476,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_new) { PyObject *__pyx_v_diff = NULL; - PyObject *__pyx_9genexpr58__pyx_v_i = NULL; + PyObject *__pyx_9genexpr61__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -86698,22 +92491,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("y", 1); - /* "collisions.py":2593 + /* "collisions.py":2735 * @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, 2593, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2735, __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, 2593, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_new, __pyx_t_1); 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; __pyx_v_diff = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2594 + /* "collisions.py":2736 * def y(self, new): * diff = new - self.y * self.points = [[i[0], i[1]+diff] for i in self.points] # <<<<<<<<<<<<<< @@ -86721,18 +92514,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, 2594, __pyx_L5_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2736, __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, 2594, __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, 2736, __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, 2594, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2736, __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, 2594, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2736, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -86741,28 +92534,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, 2594, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2736, __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, 2594, __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, 2736, __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, 2594, __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, 2736, __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, 2594, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2736, __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, 2594, __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, 2736, __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, 2594, __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, 2736, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -86772,44 +92565,44 @@ 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, 2594, __pyx_L5_error) + else __PYX_ERR(0, 2736, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_9genexpr58__pyx_v_i, __pyx_t_1); + __Pyx_XDECREF_SET(__pyx_9genexpr61__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr58__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2594, __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, 2736, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_9genexpr58__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2594, __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, 2736, __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, 2594, __pyx_L5_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_v_diff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2736, __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, 2594, __pyx_L5_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2736, __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, 2594, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2736, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(0, 2594, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(0, 2736, __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, 2594, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 2736, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr58__pyx_v_i); __pyx_9genexpr58__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr61__pyx_v_i); __pyx_9genexpr61__pyx_v_i = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr58__pyx_v_i); __pyx_9genexpr58__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr61__pyx_v_i); __pyx_9genexpr61__pyx_v_i = 0; 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, 2594, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_points_2, __pyx_t_2) < 0) __PYX_ERR(0, 2736, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2591 + /* "collisions.py":2733 * """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 # <<<<<<<<<<<<<< @@ -86830,13 +92623,13 @@ static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_diff); - __Pyx_XDECREF(__pyx_9genexpr58__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr61__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2596 +/* "collisions.py":2738 * self.points = [[i[0], i[1]+diff] for i in self.points] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -86898,12 +92691,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2596, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2738, __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, 2596, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 2738, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -86914,7 +92707,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, 2596, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2738, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -86942,10 +92735,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_9genexpr59__pyx_v_i = NULL; - PyObject *__pyx_9genexpr60__pyx_v_i = NULL; - PyObject *__pyx_9genexpr61__pyx_v_i = NULL; PyObject *__pyx_9genexpr62__pyx_v_i = NULL; + PyObject *__pyx_9genexpr63__pyx_v_i = NULL; + PyObject *__pyx_9genexpr64__pyx_v_i = NULL; + PyObject *__pyx_9genexpr65__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -86961,7 +92754,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":2603 + /* "collisions.py":2745 * 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]) # <<<<<<<<<<<<<< @@ -86970,18 +92763,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, 2603, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2745, __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, 2603, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2745, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -86990,28 +92783,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, 2603, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __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, 2745, __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, 2603, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __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, 2745, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -87021,43 +92814,43 @@ 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, 2603, __pyx_L5_error) + else __PYX_ERR(0, 2745, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr59__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr62__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr59__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2603, __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, 2745, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2603, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2745, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr59__pyx_v_i); __pyx_9genexpr59__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_i); __pyx_9genexpr62__pyx_v_i = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr59__pyx_v_i); __pyx_9genexpr59__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_i); __pyx_9genexpr62__pyx_v_i = 0; 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, 2603, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2745, __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, 2603, __pyx_L12_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __pyx_L12_error) + __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2745, __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, 2603, __pyx_L12_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2745, __pyx_L12_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -87066,28 +92859,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, 2603, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __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, 2745, __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, 2603, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __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, 2745, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -87097,43 +92890,43 @@ 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, 2603, __pyx_L12_error) + else __PYX_ERR(0, 2745, __pyx_L12_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr60__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr63__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, 2603, __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, 2745, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2603, __pyx_L12_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2745, __pyx_L12_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_9genexpr60__pyx_v_i); __pyx_9genexpr60__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr63__pyx_v_i); __pyx_9genexpr63__pyx_v_i = 0; goto __pyx_L16_exit_scope; __pyx_L12_error:; - __Pyx_XDECREF(__pyx_9genexpr60__pyx_v_i); __pyx_9genexpr60__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr63__pyx_v_i); __pyx_9genexpr63__pyx_v_i = 0; 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, 2603, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2745, __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, 2603, __pyx_L19_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __pyx_L19_error) + __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2745, __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, 2603, __pyx_L19_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2745, __pyx_L19_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -87142,28 +92935,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, 2603, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __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, 2745, __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, 2603, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __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, 2745, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -87173,43 +92966,43 @@ 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, 2603, __pyx_L19_error) + else __PYX_ERR(0, 2745, __pyx_L19_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr61__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr64__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr61__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2603, __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, 2745, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2603, __pyx_L19_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2745, __pyx_L19_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_9genexpr61__pyx_v_i); __pyx_9genexpr61__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr64__pyx_v_i); __pyx_9genexpr64__pyx_v_i = 0; goto __pyx_L23_exit_scope; __pyx_L19_error:; - __Pyx_XDECREF(__pyx_9genexpr61__pyx_v_i); __pyx_9genexpr61__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr64__pyx_v_i); __pyx_9genexpr64__pyx_v_i = 0; 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, 2603, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2745, __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, 2603, __pyx_L26_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __pyx_L26_error) + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2745, __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, 2603, __pyx_L26_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2745, __pyx_L26_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -87218,28 +93011,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, 2603, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __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, 2745, __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, 2603, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2745, __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, 2603, __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, 2745, __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, 2603, __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, 2745, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -87249,40 +93042,40 @@ 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, 2603, __pyx_L26_error) + else __PYX_ERR(0, 2745, __pyx_L26_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr62__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr65__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr62__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2603, __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, 2745, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2603, __pyx_L26_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2745, __pyx_L26_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_i); __pyx_9genexpr62__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr65__pyx_v_i); __pyx_9genexpr65__pyx_v_i = 0; goto __pyx_L30_exit_scope; __pyx_L26_error:; - __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_i); __pyx_9genexpr62__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr65__pyx_v_i); __pyx_9genexpr65__pyx_v_i = 0; 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, 2603, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2745, __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, 2603, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __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, 2603, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2745, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2603, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2745, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7)) __PYX_ERR(0, 2603, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7)) __PYX_ERR(0, 2745, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8)) __PYX_ERR(0, 2603, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8)) __PYX_ERR(0, 2745, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; @@ -87291,7 +93084,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2596 + /* "collisions.py":2738 * self.points = [[i[0], i[1]+diff] for i in self.points] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -87310,16 +93103,16 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ __Pyx_AddTraceback("collisions.Polygon.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_9genexpr59__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr60__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr61__pyx_v_i); __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr63__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr64__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr65__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2605 +/* "collisions.py":2747 * 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: # <<<<<<<<<<<<<< @@ -87381,12 +93174,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2605, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2747, __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, 2605, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 2747, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -87397,7 +93190,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, 2605, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2747, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -87423,9 +93216,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2613 +/* "collisions.py":2755 * """ * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) # <<<<<<<<<<<<<< @@ -87434,29 +93227,29 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_Coroutin */ static PyObject *__pyx_pf_10collisions_7Polygon_4area_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_27_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_23_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_23_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_23_genexpr, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2613, __pyx_L1_error) + __PYX_ERR(0, 2755, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_22_area *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_26_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_2generator9, 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, 2613, __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, 2755, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -87472,9 +93265,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4area_genexpr(PyObject *__pyx_se return __pyx_r; } -static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_23_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -87496,24 +93289,24 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_Coroutin return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2613, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2755, __pyx_L1_error) - /* "collisions.py":2614 + /* "collisions.py":2756 * 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, 2614, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2756, __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, 2614, __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, 2756, __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, 2614, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2756, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -87521,28 +93314,28 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_Coroutin { 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, 2614, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2756, __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, 2614, __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, 2756, __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, 2614, __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, 2756, __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, 2614, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2756, __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, 2614, __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, 2756, __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, 2614, __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, 2756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -87552,7 +93345,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_Coroutin PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2614, __pyx_L1_error) + else __PYX_ERR(0, 2756, __pyx_L1_error) } break; } @@ -87563,64 +93356,64 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_Coroutin __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2613 + /* "collisions.py":2755 * """ * 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, 2613, __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, 2613, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2755, __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, 2755, __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, 2613, __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, 2755, __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, 2613, __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, 2755, __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, 2613, __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, 2613, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2755, __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, 2755, __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, 2613, __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, 2755, __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, 2613, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2755, __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, 2613, __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, 2755, __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, 2613, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2755, __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, 2613, __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, 2613, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2755, __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, 2755, __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, 2613, __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, 2755, __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, 2613, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2755, __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, 2613, __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, 2755, __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, 2613, __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, 2613, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2755, __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, 2755, __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, 2613, __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, 2755, __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, 2613, __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, 2755, __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, 2613, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2755, __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, 2613, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2755, __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; @@ -87642,9 +93435,9 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_Coroutin __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, 2613, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2755, __pyx_L1_error) - /* "collisions.py":2614 + /* "collisions.py":2756 * 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) # <<<<<<<<<<<<<< @@ -87655,7 +93448,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_Coroutin __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "collisions.py":2613 + /* "collisions.py":2755 * """ * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) # <<<<<<<<<<<<<< @@ -87685,7 +93478,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_Coroutin return __pyx_r; } -/* "collisions.py":2605 +/* "collisions.py":2747 * 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: # <<<<<<<<<<<<<< @@ -87694,8 +93487,8 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9(__pyx_Coroutin */ static PyObject *__pyx_pf_10collisions_7Polygon_12area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - struct __pyx_obj_10collisions___pyx_scope_struct_22_area *__pyx_cur_scope; - PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator9 = 0; + struct __pyx_obj_10collisions___pyx_scope_struct_26_area *__pyx_cur_scope; + PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -87709,11 +93502,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_22_area *)__pyx_tp_new_10collisions___pyx_scope_struct_22_area(__pyx_ptype_10collisions___pyx_scope_struct_22_area, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_22_area *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_26_area *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2605, __pyx_L1_error) + __PYX_ERR(0, 2747, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -87721,7 +93514,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":2612 + /* "collisions.py":2754 * Number: The area of the shape * """ * return abs(sum( # <<<<<<<<<<<<<< @@ -87730,137 +93523,137 @@ static PyObject *__pyx_pf_10collisions_7Polygon_12area(CYTHON_UNUSED PyObject *_ */ __Pyx_XDECREF(__pyx_r); - /* "collisions.py":2614 + /* "collisions.py":2756 * 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, 2614, __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, 2756, __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, 2614, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2756, __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, 2614, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_2 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2756, __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, 2614, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2613 + /* "collisions.py":2755 * """ * 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, 2613, __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, 2755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2612 + /* "collisions.py":2754 * 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, 2612, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2615 + /* "collisions.py":2757 * (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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2757, __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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2757, __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, 2615, __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, 2757, __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, 2615, __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, 2757, __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, 2615, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2757, __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, 2615, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2757, __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, 2615, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2757, __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":2612 + /* "collisions.py":2754 * 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, 2612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2615 + /* "collisions.py":2757 * (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, 2615, __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, 2757, __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":2605 + /* "collisions.py":2747 * 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: # <<<<<<<<<<<<<< @@ -87878,14 +93671,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_12area(CYTHON_UNUSED PyObject *_ __Pyx_AddTraceback("collisions.Polygon.area", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_gb_10collisions_7Polygon_4area_2generator9); + __Pyx_XDECREF(__pyx_gb_10collisions_7Polygon_4area_2generator11); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2617 +/* "collisions.py":2759 * ) + (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: # <<<<<<<<<<<<<< @@ -87949,7 +93742,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, 2759, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -87957,14 +93750,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, 2759, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2617, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2759, __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, 2617, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 2759, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -87977,7 +93770,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, 2617, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2759, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -88003,40 +93796,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +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":2645 +/* "collisions.py":2787 * return False - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ static PyObject *__pyx_pf_10collisions_7Polygon_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_29_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_25_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_25_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_25_genexpr, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2645, __pyx_L1_error) + __PYX_ERR(0, 2787, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_28__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_2generator10, 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, 2645, __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, 2787, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -88052,9 +93845,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_9_collides_genexpr(PyObject *__p return __pyx_r; } -static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_25_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -88078,16 +93871,16 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10(__pyx_Co return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2645, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2645, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2787, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2787, __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, 2645, __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, 2787, __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, 2645, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2787, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -88095,28 +93888,28 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10(__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, 2645, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2787, __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, 2645, __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, 2787, __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, 2645, __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, 2787, __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, 2645, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2787, __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, 2645, __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, 2787, __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, 2645, __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, 2787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -88126,7 +93919,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10(__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, 2645, __pyx_L1_error) + else __PYX_ERR(0, 2787, __pyx_L1_error) } break; } @@ -88136,14 +93929,14 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10(__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, 2645, __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, 2645, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2787, __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, 2787, __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, 2645, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2787, __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, 2645, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2787, __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, 2645, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2787, __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; @@ -88166,11 +93959,11 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10(__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, 2645, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2787, __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, 2645, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2787, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_10) { __Pyx_XDECREF(__pyx_r); @@ -88211,7 +94004,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10(__pyx_Co return __pyx_r; } -/* "collisions.py":2617 +/* "collisions.py":2759 * ) + (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: # <<<<<<<<<<<<<< @@ -88220,13 +94013,13 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10(__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_24__collides *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *__pyx_cur_scope; PyObject *__pyx_v_ps = NULL; int __pyx_v_c; Py_ssize_t __pyx_v_j; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_li = NULL; - PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator10 = 0; + PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -88247,11 +94040,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_24__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_24__collides(__pyx_ptype_10collisions___pyx_scope_struct_24__collides, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2617, __pyx_L1_error) + __PYX_ERR(0, 2759, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -88259,14 +94052,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":2618 + /* "collisions.py":2760 * * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Point): + * 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, 2618, __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, 2760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -88286,20 +94079,20 @@ 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, 2618, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2760, __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, 2618, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2760, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "collisions.py":2619 + /* "collisions.py":2761 * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * ps = self.points */ __Pyx_XDECREF(__pyx_r); @@ -88307,34 +94100,37 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2618 + /* "collisions.py":2760 * * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): */ } - /* "collisions.py":2620 + /* "collisions.py":2762 * if not self.check_rects(othershape): * return False - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * 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, 2620, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2762, __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, 2620, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __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_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_7)) { + __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_7); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; @@ -88342,32 +94138,32 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_7}; __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2620, __pyx_L1_error) + __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, 2762, __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, 2620, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2762, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2621 + /* "collisions.py":2763 * return False - * if checkShpType(othershape, Point): + * 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, 2621, __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, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ps = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2622 - * if checkShpType(othershape, Point): + /* "collisions.py":2764 + * if checkShpType(othershape, ShpTyps.Point): * ps = self.points * c = False # <<<<<<<<<<<<<< * j = len(ps) - 1 @@ -88375,27 +94171,27 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ __pyx_v_c = 0; - /* "collisions.py":2623 + /* "collisions.py":2765 * 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, 2623, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2765, __pyx_L1_error) __pyx_v_j = (__pyx_t_8 - 1); - /* "collisions.py":2624 + /* "collisions.py":2766 * 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, 2624, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2624, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2766, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2766, __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, 2624, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2766, __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)) { @@ -88403,9 +94199,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, 2624, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2766, __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, 2624, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2766, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -88414,28 +94210,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, 2624, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2766, __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, 2624, __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, 2766, __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, 2624, __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, 2766, __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, 2624, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2766, __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, 2624, __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, 2766, __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, 2624, __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, 2766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -88445,7 +94241,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, 2624, __pyx_L1_error) + else __PYX_ERR(0, 2766, __pyx_L1_error) } break; } @@ -88454,37 +94250,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":2625 + /* "collisions.py":2767 * 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, 2625, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __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, 2625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 2767, __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, 2625, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2625, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 2767, __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, 2625, __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, 2767, __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, 2625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 2767, __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, 2625, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2625, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2625, __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, 2767, __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, 2767, __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, 2625, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { } else { @@ -88492,80 +94288,80 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje goto __pyx_L8_bool_binop_done; } - /* "collisions.py":2626 + /* "collisions.py":2768 * 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, 2626, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2768, __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, 2626, __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, 2768, __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, 2626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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, 2768, __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, 2626, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2768, __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, 2626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 2768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_10 = PyNumber_Subtract(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __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, 2626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2626, __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, 2626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2768, __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, 2768, __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, 2768, __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, 2768, __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_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2626, __pyx_L1_error) + __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, 2768, __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, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2626, __pyx_L1_error) + __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, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2626, __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, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2626, __pyx_L1_error) + __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, 2768, __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, 2768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __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, 2768, __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_7, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2626, __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, 2768, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2626, __pyx_L1_error) + __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, 2768, __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":2625 + /* "collisions.py":2767 * j = len(ps) - 1 * for i in range(len(ps)): * if ((ps[i][1] > othershape.y) != (ps[j][1] > othershape.y)) and \ # <<<<<<<<<<<<<< @@ -88574,7 +94370,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ if (__pyx_t_6) { - /* "collisions.py":2627 + /* "collisions.py":2769 * 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 # <<<<<<<<<<<<<< @@ -88583,7 +94379,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ __pyx_v_c = (!__pyx_v_c); - /* "collisions.py":2625 + /* "collisions.py":2767 * j = len(ps) - 1 * for i in range(len(ps)): * if ((ps[i][1] > othershape.y) != (ps[j][1] > othershape.y)) and \ # <<<<<<<<<<<<<< @@ -88592,17 +94388,17 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2628 + /* "collisions.py":2770 * (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, Line): + * 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, 2628, __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, 2770, __pyx_L1_error) __pyx_v_j = __pyx_t_12; - /* "collisions.py":2624 + /* "collisions.py":2766 * c = False * j = len(ps) - 1 * for i in range(len(ps)): # <<<<<<<<<<<<<< @@ -88612,48 +94408,51 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2629 + /* "collisions.py":2771 * c = not c * j = i * return c # <<<<<<<<<<<<<< - * if checkShpType(othershape, Line): + * if checkShpType(othershape, ShpTyps.Line): * 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, 2629, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2620 + /* "collisions.py":2762 * if not self.check_rects(othershape): * return False - * if checkShpType(othershape, Point): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * ps = self.points * c = False */ } - /* "collisions.py":2630 + /* "collisions.py":2772 * j = i * return c - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * 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, 2630, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2772, __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, 2772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __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_11))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_2)) { + __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_2); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_4 = 1; @@ -88661,35 +94460,35 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_7}; + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_2}; __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, 2630, __pyx_L1_error) + __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, 2772, __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, 2630, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2631 + /* "collisions.py":2773 * return c - * if checkShpType(othershape, Line): + * 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, 2631, __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, 2773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = NULL; + __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_7)) { + __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_7); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_4 = 1; @@ -88697,10 +94496,10 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; + 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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2631, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -88709,9 +94508,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, 2631, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2773, __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, 2631, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2773, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -88720,28 +94519,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, 2631, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2773, __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, 2631, __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, 2773, __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, 2631, __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, 2773, __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, 2631, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2773, __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, 2631, __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, 2773, __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, 2631, __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, 2773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -88751,7 +94550,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, 2631, __pyx_L1_error) + else __PYX_ERR(0, 2773, __pyx_L1_error) } break; } @@ -88760,42 +94559,42 @@ 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":2632 - * if checkShpType(othershape, Line): + /* "collisions.py":2774 + * 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = NULL; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2774, __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_7))) { - __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_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_7, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2632, __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_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2774, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2632, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2633 + /* "collisions.py":2775 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -88808,8 +94607,8 @@ 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":2632 - * if checkShpType(othershape, Line): + /* "collisions.py":2774 + * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True @@ -88817,9 +94616,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2631 + /* "collisions.py":2773 * return c - * if checkShpType(othershape, Line): + * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True @@ -88827,34 +94626,34 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2634 + /* "collisions.py":2776 * 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, 2634, __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, 2776, __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, 2634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2776, __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, 2634, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2776, __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, 2776, __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, 2776, __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_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __pyx_t_7 = NULL; __pyx_t_4 = 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)) { + __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_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -88862,42 +94661,42 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_11 = __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2634, __pyx_L1_error) + __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, 2776, __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, 2634, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2776, __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, 2634, __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, 2776, __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, 2634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2776, __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, 2634, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2776, __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, 2776, __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, 2776, __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, 2634, __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; - __pyx_t_7 = NULL; + __pyx_t_2 = NULL; __pyx_t_4 = 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)) { + __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_7); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -88905,33 +94704,33 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7}; __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, 2634, __pyx_L1_error) + __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, 2776, __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, 2634, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2776, __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":2635 + /* "collisions.py":2777 * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): * return True # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Circle): + * if checkShpType(othershape, ShpTyps.Circle): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2634 + /* "collisions.py":2776 * if li.collides(othershape): * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): # <<<<<<<<<<<<<< @@ -88940,11 +94739,11 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2636 + /* "collisions.py":2778 * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): * return True * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Circle): + * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): */ __Pyx_XDECREF(__pyx_r); @@ -88952,26 +94751,29 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2630 + /* "collisions.py":2772 * j = i * return c - * if checkShpType(othershape, Line): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * for li in self.toLines(): * if li.collides(othershape): */ } - /* "collisions.py":2637 + /* "collisions.py":2779 * return True * return False - * if checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * 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, 2637, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2779, __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, 2637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2779, __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, 2779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS @@ -88987,32 +94789,32 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_2}; __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2637, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2779, __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, 2637, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "collisions.py":2638 + /* "collisions.py":2780 * return False - * if checkShpType(othershape, Circle): + * 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, 2638, __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, 2780, __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, 2638, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2638, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2780, __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, 2780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = NULL; __pyx_t_4 = 0; @@ -89029,13 +94831,13 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_2, __pyx_t_10}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_3, __pyx_t_10}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2780, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; @@ -89053,20 +94855,20 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2}; __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, 2638, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2780, __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, 2638, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "collisions.py":2639 - * if checkShpType(othershape, Circle): + /* "collisions.py":2781 + * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): * return True # <<<<<<<<<<<<<< * for li in self.toLines(): @@ -89077,32 +94879,32 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2638 + /* "collisions.py":2780 * return False - * if checkShpType(othershape, Circle): + * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): # <<<<<<<<<<<<<< * return True * for li in self.toLines(): */ } - /* "collisions.py":2640 + /* "collisions.py":2782 * 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, 2640, __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, 2782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; + __pyx_t_2 = NULL; __pyx_t_4 = 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)) { + __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_3); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -89110,10 +94912,10 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2640, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -89122,9 +94924,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, 2640, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2782, __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, 2640, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2782, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { @@ -89133,28 +94935,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, 2640, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2782, __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, 2640, __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, 2782, __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, 2640, __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, 2782, __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, 2640, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2782, __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, 2640, __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, 2782, __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, 2640, __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, 2782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } @@ -89164,7 +94966,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, 2640, __pyx_L1_error) + else __PYX_ERR(0, 2782, __pyx_L1_error) } break; } @@ -89173,47 +94975,47 @@ 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":2641 + /* "collisions.py":2783 * return True * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __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, 2641, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 2641, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2783, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "collisions.py":2642 + /* "collisions.py":2784 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); @@ -89221,7 +95023,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":2641 + /* "collisions.py":2783 * return True * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< @@ -89230,7 +95032,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2640 + /* "collisions.py":2782 * if self._collides(Point(othershape.x, othershape.y)): * return True * for li in self.toLines(): # <<<<<<<<<<<<<< @@ -89240,11 +95042,11 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2643 + /* "collisions.py":2785 * if li.collides(othershape): * return True * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): */ __Pyx_XDECREF(__pyx_r); @@ -89252,34 +95054,37 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2637 + /* "collisions.py":2779 * return True * return False - * if checkShpType(othershape, Circle): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * if self._collides(Point(othershape.x, othershape.y)): * return True */ } - /* "collisions.py":2644 + /* "collisions.py":2786 * return True * return False - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * 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, 2644, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2786, __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, 2786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __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_11))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_7)) { + __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_7); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_4 = 1; @@ -89287,35 +95092,35 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__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_1)) __PYX_ERR(0, 2644, __pyx_L1_error) + __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, 2786, __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, 2644, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2645 + /* "collisions.py":2787 * return False - * if checkShpType(othershape, Arc): + * 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, 2645, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = NULL; + __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_3)) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_4 = 1; @@ -89323,25 +95128,25 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2645, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2787, __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, 2645, __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, 2787, __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, 2645, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2787, __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, 2645, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2787, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2646 - * if checkShpType(othershape, Arc): + /* "collisions.py":2788 + * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True # <<<<<<<<<<<<<< * for i in self.toLines(): @@ -89352,32 +95157,32 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2645 + /* "collisions.py":2787 * return False - * if checkShpType(othershape, Arc): + * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ } - /* "collisions.py":2647 + /* "collisions.py":2789 * 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, 2647, __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, 2789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = NULL; + __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_3)) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_4 = 1; @@ -89385,10 +95190,10 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2647, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -89397,9 +95202,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, 2647, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2789, __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, 2647, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2789, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -89408,28 +95213,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, 2647, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2789, __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, 2647, __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, 2789, __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, 2647, __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, 2789, __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, 2647, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2789, __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, 2647, __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, 2789, __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, 2647, __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, 2789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -89439,7 +95244,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, 2647, __pyx_L1_error) + else __PYX_ERR(0, 2789, __pyx_L1_error) } break; } @@ -89448,47 +95253,47 @@ 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":2648 + /* "collisions.py":2790 * 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, 2648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = NULL; __pyx_t_4 = 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); + if (likely(PyMethod_Check(__pyx_t_7))) { + __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_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2648, __pyx_L1_error) + 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, 2790, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2648, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2790, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2649 + /* "collisions.py":2791 * for i in self.toLines(): * if othershape.collides(i): * return True # <<<<<<<<<<<<<< * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); @@ -89496,7 +95301,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":2648 + /* "collisions.py":2790 * return True * for i in self.toLines(): * if othershape.collides(i): # <<<<<<<<<<<<<< @@ -89505,7 +95310,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2647 + /* "collisions.py":2789 * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True * for i in self.toLines(): # <<<<<<<<<<<<<< @@ -89515,11 +95320,11 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2650 + /* "collisions.py":2792 * if othershape.collides(i): * return True * return False # <<<<<<<<<<<<<< - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): */ __Pyx_XDECREF(__pyx_r); @@ -89527,60 +95332,34 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2644 + /* "collisions.py":2786 * return True * return False - * if checkShpType(othershape, Arc): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True */ } - /* "collisions.py":2651 + /* "collisions.py":2793 * return True * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): # <<<<<<<<<<<<<< + * 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, 2651, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; - __pyx_t_4 = 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_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; - __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2651, __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, 2651, __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_L32_bool_binop_done; - } - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RotatedRect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2793, __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, 2793, __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, 2793, __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, 2793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS @@ -89596,37 +95375,36 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_2, __pyx_t_10}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 3+__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, 2651, __pyx_L1_error) + __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, 2793, __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, 2651, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2793, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_6 = __pyx_t_5; - __pyx_L32_bool_binop_done:; if (__pyx_t_6) { - /* "collisions.py":2652 + /* "collisions.py":2794 * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + * 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, 2652, __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, 2794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; + __pyx_t_10 = NULL; __pyx_t_4 = 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)) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -89634,10 +95412,10 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2652, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -89646,9 +95424,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, 2652, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2794, __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, 2652, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2794, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { @@ -89657,28 +95435,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, 2652, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2794, __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, 2652, __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, 2794, __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, 2652, __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, 2794, __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, 2652, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2794, __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, 2652, __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, 2794, __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, 2652, __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, 2794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } @@ -89688,7 +95466,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, 2652, __pyx_L1_error) + else __PYX_ERR(0, 2794, __pyx_L1_error) } break; } @@ -89697,47 +95475,47 @@ 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":2653 - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + /* "collisions.py":2795 + * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2795, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = NULL; __pyx_t_4 = 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); + if (likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __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, 2653, __pyx_L1_error) + 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, 2795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 2653, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2795, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "collisions.py":2654 + /* "collisions.py":2796 * 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)) - * if checkShpType(othershape, Polygon): + * if checkShpType(othershape, ShpTyps.Polygon): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); @@ -89745,8 +95523,8 @@ 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":2653 - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + /* "collisions.py":2795 + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True @@ -89754,9 +95532,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2652 + /* "collisions.py":2794 * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True @@ -89764,181 +95542,184 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2655 + /* "collisions.py":2797 * 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)) # <<<<<<<<<<<<<< - * if checkShpType(othershape, Polygon): + * if checkShpType(othershape, ShpTyps.Polygon): * for li in self.toLines(): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2655, __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, 2797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2655, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2797, __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, 2797, __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, 2797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); 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_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2797, __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, 2655, __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, 2797, __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, 2655, __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, 2797, __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, 2655, __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, 2797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_2, __pyx_t_13}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_3, __pyx_t_13}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_10 = NULL; + __pyx_t_7 = NULL; __pyx_t_4 = 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); + if (likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2655, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2}; + __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, 2797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 2655, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2797, __pyx_L1_error) if (!__pyx_t_6) { __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { __Pyx_INCREF(__pyx_t_11); __pyx_t_1 = __pyx_t_11; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - goto __pyx_L38_bool_binop_done; + goto __pyx_L36_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2655, __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, 2797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2655, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2797, __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, 2797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __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, 2797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_13, __pyx_t_2}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_13, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_10 = NULL; + __pyx_t_7 = NULL; __pyx_t_4 = 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); + if (likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2655, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2}; + __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, 2797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_INCREF(__pyx_t_11); __pyx_t_1 = __pyx_t_11; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_L38_bool_binop_done:; + __pyx_L36_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2651 + /* "collisions.py":2793 * return True * return False - * if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): # <<<<<<<<<<<<<< * for li in self.toLines(): * if li.collides(othershape): */ } - /* "collisions.py":2656 + /* "collisions.py":2798 * 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, Polygon): # <<<<<<<<<<<<<< + * 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, 2656, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2798, __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, 2798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_7)) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_4 = 1; @@ -89946,35 +95727,35 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_othershape, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__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_1)) __PYX_ERR(0, 2656, __pyx_L1_error) + __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, 2798, __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, 2656, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2657 + /* "collisions.py":2799 * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.x, othershape.y)) - * if checkShpType(othershape, Polygon): + * 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, 2657, __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, 2799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = NULL; + __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_3)) { + __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_3); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_4 = 1; @@ -89982,10 +95763,10 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2657, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -89994,9 +95775,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, 2657, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2799, __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, 2657, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2799, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -90005,28 +95786,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, 2657, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2799, __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, 2657, __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, 2799, __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, 2657, __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, 2799, __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, 2657, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2799, __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, 2657, __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, 2799, __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, 2657, __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, 2799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -90036,7 +95817,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, 2657, __pyx_L1_error) + else __PYX_ERR(0, 2799, __pyx_L1_error) } break; } @@ -90045,42 +95826,42 @@ 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":2658 - * if checkShpType(othershape, Polygon): + /* "collisions.py":2800 + * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = NULL; __pyx_t_4 = 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); + 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_3, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __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, 2658, __pyx_L1_error) + 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, 2800, __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2658, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2800, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2659 + /* "collisions.py":2801 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -90093,8 +95874,8 @@ 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":2658 - * if checkShpType(othershape, Polygon): + /* "collisions.py":2800 + * if checkShpType(othershape, ShpTyps.Polygon): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True @@ -90102,9 +95883,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2657 + /* "collisions.py":2799 * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.x, othershape.y)) - * if checkShpType(othershape, Polygon): + * if checkShpType(othershape, ShpTyps.Polygon): * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True @@ -90112,7 +95893,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2660 + /* "collisions.py":2802 * 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])) # <<<<<<<<<<<<<< @@ -90120,167 +95901,167 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2660, __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, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2660, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2802, __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, 2802, __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, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __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, 2802, __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, 2660, __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, 2802, __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, 2660, __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, 2802, __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, 2660, __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, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_2, __pyx_t_13}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_3, __pyx_t_13}; + __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_10 = NULL; + __pyx_t_7 = NULL; __pyx_t_4 = 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); + if (likely(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_3, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2660, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10}; + __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, 2802, __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2660, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2802, __pyx_L1_error) if (!__pyx_t_6) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(__pyx_t_1); __pyx_t_11 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L45_bool_binop_done; + goto __pyx_L43_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_points_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2660, __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, 2802, __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, 2802, __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, 2802, __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, 2802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2660, __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, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2660, __pyx_L1_error) + __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, 2802, __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, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_14, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __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, 2802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_13, __pyx_t_2}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_13, __pyx_t_3}; + __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_10 = NULL; + __pyx_t_7 = NULL; __pyx_t_4 = 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); + if (likely(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_3, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2660, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10}; + __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, 2802, __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_INCREF(__pyx_t_1); __pyx_t_11 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_L45_bool_binop_done:; + __pyx_L43_bool_binop_done:; __pyx_r = __pyx_t_11; __pyx_t_11 = 0; goto __pyx_L0; - /* "collisions.py":2656 + /* "collisions.py":2798 * 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, Polygon): # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Polygon): # <<<<<<<<<<<<<< * for li in self.toLines(): * if li.collides(othershape): */ } - /* "collisions.py":2661 + /* "collisions.py":2803 * 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) # <<<<<<<<<<<<<< @@ -90288,16 +96069,16 @@ 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, 2661, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; + __pyx_t_2 = NULL; __pyx_t_4 = 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)) { + __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_3); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; @@ -90305,10 +96086,10 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_self}; + 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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2661, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -90316,7 +96097,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_11 = 0; goto __pyx_L0; - /* "collisions.py":2617 + /* "collisions.py":2759 * ) + (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: # <<<<<<<<<<<<<< @@ -90340,14 +96121,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_v_ps); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_li); - __Pyx_XDECREF(__pyx_gb_10collisions_7Polygon_9_collides_2generator10); + __Pyx_XDECREF(__pyx_gb_10collisions_7Polygon_9_collides_2generator12); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2663 +/* "collisions.py":2805 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -90409,12 +96190,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2663, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2805, __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, 2663, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2805, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -90425,7 +96206,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, 2663, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2805, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -90453,7 +96234,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - Py_ssize_t __pyx_9genexpr65__pyx_v_i; + Py_ssize_t __pyx_9genexpr68__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -90472,7 +96253,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":2668 + /* "collisions.py":2810 * Iterable[Line]: Get a list of all the Lines that make up this object. * """ * return [ # <<<<<<<<<<<<<< @@ -90481,43 +96262,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, 2668, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "collisions.py":2670 + /* "collisions.py":2812 * 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, 2670, __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, 2812, __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, 2670, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2812, __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_9genexpr65__pyx_v_i = __pyx_t_5; + __pyx_9genexpr68__pyx_v_i = __pyx_t_5; - /* "collisions.py":2669 + /* "collisions.py":2811 * """ * 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, 2669, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2811, __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, 2669, __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, 2811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, __pyx_9genexpr65__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_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, 2811, __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, 2669, __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, 2811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = (__pyx_9genexpr65__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, 2669, __pyx_L1_error) + __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, 2811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -90540,37 +96321,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, 2669, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2811, __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, 2668, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } /* exit inner scope */ - /* "collisions.py":2671 + /* "collisions.py":2813 * 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, 2671, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2813, __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, 2671, __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, 2813, __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, 2671, __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, 2813, __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, 2671, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2813, __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, 2671, __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, 2813, __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, 2671, __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, 2813, __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, 2671, __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, 2813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -90593,16 +96374,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, 2671, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2813, __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, 2671, __pyx_L1_error) + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2813, __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, 2671, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 2813, __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, 2671, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2813, __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; @@ -90610,7 +96391,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2663 + /* "collisions.py":2805 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -90634,7 +96415,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":2673 +/* "collisions.py":2815 * ] + [Line(self.points[len(self.points)-1], self.points[0])] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -90696,12 +96477,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, 2815, __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, 2673, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2815, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -90712,7 +96493,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, 2673, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2815, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -90740,7 +96521,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_9genexpr66__pyx_v_i = NULL; + PyObject *__pyx_9genexpr69__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -90753,7 +96534,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":2678 + /* "collisions.py":2820 * Iterable[pointLike]: Get a list of all the Points that make up this object. * """ * return [list(i) for i in self.points] # <<<<<<<<<<<<<< @@ -90762,18 +96543,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, 2678, __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, 2678, __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, 2678, __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, 2678, __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 (;;) { @@ -90782,28 +96563,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, 2678, __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, 2678, __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, 2678, __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, 2678, __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, 2678, __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, 2678, __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 } @@ -90813,24 +96594,24 @@ 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, 2678, __pyx_L5_error) + else __PYX_ERR(0, 2820, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_9genexpr66__pyx_v_i, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_9genexpr69__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySequence_List(__pyx_9genexpr66__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2678, __pyx_L5_error) + __pyx_t_2 = PySequence_List(__pyx_9genexpr69__pyx_v_i); 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, 2678, __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; - __Pyx_XDECREF(__pyx_9genexpr66__pyx_v_i); __pyx_9genexpr66__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr69__pyx_v_i); __pyx_9genexpr69__pyx_v_i = 0; goto __pyx_L9_exit_scope; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr66__pyx_v_i); __pyx_9genexpr66__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr69__pyx_v_i); __pyx_9genexpr69__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ @@ -90838,7 +96619,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2673 + /* "collisions.py":2815 * ] + [Line(self.points[len(self.points)-1], self.points[0])] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -90854,13 +96635,13 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec __Pyx_AddTraceback("collisions.Polygon.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_9genexpr66__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr69__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2680 +/* "collisions.py":2822 * return [list(i) for i in self.points] * * def copy(self) -> 'Polygon': # <<<<<<<<<<<<<< @@ -90922,12 +96703,12 @@ 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, 2822, __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, 2680, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2822, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -90938,7 +96719,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, 2680, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2822, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -90977,7 +96758,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_20copy(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":2684 + /* "collisions.py":2826 * And then he lifted his arms and said, 'LET THERE BE ANOTHER!' * """ * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) # <<<<<<<<<<<<<< @@ -90985,21 +96766,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, 2684, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2826, __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, 2684, __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, 2826, __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, 2684, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2826, __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, 2684, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_errorOnLT3, Py_False) < 0) __PYX_ERR(0, 2684, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2684, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_errorOnLT3, Py_False) < 0) __PYX_ERR(0, 2826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2826, __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, 2684, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bounciness, __pyx_t_4) < 0) __PYX_ERR(0, 2826, __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, 2684, __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, 2826, __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; @@ -91008,7 +96789,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_20copy(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2680 + /* "collisions.py":2822 * return [list(i) for i in self.points] * * def copy(self) -> 'Polygon': # <<<<<<<<<<<<<< @@ -91030,7 +96811,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_20copy(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2686 +/* "collisions.py":2828 * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -91097,7 +96878,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2686, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2828, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -91105,9 +96886,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2686, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2828, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2686, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2828, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -91115,14 +96896,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2686, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2828, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2686, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2828, __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, 2686, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2828, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -91137,7 +96918,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, 2686, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2828, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -91151,7 +96932,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, 2686, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2828, __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 */ @@ -91178,19 +96959,19 @@ static PyObject *__pyx_pf_10collisions_7Polygon_22__setitem__(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":2687 + /* "collisions.py":2829 * * 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, 2687, __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, 2829, __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, 2687, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_new) < 0))) __PYX_ERR(0, 2829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2686 + /* "collisions.py":2828 * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -91211,7 +96992,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_22__setitem__(CYTHON_UNUSED PyOb return __pyx_r; } -/* "collisions.py":2689 +/* "collisions.py":2831 * self.points[item] = new * * def __str__(self): # <<<<<<<<<<<<<< @@ -91272,12 +97053,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2689, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2831, __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, 2689, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2831, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -91288,7 +97069,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, 2689, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2831, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -91328,15 +97109,15 @@ static PyObject *__pyx_pf_10collisions_7Polygon_24__str__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":2690 + /* "collisions.py":2832 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< * - * class ShapeCombiner: + * TYPE_MATCHES = { */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2690, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -91344,9 +97125,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, 2690, __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, 2832, __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, 2690, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2832, __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; @@ -91354,18 +97135,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__16); + __Pyx_INCREF(__pyx_kp_u__5); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__16); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__16); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2690, __pyx_L1_error) + __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, 2832, __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":2689 + /* "collisions.py":2831 * self.points[item] = new * * def __str__(self): # <<<<<<<<<<<<<< @@ -91386,7 +97167,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_24__str__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":2695 +/* "collisions.py":2851 * """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 # <<<<<<<<<<<<<< @@ -91421,9 +97202,9 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_1boundingBox(PyObject *__ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2707 +/* "collisions.py":2863 * rs = [s.rect() for s in shapes] * mins, maxs = [ * min(i[0] for i in rs), # <<<<<<<<<<<<<< @@ -91432,18 +97213,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_26_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_26_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_26_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_26_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_26_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2707, __pyx_L1_error) + __PYX_ERR(0, 2863, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -91451,7 +97232,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_2generator11, 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, 2707, __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, 2863, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -91467,9 +97248,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_genexpr(CYT return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_26_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_26_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; @@ -91487,29 +97268,29 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2707, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2707, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2863, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2863, __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, 2707, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2863, __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, 2707, __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, 2863, __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, 2707, __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, 2863, __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, 2707, __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, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -91527,7 +97308,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, 2707, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2863, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -91550,9 +97331,9 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator1 __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2708 +/* "collisions.py":2864 * mins, maxs = [ * min(i[0] for i in rs), * min(i[1] for i in rs) # <<<<<<<<<<<<<< @@ -91561,18 +97342,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_27_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_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_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_27_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2708, __pyx_L1_error) + __PYX_ERR(0, 2864, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -91580,7 +97361,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_5generator12, 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, 2708, __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, 2864, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -91596,9 +97377,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_3genexpr(CY return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_27_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_27_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; @@ -91616,29 +97397,29 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2708, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2708, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2864, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2864, __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, 2708, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2864, __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, 2708, __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, 2864, __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, 2708, __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, 2864, __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, 2708, __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, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -91656,7 +97437,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, 2708, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2864, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -91679,9 +97460,9 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator1 __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2710 +/* "collisions.py":2866 * min(i[1] for i in rs) * ], [ * max(i[2] for i in rs), # <<<<<<<<<<<<<< @@ -91690,18 +97471,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_28_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_28_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_28_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_28_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_28_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2710, __pyx_L1_error) + __PYX_ERR(0, 2866, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -91709,7 +97490,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_8generator13, 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, 2710, __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, 2866, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -91725,9 +97506,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_6genexpr(CY return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_28_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_28_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; @@ -91745,29 +97526,29 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2710, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2710, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2866, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2866, __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, 2710, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2866, __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, 2710, __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, 2866, __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, 2710, __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, 2866, __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, 2710, __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, 2866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -91785,7 +97566,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, 2710, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2866, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -91808,9 +97589,9 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator1 __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2711 +/* "collisions.py":2867 * ], [ * max(i[2] for i in rs), * max(i[3] for i in rs) # <<<<<<<<<<<<<< @@ -91819,18 +97600,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_29_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_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_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_29_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2711, __pyx_L1_error) + __PYX_ERR(0, 2867, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -91838,7 +97619,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_11generator14, 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, 2711, __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, 2867, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -91854,9 +97635,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_9genexpr(CY return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_29_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_29_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; @@ -91874,29 +97655,29 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2711, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2711, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2867, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2867, __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, 2711, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2867, __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, 2711, __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, 2867, __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, 2711, __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, 2867, __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, 2711, __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, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -91914,7 +97695,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, 2711, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2867, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -91938,7 +97719,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator return __pyx_r; } -/* "collisions.py":2695 +/* "collisions.py":2851 * """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 # <<<<<<<<<<<<<< @@ -91950,11 +97731,11 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED PyObject *__pyx_v_rs = NULL; PyObject *__pyx_v_mins = NULL; PyObject *__pyx_v_maxs = NULL; - PyObject *__pyx_9genexpr67__pyx_v_s = NULL; - PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator11 = 0; - PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator12 = 0; - PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator13 = 0; - PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator14 = 0; + PyObject *__pyx_9genexpr70__pyx_v_s = NULL; + PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator13 = 0; + PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator14 = 0; + PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator15 = 0; + PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator16 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -91974,7 +97755,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("boundingBox", 1); - /* "collisions.py":2703 + /* "collisions.py":2859 * 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: # <<<<<<<<<<<<<< @@ -91985,7 +97766,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "collisions.py":2704 + /* "collisions.py":2860 * """ * if not shapes: * return Shapes() # <<<<<<<<<<<<<< @@ -91993,7 +97774,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, 2704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -92013,7 +97794,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, 2704, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -92021,7 +97802,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2703 + /* "collisions.py":2859 * 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: # <<<<<<<<<<<<<< @@ -92030,7 +97811,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED */ } - /* "collisions.py":2705 + /* "collisions.py":2861 * if not shapes: * return Shapes() * rs = [s.rect() for s in shapes] # <<<<<<<<<<<<<< @@ -92038,7 +97819,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, 2705, __pyx_L6_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2861, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_shapes; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; @@ -92046,19 +97827,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, 2705, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2861, __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, 2705, __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, 2861, __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, 2705, __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, 2861, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr67__pyx_v_s, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr70__pyx_v_s, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr67__pyx_v_s, __pyx_n_s_rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2705, __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, 2861, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_6 = 0; @@ -92078,105 +97859,105 @@ 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, 2705, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2861, __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, 2705, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2861, __pyx_L6_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr67__pyx_v_s); __pyx_9genexpr67__pyx_v_s = 0; + __Pyx_XDECREF(__pyx_9genexpr70__pyx_v_s); __pyx_9genexpr70__pyx_v_s = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_9genexpr67__pyx_v_s); __pyx_9genexpr67__pyx_v_s = 0; + __Pyx_XDECREF(__pyx_9genexpr70__pyx_v_s); __pyx_9genexpr70__pyx_v_s = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __pyx_v_rs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2707 + /* "collisions.py":2863 * 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, 2707, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2863, __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, 2707, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2708 + /* "collisions.py":2864 * 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, 2708, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_3genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2864, __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, 2708, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2706 + /* "collisions.py":2862 * 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, 2706, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2862, __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, 2706, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 2862, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 2706, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 2862, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "collisions.py":2710 + /* "collisions.py":2866 * 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, 2710, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_6genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2866, __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, 2710, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2711 + /* "collisions.py":2867 * ], [ * 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, 2711, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_9genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2867, __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, 2711, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2709 + /* "collisions.py":2865 * 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, 2709, __pyx_L1_error) + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2865, __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, 2709, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 2865, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 2709, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 2865, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_v_mins = ((PyObject*)__pyx_t_3); @@ -92184,7 +97965,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_v_maxs = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2713 + /* "collisions.py":2869 * max(i[3] for i in rs) * ] * return Shapes(Rect( # <<<<<<<<<<<<<< @@ -92192,73 +97973,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, 2713, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2869, __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, 2713, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "collisions.py":2714 + /* "collisions.py":2870 * ] * 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, 2713, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_mins); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "collisions.py":2715 + /* "collisions.py":2871 * 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, 2715, __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, 2871, __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, 2715, __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, 2871, __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, 2715, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2871, __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":2716 + /* "collisions.py":2872 * *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, 2716, __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, 2872, __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, 2716, __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, 2872, __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, 2716, __pyx_L1_error) + __pyx_t_12 = PyNumber_Subtract(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2872, __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":2713 + /* "collisions.py":2869 * 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, 2713, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2869, __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, 2713, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11)) __PYX_ERR(0, 2869, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12)) __PYX_ERR(0, 2713, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12)) __PYX_ERR(0, 2869, __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, 2713, __pyx_L1_error) + __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2869, __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, 2713, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2869, __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; @@ -92281,7 +98062,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, 2713, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -92289,7 +98070,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2695 + /* "collisions.py":2851 * """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 # <<<<<<<<<<<<<< @@ -92313,17 +98094,17 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __Pyx_XDECREF(__pyx_v_rs); __Pyx_XDECREF(__pyx_v_mins); __Pyx_XDECREF(__pyx_v_maxs); - __Pyx_XDECREF(__pyx_9genexpr67__pyx_v_s); - __Pyx_XDECREF(__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator11); - __Pyx_XDECREF(__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator12); - __Pyx_XDECREF(__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator13); - __Pyx_XDECREF(__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator14); + __Pyx_XDECREF(__pyx_9genexpr70__pyx_v_s); + __Pyx_XDECREF(__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator13); + __Pyx_XDECREF(__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator14); + __Pyx_XDECREF(__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator15); + __Pyx_XDECREF(__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator16); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2719 +/* "collisions.py":2875 * )) * * @staticmethod # <<<<<<<<<<<<<< @@ -92359,7 +98140,7 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_3combineRects(PyObject *_ return __pyx_r; } -/* "collisions.py":2742 +/* "collisions.py":2898 * merged = False * # Sort shapes by x-coordinate * shapes = sorted(shapes, key=lambda x: x.x) # <<<<<<<<<<<<<< @@ -92368,15 +98149,15 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_3combineRects(PyObject *_ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_12combineRects_lambda36(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_12combineRects_lambda38(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_13ShapeCombiner_12combineRects_lambda36 = {"lambda36", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_12combineRects_lambda36, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_12combineRects_lambda36(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_13ShapeCombiner_12combineRects_lambda38 = {"lambda38", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_12combineRects_lambda38, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_12combineRects_lambda38(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -92394,7 +98175,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda36 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda38 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -92420,12 +98201,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2742, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2898, __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, "lambda36") < 0)) __PYX_ERR(0, 2742, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda38") < 0)) __PYX_ERR(0, 2898, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -92436,7 +98217,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda36", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2742, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda38", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2898, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -92446,11 +98227,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ShapeCombiner.combineRects.lambda36", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ShapeCombiner.combineRects.lambda38", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda36(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda38(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -92463,16 +98244,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda36(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_lambda_funcdef_lambda38(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("lambda36", 1); + __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, 2742, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -92481,7 +98262,7 @@ static PyObject *__pyx_lambda_funcdef_lambda36(CYTHON_UNUSED PyObject *__pyx_sel /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.ShapeCombiner.combineRects.lambda36", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ShapeCombiner.combineRects.lambda38", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -92489,7 +98270,7 @@ static PyObject *__pyx_lambda_funcdef_lambda36(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2756 +/* "collisions.py":2912 * * # Sort shapes by y-coordinate * outshapes1 = sorted(outshapes1, key=lambda x: x.y) # <<<<<<<<<<<<<< @@ -92498,15 +98279,15 @@ static PyObject *__pyx_lambda_funcdef_lambda36(CYTHON_UNUSED PyObject *__pyx_sel */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_12combineRects_1lambda37(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_12combineRects_1lambda39(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_13ShapeCombiner_12combineRects_1lambda37 = {"lambda37", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_12combineRects_1lambda37, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_12combineRects_1lambda37(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_13ShapeCombiner_12combineRects_1lambda39 = {"lambda39", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_12combineRects_1lambda39, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_12combineRects_1lambda39(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -92524,7 +98305,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda37 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda39 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -92550,12 +98331,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2756, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2912, __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, "lambda37") < 0)) __PYX_ERR(0, 2756, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda39") < 0)) __PYX_ERR(0, 2912, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -92566,7 +98347,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda37", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2756, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda39", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2912, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -92576,11 +98357,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ShapeCombiner.combineRects.lambda37", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ShapeCombiner.combineRects.lambda39", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda37(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda39(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -92593,16 +98374,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda37(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_lambda_funcdef_lambda39(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("lambda37", 1); + __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, 2756, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -92611,7 +98392,7 @@ static PyObject *__pyx_lambda_funcdef_lambda37(CYTHON_UNUSED PyObject *__pyx_sel /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.ShapeCombiner.combineRects.lambda37", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ShapeCombiner.combineRects.lambda39", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -92619,7 +98400,7 @@ static PyObject *__pyx_lambda_funcdef_lambda37(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2719 +/* "collisions.py":2875 * )) * * @staticmethod # <<<<<<<<<<<<<< @@ -92634,8 +98415,8 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS PyObject *__pyx_v_rect = NULL; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_outshapes2 = NULL; - PyObject *__pyx_9genexpr72__pyx_v_i = NULL; - PyObject *__pyx_9genexpr73__pyx_v_i = NULL; + PyObject *__pyx_9genexpr75__pyx_v_i = NULL; + PyObject *__pyx_9genexpr76__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -92657,26 +98438,26 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __Pyx_RefNannySetupContext("combineRects", 0); __Pyx_INCREF(__pyx_v_shapes); - /* "collisions.py":2735 + /* "collisions.py":2891 * 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, Rect)], [i for i in shapes if not checkShpType(i, Rect)] + * 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, 2735, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2891, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "collisions.py":2736 + /* "collisions.py":2892 * """ * if not shapes: * return Shapes() # <<<<<<<<<<<<<< - * shapes, others = [i for i in shapes if checkShpType(i, Rect)], [i for i in shapes if not checkShpType(i, Rect)] + * 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 */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2736, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -92696,7 +98477,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, 2736, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -92704,33 +98485,33 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2735 + /* "collisions.py":2891 * 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, Rect)], [i for i in shapes if not checkShpType(i, Rect)] + * shapes, others = [i for i in shapes if checkShpType(i, ShpTyps.Rect)], [i for i in shapes if not checkShpType(i, ShpTyps.Rect)] */ } - /* "collisions.py":2737 + /* "collisions.py":2893 * if not shapes: * return Shapes() - * shapes, others = [i for i in shapes if checkShpType(i, Rect)], [i for i in shapes if not checkShpType(i, Rect)] # <<<<<<<<<<<<<< + * 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: */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2737, __pyx_L6_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2893, __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, 2737, __pyx_L6_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2893, __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, 2737, __pyx_L6_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2893, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -92738,28 +98519,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, 2737, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2893, __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, 2737, __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, 2893, __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, 2737, __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, 2893, __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, 2737, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2893, __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, 2737, __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, 2893, __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, 2737, __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, 2893, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -92769,26 +98550,29 @@ 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, 2737, __pyx_L6_error) + else __PYX_ERR(0, 2893, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_5); } - __Pyx_XDECREF_SET(__pyx_9genexpr72__pyx_v_i, __pyx_t_5); + __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, 2737, __pyx_L6_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2893, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Rect); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2737, __pyx_L6_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2893, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = NULL; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Rect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2893, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = 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)) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; @@ -92796,39 +98580,39 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_9genexpr72__pyx_v_i, __pyx_t_10}; + PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_9genexpr75__pyx_v_i, __pyx_t_11}; __pyx_t_5 = __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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2737, __pyx_L6_error) + __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, 2893, __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, 2737, __pyx_L6_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2893, __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_9genexpr72__pyx_v_i))) __PYX_ERR(0, 2737, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_9genexpr75__pyx_v_i))) __PYX_ERR(0, 2893, __pyx_L6_error) } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr72__pyx_v_i); __pyx_9genexpr72__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr75__pyx_v_i); __pyx_9genexpr75__pyx_v_i = 0; goto __pyx_L11_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_9genexpr72__pyx_v_i); __pyx_9genexpr72__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr75__pyx_v_i); __pyx_9genexpr75__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L11_exit_scope:; } /* exit inner scope */ { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2737, __pyx_L14_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2893, __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, 2737, __pyx_L14_error) + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2893, __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, 2737, __pyx_L14_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2893, __pyx_L14_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -92836,28 +98620,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, 2737, __pyx_L14_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2893, __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, 2737, __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, 2893, __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, 2737, __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, 2893, __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, 2737, __pyx_L14_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2893, __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, 2737, __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, 2893, __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, 2737, __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, 2893, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -92867,53 +98651,56 @@ 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, 2737, __pyx_L14_error) + else __PYX_ERR(0, 2893, __pyx_L14_error) } break; } __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_9genexpr73__pyx_v_i, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr76__pyx_v_i, __pyx_t_9); __pyx_t_9 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2737, __pyx_L14_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Rect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2737, __pyx_L14_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2893, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2893, __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, 2893, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_12); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_9genexpr73__pyx_v_i, __pyx_t_11}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2737, __pyx_L14_error) + PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_9genexpr76__pyx_v_i, __pyx_t_12}; + __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, 2893, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 2737, __pyx_L14_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2893, __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_9genexpr73__pyx_v_i))) __PYX_ERR(0, 2737, __pyx_L14_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr76__pyx_v_i))) __PYX_ERR(0, 2893, __pyx_L14_error) } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_9genexpr73__pyx_v_i); __pyx_9genexpr73__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr76__pyx_v_i); __pyx_9genexpr76__pyx_v_i = 0; goto __pyx_L19_exit_scope; __pyx_L14_error:; - __Pyx_XDECREF(__pyx_9genexpr73__pyx_v_i); __pyx_9genexpr73__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr76__pyx_v_i); __pyx_9genexpr76__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L19_exit_scope:; } /* exit inner scope */ @@ -92922,17 +98709,17 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_v_others = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2738 + /* "collisions.py":2894 * return Shapes() - * shapes, others = [i for i in shapes if checkShpType(i, Rect)], [i for i in shapes if not checkShpType(i, Rect)] + * 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: * merged = False */ __pyx_v_merged = 1; - /* "collisions.py":2739 - * shapes, others = [i for i in shapes if checkShpType(i, Rect)], [i for i in shapes if not checkShpType(i, Rect)] + /* "collisions.py":2895 + * 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: # <<<<<<<<<<<<<< * merged = False @@ -92941,7 +98728,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS while (1) { if (!__pyx_v_merged) break; - /* "collisions.py":2740 + /* "collisions.py":2896 * merged = True * while merged: * merged = False # <<<<<<<<<<<<<< @@ -92950,44 +98737,44 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ __pyx_v_merged = 0; - /* "collisions.py":2742 + /* "collisions.py":2898 * 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, 2742, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2898, __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, 2742, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2742, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shapes)) __PYX_ERR(0, 2898, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_12combineRects_lambda36, 0, __pyx_n_s_ShapeCombiner_combineRects_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2742, __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, 2898, __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, 2742, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_5) < 0) __PYX_ERR(0, 2898, __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, 2742, __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, 2898, __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":2743 + /* "collisions.py":2899 * # 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, 2743, __pyx_L1_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_outshapes1, __pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2745 + /* "collisions.py":2901 * outshapes1 = [] * * while shapes: # <<<<<<<<<<<<<< @@ -92995,22 +98782,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, 2745, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2901, __pyx_L1_error) if (!__pyx_t_1) break; - /* "collisions.py":2746 + /* "collisions.py":2902 * * 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, 2746, __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, 2902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_rect, __pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2747 + /* "collisions.py":2903 * while shapes: * rect = shapes.pop(0) * for i in shapes: # <<<<<<<<<<<<<< @@ -93022,9 +98809,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, 2747, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2903, __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, 2747, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2903, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -93032,28 +98819,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, 2747, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2903, __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, 2747, __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, 2903, __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, 2747, __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, 2903, __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, 2747, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2903, __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, 2747, __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, 2903, __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, 2747, __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, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -93063,7 +98850,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, 2747, __pyx_L1_error) + else __PYX_ERR(0, 2903, __pyx_L1_error) } break; } @@ -93072,112 +98859,112 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2748 + /* "collisions.py":2904 * 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, 2748, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2904, __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, 2748, __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, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2904, __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, 2748, __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, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2904, __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, 2748, __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, 2904, __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, 2748, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2904, __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":2749 + /* "collisions.py":2905 * 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, 2749, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2905, __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, 2749, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2905, __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, 2749, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2905, __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, 2749, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2905, __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, 2749, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2749, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2905, __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_10, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2749, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2749, __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, 2905, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_t_9); __pyx_t_3 = __pyx_t_9; } else { - __Pyx_INCREF(__pyx_t_10); - __pyx_t_3 = __pyx_t_10; + __Pyx_INCREF(__pyx_t_11); + __pyx_t_3 = __pyx_t_11; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 2749, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Subtract(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2749, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyNumber_Subtract(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2905, __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_10) < 0) __PYX_ERR(0, 2749, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_rect, __pyx_n_s_w, __pyx_t_11) < 0) __PYX_ERR(0, 2905, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2750 + /* "collisions.py":2906 * 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, 2750, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapes, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -93195,15 +98982,15 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_i}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __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_10)) __PYX_ERR(0, 2750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2906, __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; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2751 + /* "collisions.py":2907 * rect.w = max(rect.x + rect.w, i.x + i.w) - rect.x * shapes.remove(i) * merged = True # <<<<<<<<<<<<<< @@ -93212,7 +98999,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ __pyx_v_merged = 1; - /* "collisions.py":2752 + /* "collisions.py":2908 * shapes.remove(i) * merged = True * break # <<<<<<<<<<<<<< @@ -93221,7 +99008,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ goto __pyx_L25_break; - /* "collisions.py":2748 + /* "collisions.py":2904 * 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): # <<<<<<<<<<<<<< @@ -93230,7 +99017,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ } - /* "collisions.py":2747 + /* "collisions.py":2903 * while shapes: * rect = shapes.pop(0) * for i in shapes: # <<<<<<<<<<<<<< @@ -93245,54 +99032,54 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS goto __pyx_L30_for_end; __pyx_L30_for_end:; - /* "collisions.py":2753 + /* "collisions.py":2909 * 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, 2753, __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, 2909, __pyx_L1_error) } - /* "collisions.py":2756 + /* "collisions.py":2912 * * # 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, 2756, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2912, __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, 2756, __pyx_L1_error); - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_12combineRects_1lambda37, 0, __pyx_n_s_ShapeCombiner_combineRects_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2756, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_outshapes1)) __PYX_ERR(0, 2912, __pyx_L1_error); + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2912, __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, 2912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2756, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2912, __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_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2756, __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, 2912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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":2757 + /* "collisions.py":2913 * # 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, 2757, __pyx_L1_error) + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_outshapes2, ((PyObject*)__pyx_t_9)); __pyx_t_9 = 0; - /* "collisions.py":2759 + /* "collisions.py":2915 * outshapes2 = [] * * while outshapes1: # <<<<<<<<<<<<<< @@ -93300,22 +99087,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, 2759, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_outshapes1); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2915, __pyx_L1_error) if (!__pyx_t_1) break; - /* "collisions.py":2760 + /* "collisions.py":2916 * * 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, 2760, __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, 2916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_rect, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2761 + /* "collisions.py":2917 * while outshapes1: * rect = outshapes1.pop(0) * for i in outshapes1: # <<<<<<<<<<<<<< @@ -93327,9 +99114,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, 2761, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_outshapes1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2917, __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, 2761, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2917, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -93337,161 +99124,161 @@ 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, 2761, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2917, __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_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2761, __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, 2917, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2917, __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, 2761, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2917, __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_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2761, __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, 2917, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); #endif } } else { - __pyx_t_10 = __pyx_t_8(__pyx_t_9); - if (unlikely(!__pyx_t_10)) { + __pyx_t_11 = __pyx_t_8(__pyx_t_9); + if (unlikely(!__pyx_t_11)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2761, __pyx_L1_error) + else __PYX_ERR(0, 2917, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); } - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_10); - __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_11); + __pyx_t_11 = 0; - /* "collisions.py":2762 + /* "collisions.py":2918 * 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_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2762, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2762, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2918, __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, 2918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2762, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 2918, __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, 2762, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2918, __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, 2762, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2918, __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, 2762, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2762, __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, 2918, __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_10); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2762, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2918, __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_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2762, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2762, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2918, __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, 2918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Add(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2762, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 2762, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2762, __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, 2918, __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_10); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2762, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2918, __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":2763 + /* "collisions.py":2919 * 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_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2763, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2919, __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, 2919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Add(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2763, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 2763, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2763, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2919, __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, 2919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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, 2763, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2763, __pyx_L1_error) + __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, 2919, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2919, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_t_3); - __pyx_t_10 = __pyx_t_3; + __pyx_t_11 = __pyx_t_3; } else { __Pyx_INCREF(__pyx_t_4); - __pyx_t_10 = __pyx_t_4; + __pyx_t_11 = __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_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2763, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2763, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 2763, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_rect, __pyx_n_s_h, __pyx_t_4) < 0) __PYX_ERR(0, 2919, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2764 + /* "collisions.py":2920 * 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, 2764, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_outshapes1, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = NULL; + __pyx_t_11 = NULL; __pyx_t_6 = 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)) { + __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_10); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; @@ -93499,16 +99286,16 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_i}; + 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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2764, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2920, __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":2765 + /* "collisions.py":2921 * rect.h = max(rect.y + rect.h, i.y + i.h) - rect.y * outshapes1.remove(i) * merged = True # <<<<<<<<<<<<<< @@ -93517,7 +99304,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ __pyx_v_merged = 1; - /* "collisions.py":2766 + /* "collisions.py":2922 * outshapes1.remove(i) * merged = True * break # <<<<<<<<<<<<<< @@ -93526,7 +99313,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ goto __pyx_L34_break; - /* "collisions.py":2762 + /* "collisions.py":2918 * 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): # <<<<<<<<<<<<<< @@ -93535,7 +99322,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ } - /* "collisions.py":2761 + /* "collisions.py":2917 * while outshapes1: * rect = outshapes1.pop(0) * for i in outshapes1: # <<<<<<<<<<<<<< @@ -93550,17 +99337,17 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS goto __pyx_L39_for_end; __pyx_L39_for_end:; - /* "collisions.py":2767 + /* "collisions.py":2923 * 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, 2767, __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, 2923, __pyx_L1_error) } - /* "collisions.py":2769 + /* "collisions.py":2925 * outshapes2.append(rect) * * shapes = outshapes2 # <<<<<<<<<<<<<< @@ -93571,7 +99358,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __Pyx_DECREF_SET(__pyx_v_shapes, __pyx_v_outshapes2); } - /* "collisions.py":2771 + /* "collisions.py":2927 * shapes = outshapes2 * * return Shapes(*shapes, *others) # <<<<<<<<<<<<<< @@ -93579,25 +99366,25 @@ 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, 2771, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2927, __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, 2771, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PySequence_Tuple(__pyx_v_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2771, __pyx_L1_error) + __pyx_t_3 = PySequence_Tuple(__pyx_v_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2927, __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_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2771, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2719 + /* "collisions.py":2875 * )) * * @staticmethod # <<<<<<<<<<<<<< @@ -93623,14 +99410,14 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __Pyx_XDECREF(__pyx_v_rect); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_outshapes2); - __Pyx_XDECREF(__pyx_9genexpr72__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr73__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr75__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr76__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2773 +/* "collisions.py":2929 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< @@ -93666,7 +99453,7 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_5union(PyObject *__pyx_se return __pyx_r; } -/* "collisions.py":2783 +/* "collisions.py":2939 * if not shapes: * return Shapes() * def reformat(obj): # <<<<<<<<<<<<<< @@ -93727,12 +99514,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2783, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2939, __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, 2783, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reformat") < 0)) __PYX_ERR(0, 2939, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -93743,7 +99530,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, 2783, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("reformat", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2939, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -93771,8 +99558,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject *__pyx_self, PyObject *__pyx_v_obj) { - struct __pyx_obj_10collisions___pyx_scope_struct_30_union *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_30_union *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -93788,21 +99575,21 @@ 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_30_union *) __Pyx_CyFunction_GetClosure(__pyx_self); + __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":2784 + /* "collisions.py":2940 * return Shapes() * def reformat(obj): * if checkShpType(obj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * return obj - * elif checkShpType(s, Line): + * elif checkShpType(s, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2784, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2940, __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, 2784, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2940, __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, 2784, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -93824,19 +99611,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, 2784, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2940, __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, 2784, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2785 + /* "collisions.py":2941 * def reformat(obj): * if checkShpType(obj, ShpGroups.CLOSED): * return obj # <<<<<<<<<<<<<< - * elif checkShpType(s, Line): + * elif checkShpType(s, ShpTyps.Line): * return Polygon(obj.p1, obj.p2, obj.p2, obj.p1) */ __Pyx_XDECREF(__pyx_r); @@ -93844,35 +99631,38 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject __pyx_r = __pyx_v_obj; goto __pyx_L0; - /* "collisions.py":2784 + /* "collisions.py":2940 * return Shapes() * def reformat(obj): * if checkShpType(obj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * return obj - * elif checkShpType(s, Line): + * elif checkShpType(s, ShpTyps.Line): */ } - /* "collisions.py":2786 + /* "collisions.py":2942 * if checkShpType(obj, ShpGroups.CLOSED): * return obj - * elif checkShpType(s, Line): # <<<<<<<<<<<<<< + * elif checkShpType(s, 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, 2786, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_s)) { __Pyx_RaiseClosureNameError("s"); __PYX_ERR(0, 2786, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_s)) { __Pyx_RaiseClosureNameError("s"); __PYX_ERR(0, 2942, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2942, __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_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { + __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; @@ -93880,35 +99670,35 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_s, __pyx_t_4}; + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_s, __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2786, __pyx_L1_error) + __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, 2942, __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, 2786, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2942, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2787 + /* "collisions.py":2943 * return obj - * elif checkShpType(s, Line): + * elif checkShpType(s, 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, 2787, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2787, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2787, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2787, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2943, __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, 2943, __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, 2787, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -93925,14 +99715,14 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_t_4, __pyx_t_3, __pyx_t_7, __pyx_t_8}; + PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_t_3, __pyx_t_4, __pyx_t_7, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2787, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -93940,16 +99730,16 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2786 + /* "collisions.py":2942 * if checkShpType(obj, ShpGroups.CLOSED): * return obj - * elif checkShpType(s, Line): # <<<<<<<<<<<<<< + * elif checkShpType(s, ShpTyps.Line): # <<<<<<<<<<<<<< * return Polygon(obj.p1, obj.p2, obj.p2, obj.p1) * # TODO: More */ } - /* "collisions.py":2783 + /* "collisions.py":2939 * if not shapes: * return Shapes() * def reformat(obj): # <<<<<<<<<<<<<< @@ -93975,9 +99765,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr78_2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +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":2805 +/* "collisions.py":2961 * checked = [] * # TODO: When objs are covered * ps = [any(k.collides(Point(*j)) for k in oshps if k != s) for j in s.toPoints()] # <<<<<<<<<<<<<< @@ -93985,30 +99775,30 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr78_2genera * while True: */ -static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_9genexpr78_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *__pyx_cur_scope; +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; 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_35_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_35_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_35_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_35_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2805, __pyx_L1_error) + __PYX_ERR(0, 2961, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_30_union *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_34_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_9genexpr78_2generator15, 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, 2805, __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, 2961, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -94024,9 +99814,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_9genexpr78_genexpr return __pyx_r; } -static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr78_2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_31_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -94049,41 +99839,41 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr78_2genera return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2805, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2805, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2961, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2961, __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, 2805, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2961, __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, 2805, __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, 2961, __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, 2805, __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, 2961, __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, 2805, __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, 2805, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2805, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_s)) { __Pyx_RaiseClosureNameError("s"); __PYX_ERR(0, 2961, __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, 2961, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2961, __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, 2805, __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, 2961, __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, 2805, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr78__pyx_v_j)) { __Pyx_RaiseClosureNameError("j"); __PYX_ERR(0, 2805, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr78__pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2805, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr81__pyx_v_j)) { __Pyx_RaiseClosureNameError("j"); __PYX_ERR(0, 2961, __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, 2961, __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, 2805, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2961, __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; @@ -94106,11 +99896,11 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr78_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, 2805, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2961, __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, 2805, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); @@ -94152,7 +99942,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr78_2genera return __pyx_r; } -/* "collisions.py":2823 +/* "collisions.py":2979 * 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) # <<<<<<<<<<<<<< @@ -94161,15 +99951,15 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr78_2genera */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_5union_2lambda39(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_5union_2lambda41(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_13ShapeCombiner_5union_2lambda39 = {"lambda39", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_5union_2lambda39, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_5union_2lambda39(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_13ShapeCombiner_5union_2lambda41 = {"lambda41", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_5union_2lambda41, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_5union_2lambda41(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -94187,7 +99977,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda39 (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda41 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -94213,12 +100003,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2823, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2979, __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, 2823, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda41") < 0)) __PYX_ERR(0, 2979, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -94229,7 +100019,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, 2823, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda41", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2979, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -94239,11 +100029,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.ShapeCombiner.union.lambda39", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ShapeCombiner.union.lambda41", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda39(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_lambda_funcdef_lambda41(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -94256,9 +100046,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda39(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_30_union *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_30_union *__pyx_outer_scope; +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; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -94268,41 +100058,41 @@ static PyObject *__pyx_lambda_funcdef_lambda39(PyObject *__pyx_self, PyObject *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda39", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_30_union *) __Pyx_CyFunction_GetClosure(__pyx_self); + __Pyx_RefNannySetupContext("lambda41", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_34_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, 2823, __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, 2979, __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, 2823, __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, 2979, __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, 2823, __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, 2823, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_p1)) { __Pyx_RaiseClosureNameError("p1"); __PYX_ERR(0, 2979, __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, 2979, __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, 2823, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2979, __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, 2823, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2979, __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, 2823, __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, 2979, __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, 2823, __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, 2979, __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, 2823, __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, 2823, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_p1)) { __Pyx_RaiseClosureNameError("p1"); __PYX_ERR(0, 2979, __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, 2979, __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, 2823, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2979, __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, 2823, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2979, __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, 2823, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2979, __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; @@ -94316,7 +100106,7 @@ static PyObject *__pyx_lambda_funcdef_lambda39(PyObject *__pyx_self, PyObject *_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.ShapeCombiner.union.lambda39", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.ShapeCombiner.union.lambda41", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -94324,7 +100114,7 @@ static PyObject *__pyx_lambda_funcdef_lambda39(PyObject *__pyx_self, PyObject *_ return __pyx_r; } -/* "collisions.py":2773 +/* "collisions.py":2929 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< @@ -94333,7 +100123,7 @@ static PyObject *__pyx_lambda_funcdef_lambda39(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_30_union *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_cur_scope; PyObject *__pyx_v_reformat = 0; PyObject *__pyx_v_reform = NULL; PyObject *__pyx_v_outshps = NULL; @@ -94353,12 +100143,12 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb Py_ssize_t __pyx_v_other; Py_ssize_t __pyx_v_k; PyObject *__pyx_v_ws = NULL; - PyObject *__pyx_9genexpr74__pyx_v_s = NULL; - Py_ssize_t __pyx_9genexpr75__pyx_v_i; - PyObject *__pyx_9genexpr76__pyx_v_i = NULL; - PyObject *__pyx_9genexpr77__pyx_v_j = NULL; - PyObject *__pyx_9genexpr78__pyx_v_0 = NULL; - CYTHON_UNUSED Py_ssize_t __pyx_9genexpr80__pyx_v__; + PyObject *__pyx_9genexpr77__pyx_v_s = NULL; + Py_ssize_t __pyx_9genexpr78__pyx_v_i; + PyObject *__pyx_9genexpr79__pyx_v_i = NULL; + PyObject *__pyx_9genexpr80__pyx_v_j = NULL; + PyObject *__pyx_9genexpr81__pyx_v_0 = NULL; + CYTHON_UNUSED Py_ssize_t __pyx_9genexpr83__pyx_v__; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -94388,28 +100178,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_30_union *)__pyx_tp_new_10collisions___pyx_scope_struct_30_union(__pyx_ptype_10collisions___pyx_scope_struct_30_union, __pyx_empty_tuple, NULL); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_30_union *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_34_union *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2773, __pyx_L1_error) + __PYX_ERR(0, 2929, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __Pyx_INCREF(__pyx_v_shapes); - /* "collisions.py":2781 + /* "collisions.py":2937 * 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, 2781, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2937, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "collisions.py":2782 + /* "collisions.py":2938 * """ * if not shapes: * return Shapes() # <<<<<<<<<<<<<< @@ -94417,7 +100207,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, 2782, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -94437,7 +100227,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, 2782, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -94445,7 +100235,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2781 + /* "collisions.py":2937 * Shapes: The union of all the shapes. * """ * if not shapes: # <<<<<<<<<<<<<< @@ -94454,19 +100244,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb */ } - /* "collisions.py":2783 + /* "collisions.py":2939 * 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__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2783, __pyx_L1_error) + __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, 2939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_reformat = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2789 + /* "collisions.py":2945 * return Polygon(obj.p1, obj.p2, obj.p2, obj.p1) * # TODO: More * reform = [reformat(s) for s in shapes] # <<<<<<<<<<<<<< @@ -94474,16 +100264,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, 2789, __pyx_L6_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2945, __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, 2789, __pyx_L6_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2945, __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, 2789, __pyx_L6_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2945, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -94491,28 +100281,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, 2789, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2945, __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, 2789, __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, 2945, __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, 2789, __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, 2945, __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, 2789, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2945, __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, 2789, __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, 2945, __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, 2789, __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, 2945, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -94522,31 +100312,31 @@ 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, 2789, __pyx_L6_error) + else __PYX_ERR(0, 2945, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_5); } - __Pyx_XDECREF_SET(__pyx_9genexpr74__pyx_v_s, __pyx_t_5); + __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_9genexpr74__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2789, __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, 2945, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2789, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2945, __pyx_L6_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr74__pyx_v_s); __pyx_9genexpr74__pyx_v_s = 0; + __Pyx_XDECREF(__pyx_9genexpr77__pyx_v_s); __pyx_9genexpr77__pyx_v_s = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_9genexpr74__pyx_v_s); __pyx_9genexpr74__pyx_v_s = 0; + __Pyx_XDECREF(__pyx_9genexpr77__pyx_v_s); __pyx_9genexpr77__pyx_v_s = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __pyx_v_reform = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2790 + /* "collisions.py":2946 * # TODO: More * reform = [reformat(s) for s in shapes] * shapes = [reform[i] for i in range(len(reform)) if reform[i]] # <<<<<<<<<<<<<< @@ -94554,20 +100344,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, 2790, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2946, __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, 2790, __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, 2946, __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_9genexpr75__pyx_v_i = __pyx_t_10; - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_reform, __pyx_9genexpr75__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2790, __pyx_L1_error) + __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, 2946, __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, 2790, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2946, __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_9genexpr75__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2790, __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, 2946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2790, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2946, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } @@ -94575,19 +100365,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":2791 + /* "collisions.py":2947 * 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, 2791, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_outshps = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2792 + /* "collisions.py":2948 * shapes = [reform[i] for i in range(len(reform)) if reform[i]] * outshps = [] * while shapes: # <<<<<<<<<<<<<< @@ -94595,24 +100385,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, 2792, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2948, __pyx_L1_error) if (!__pyx_t_2) break; - /* "collisions.py":2793 + /* "collisions.py":2949 * 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, 2793, __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, 2949, __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":2794 + /* "collisions.py":2950 * while shapes: * s = shapes.pop(0) * colls = [i.collides(s) for i in outshps] # <<<<<<<<<<<<<< @@ -94620,7 +100410,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, 2794, __pyx_L18_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2950, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_outshps; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; @@ -94628,19 +100418,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, 2794, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2950, __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, 2794, __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, 2950, __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, 2794, __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, 2950, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_5); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr76__pyx_v_i, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr79__pyx_v_i, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr76__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2794, __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, 2950, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_6 = 0; @@ -94660,95 +100450,95 @@ 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, 2794, __pyx_L18_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2950, __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, 2794, __pyx_L18_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2950, __pyx_L18_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr76__pyx_v_i); __pyx_9genexpr76__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr79__pyx_v_i); __pyx_9genexpr79__pyx_v_i = 0; goto __pyx_L22_exit_scope; __pyx_L18_error:; - __Pyx_XDECREF(__pyx_9genexpr76__pyx_v_i); __pyx_9genexpr76__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr79__pyx_v_i); __pyx_9genexpr79__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L22_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_colls, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "collisions.py":2795 + /* "collisions.py":2951 * 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, 2795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_v_colls); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2951, __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, 2795, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2951, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "collisions.py":2796 + /* "collisions.py":2952 * 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, 2796, __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, 2952, __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":2797 + /* "collisions.py":2953 * 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, 2797, __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, 2953, __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, 2797, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2953, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "collisions.py":2798 + /* "collisions.py":2954 * 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, 2798, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_newpts, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "collisions.py":2799 + /* "collisions.py":2955 * 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, 2799, __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, 2955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2955, __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, 2799, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_s)) __PYX_ERR(0, 2955, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 2799, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 2955, __pyx_L1_error); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_oshps, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collisions.py":2800 + /* "collisions.py":2956 * newpts = [] * oshps = [s, outshps[i]] * lns = [j.toLines() for j in oshps] # <<<<<<<<<<<<<< @@ -94756,7 +100546,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, 2800, __pyx_L29_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2956, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_v_oshps; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; @@ -94764,19 +100554,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, 2800, __pyx_L29_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2956, __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, 2800, __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, 2956, __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, 2800, __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, 2956, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_5); #endif - __Pyx_XDECREF_SET(__pyx_9genexpr77__pyx_v_j, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr80__pyx_v_j, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr77__pyx_v_j, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2800, __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, 2956, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_6 = 0; @@ -94796,25 +100586,25 @@ 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, 2800, __pyx_L29_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2956, __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, 2800, __pyx_L29_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2956, __pyx_L29_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr77__pyx_v_j); __pyx_9genexpr77__pyx_v_j = 0; + __Pyx_XDECREF(__pyx_9genexpr80__pyx_v_j); __pyx_9genexpr80__pyx_v_j = 0; goto __pyx_L33_exit_scope; __pyx_L29_error:; - __Pyx_XDECREF(__pyx_9genexpr77__pyx_v_j); __pyx_9genexpr77__pyx_v_j = 0; + __Pyx_XDECREF(__pyx_9genexpr80__pyx_v_j); __pyx_9genexpr80__pyx_v_j = 0; goto __pyx_L1_error; __pyx_L33_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_lns, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collisions.py":2801 + /* "collisions.py":2957 * oshps = [s, outshps[i]] * lns = [j.toLines() for j in oshps] * direc = 1 # <<<<<<<<<<<<<< @@ -94824,7 +100614,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":2802 + /* "collisions.py":2958 * lns = [j.toLines() for j in oshps] * direc = 1 * check = 0 # <<<<<<<<<<<<<< @@ -94834,19 +100624,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":2803 + /* "collisions.py":2959 * 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, 2803, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_checked, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collisions.py":2805 + /* "collisions.py":2961 * checked = [] * # TODO: When objs are covered * ps = [any(k.collides(Point(*j)) for k in oshps if k != s) for j in s.toPoints()] # <<<<<<<<<<<<<< @@ -94854,9 +100644,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, 2805, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2961, __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, 2805, __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, 2961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = NULL; __pyx_t_6 = 0; @@ -94876,7 +100666,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, 2805, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -94885,9 +100675,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, 2805, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2961, __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, 2805, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2961, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -94896,28 +100686,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, 2805, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2961, __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, 2805, __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, 2961, __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, 2805, __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, 2961, __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, 2805, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2961, __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, 2805, __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, 2961, __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, 2805, __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, 2961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -94927,22 +100717,22 @@ 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, 2805, __pyx_L1_error) + else __PYX_ERR(0, 2961, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr78__pyx_v_j); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr78__pyx_v_j, __pyx_t_3); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr81__pyx_v_j); + __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_9genexpr78_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_oshps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2805, __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, 2961, __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, 2805, __pyx_L1_error) + __pyx_t_11 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2961, __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, 2805, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 2961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -94950,19 +100740,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":2806 + /* "collisions.py":2962 * # 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, 2806, __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, 2962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2807 + /* "collisions.py":2963 * ps = [any(k.collides(Point(*j)) for k in oshps if k != s) for j in s.toPoints()] * j = ps.index(False) * while True: # <<<<<<<<<<<<<< @@ -94971,73 +100761,73 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb */ while (1) { - /* "collisions.py":2808 + /* "collisions.py":2964 * 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, 2808, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2964, __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, 2808, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_check)) __PYX_ERR(0, 2964, __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, 2808, __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, 2808, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_j)) __PYX_ERR(0, 2964, __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, 2964, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2809 + /* "collisions.py":2965 * 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, 2809, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2965, __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, 2809, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_check)) __PYX_ERR(0, 2965, __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, 2809, __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, 2809, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_j)) __PYX_ERR(0, 2965, __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, 2965, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2810 + /* "collisions.py":2966 * 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, 2810, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_lns, __pyx_v_check); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2966, __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, 2810, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2966, __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":2811 + /* "collisions.py":2967 * 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, 2811, __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, 2967, __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, 2811, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __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, 2811, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; @@ -95047,21 +100837,21 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2812 + /* "collisions.py":2968 * 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, 2812, __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, 2968, __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, 2812, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2968, __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, 2812, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; @@ -95069,7 +100859,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":2813 + /* "collisions.py":2969 * p1 = ln.p1 if direc == 1 else ln.p2 * p2 = ln.p2 if direc == 1 else ln.p1 * newpts.append(p1) # <<<<<<<<<<<<<< @@ -95078,58 +100868,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, 2813, __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, 2969, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2814 + /* "collisions.py":2970 * 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, 2814, __pyx_L1_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_wheres, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "collisions.py":2815 + /* "collisions.py":2971 * 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, 2815, __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, 2971, __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":2816 + /* "collisions.py":2972 * 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, 2816, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2972, __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, 2816, __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, 2972, __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, 2816, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2972, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2817 + /* "collisions.py":2973 * 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, 2817, __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, 2973, __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, 2817, __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, 2973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -95150,41 +100940,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, 2817, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2973, __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, 2817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2973, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2818 + /* "collisions.py":2974 * 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, 2818, __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, 2974, __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, 2818, __pyx_L1_error) + __pyx_t_17 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2974, __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":2819 + /* "collisions.py":2975 * 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, 2819, __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, 2975, __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, 2819, __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, 2975, __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, 2819, __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, 2975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -95206,26 +100996,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, 2819, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2975, __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, 2819, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2975, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2820 + /* "collisions.py":2976 * 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, 2820, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2976, __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, 2820, __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, 2976, __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, 2820, __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, 2976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -95247,14 +101037,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, 2820, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2976, __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":2821 + /* "collisions.py":2977 * if ln.collides(lns[other][k]): * ws = ln.whereCollides(lns[other][k]) * wheres.extend(zip(ws, [(other, k) for _ in range(len(ws))])) # <<<<<<<<<<<<<< @@ -95262,43 +101052,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, 2821, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2977, __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, 2821, __pyx_L1_error) + __pyx_t_20 = PyObject_Length(__pyx_v_ws); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2977, __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_9genexpr80__pyx_v__ = __pyx_t_22; - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2821, __pyx_L1_error) + __pyx_9genexpr83__pyx_v__ = __pyx_t_22; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2977, __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, 2821, __pyx_L1_error) + __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2821, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2977, __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, 2821, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 2977, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11)) __PYX_ERR(0, 2821, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11)) __PYX_ERR(0, 2977, __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, 2821, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2977, __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, 2821, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2977, __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, 2821, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ws)) __PYX_ERR(0, 2977, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 2821, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 2977, __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, 2821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2977, __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, 2821, __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, 2977, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2819 + /* "collisions.py":2975 * if ln.collides(oshps[other]): * for k in range(len(lns[other])): * if ln.collides(lns[other][k]): # <<<<<<<<<<<<<< @@ -95308,7 +101098,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb } } - /* "collisions.py":2817 + /* "collisions.py":2973 * for other in range(len(oshps)): * if other != check: * if ln.collides(oshps[other]): # <<<<<<<<<<<<<< @@ -95317,439 +101107,1383 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb */ } - /* "collisions.py":2816 + /* "collisions.py":2972 * wheres = [] * for other in range(len(oshps)): * if other != check: # <<<<<<<<<<<<<< * if ln.collides(oshps[other]): * for k in range(len(lns[other])): */ - } - } + } + } + + /* "collisions.py":2978 + * 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, 2978, __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, 2978, __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, 2978, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "collisions.py":2979 + * 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, 2979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2979, __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, 2979, __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, 2979, __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, 2979, __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":2980 + * 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, 2980, __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, 2980, __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, 2980, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "collisions.py":2982 + * 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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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, 2982, __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; + __pyx_t_23 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_23)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_23); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_t_5}; + __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, 2982, __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, 2982, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "collisions.py":2983 + * # Correct direction handling + * if oshps[check].collides(Point(*lns[wheres[0][1][0]][wheres[0][1][1]].p2)): + * direc = -1 # <<<<<<<<<<<<<< + * else: + * direc = 1 + */ + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_DECREF_SET(__pyx_v_direc, __pyx_int_neg_1); + + /* "collisions.py":2982 + * 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: + */ + goto __pyx_L50; + } + + /* "collisions.py":2985 + * direc = -1 + * else: + * direc = 1 # <<<<<<<<<<<<<< + * check = wheres[0][1][0] + * j = wheres[0][1][1] + */ + /*else*/ { + __Pyx_INCREF(__pyx_int_1); + __Pyx_DECREF_SET(__pyx_v_direc, __pyx_int_1); + } + __pyx_L50:; + + /* "collisions.py":2986 + * 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, 2986, __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, 2986, __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, 2986, __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":2987 + * 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, 2987, __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, 2987, __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, 2987, __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":2978 + * 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]) + */ + goto __pyx_L49; + } + + /* "collisions.py":2989 + * j = wheres[0][1][1] + * else: + * newpts.append(p2) # <<<<<<<<<<<<<< + * else: + * break + */ + /*else*/ { + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_newpts, __pyx_v_p2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2989, __pyx_L1_error) + } + __pyx_L49:; + + /* "collisions.py":2964 + * j = ps.index(False) + * while True: + * if (check, j) not in checked: # <<<<<<<<<<<<<< + * checked.append((check, j)) + * ln = lns[check][j] + */ + goto __pyx_L39; + } + + /* "collisions.py":2991 + * newpts.append(p2) + * else: + * break # <<<<<<<<<<<<<< + * j = (j + direc) % len(lns[check]) + * outshps[i] = Polygon(*newpts) + */ + /*else*/ { + goto __pyx_L38_break; + } + __pyx_L39:; + + /* "collisions.py":2992 + * 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, 2992, __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, 2992, __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, 2992, __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, 2992, __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, 2992, __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_j, __pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L38_break:; + + /* "collisions.py":2993 + * 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, 2993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PySequence_Tuple(__pyx_v_newpts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2993, __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, 2993, __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, 2993, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "collisions.py":2953 + * if any(colls): + * for i in range(len(colls)): + * if colls[i]: # <<<<<<<<<<<<<< + * newpts = [] + * oshps = [s, outshps[i]] + */ + } + } + + /* "collisions.py":2951 + * s = shapes.pop(0) + * colls = [i.collides(s) for i in outshps] + * if any(colls): # <<<<<<<<<<<<<< + * for i in range(len(colls)): + * if colls[i]: + */ + goto __pyx_L23; + } + + /* "collisions.py":2995 + * outshps[i] = Polygon(*newpts) + * else: + * outshps.append(s) # <<<<<<<<<<<<<< + * return Shapes(*outshps) + * + */ + /*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, 2995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L23:; + } + + /* "collisions.py":2996 + * else: + * outshps.append(s) + * return Shapes(*outshps) # <<<<<<<<<<<<<< + * + * @staticmethod + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PySequence_Tuple(__pyx_v_outshps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2996, __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, 2996, __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_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "collisions.py":2929 + * return Shapes(*shapes, *others) + * + * @staticmethod # <<<<<<<<<<<<<< + * def union(*shapes: Shape) -> Shapes: # FIXME + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_23); + __Pyx_AddTraceback("collisions.ShapeCombiner.union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_shapes); + __Pyx_XDECREF(__pyx_v_reformat); + __Pyx_XDECREF(__pyx_v_reform); + __Pyx_XDECREF(__pyx_v_outshps); + __Pyx_XDECREF(__pyx_v_colls); + __Pyx_XDECREF(__pyx_v_newpts); + __Pyx_XDECREF(__pyx_v_oshps); + __Pyx_XDECREF(__pyx_v_lns); + __Pyx_XDECREF(__pyx_v_direc); + __Pyx_XDECREF(__pyx_v_check); + __Pyx_XDECREF(__pyx_v_checked); + __Pyx_XDECREF(__pyx_v_ps); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_ln); + __Pyx_XDECREF(__pyx_v_p2); + __Pyx_XDECREF(__pyx_v_wheres); + __Pyx_XDECREF(__pyx_v_ws); + __Pyx_XDECREF(__pyx_9genexpr77__pyx_v_s); + __Pyx_XDECREF(__pyx_9genexpr79__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr80__pyx_v_j); + __Pyx_XDECREF(__pyx_9genexpr81__pyx_v_0); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":2998 + * return Shapes(*outshps) + * + * @staticmethod # <<<<<<<<<<<<<< + * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: + * """ + */ + +static PyObject *__pyx_pf_10collisions_66__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, 2998, __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, 2998, __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, 2998, __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, 2998, __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, 2998, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2998, __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_13ShapeCombiner_7pointsToShape(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_13ShapeCombiner_6pointsToShape, "\n Converts a list of points to a shape object.\n \n No points: NoShape()\n One point: Point()\n 2 points: Line()\n 4 points and in the shape of a rectangle: Rect()\n Otherwise: Polygon()\n\n This differs from `ShapeCombiner.pointsToPoly` in that **this** will connect all the points with lines, *instead* of creating a polygon to envelop them all.\n\n Args:\n *points (pointLike): The points to convert to a shape.\n bounciness (float, optional): The bounciness of the output shape. Defaults to 0.7.\n\n Returns:\n Shape: The shape object made from the points\n "); +static PyMethodDef __pyx_mdef_10collisions_13ShapeCombiner_7pointsToShape = {"pointsToShape", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_7pointsToShape, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10collisions_13ShapeCombiner_6pointsToShape}; +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_7pointsToShape(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + double __pyx_v_bounciness; + PyObject *__pyx_v_points = 0; + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + 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("pointsToShape (wrapper)", 0); + #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 + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __Pyx_INCREF(__pyx_args); + __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); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + default: + case 0: break; + } + kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); + if (kw_args == 1) { + 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, 2998, __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, 2998, __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, 2999, __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, 2998, __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_VARARGS(values[__pyx_temp]); + } + } + __Pyx_DECREF(__pyx_v_points); __pyx_v_points = 0; + __Pyx_AddTraceback("collisions.ShapeCombiner.pointsToShape", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(__pyx_self, __pyx_v_bounciness, __pyx_v_points); + + /* function exit code */ + __Pyx_DECREF(__pyx_v_points); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_bounciness, PyObject *__pyx_v_points) { + PyObject *__pyx_v_x_vals = NULL; + PyObject *__pyx_v_y_vals = NULL; + PyObject *__pyx_v_x_min = NULL; + PyObject *__pyx_v_y_min = NULL; + PyObject *__pyx_9genexpr84__pyx_v_p = NULL; + PyObject *__pyx_9genexpr85__pyx_v_p = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + unsigned 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("pointsToShape", 1); + + /* "collisions.py":3019 + * 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, 3019, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 == 0); + if (__pyx_t_2) { + + /* "collisions.py":3020 + * """ + * if len(points) == 0: + * return NoShape() # <<<<<<<<<<<<<< + * elif len(points) == 1: + * 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, 3020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(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_6 = 1; + } + } + #endif + { + 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, 3020, __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":3019 + * Shape: The shape object made from the points + * """ + * if len(points) == 0: # <<<<<<<<<<<<<< + * return NoShape() + * elif len(points) == 1: + */ + } - /* "collisions.py":2822 - * 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]) + /* "collisions.py":3021 + * if len(points) == 0: + * return NoShape() + * elif len(points) == 1: # <<<<<<<<<<<<<< + * return Point(*points[0], bounciness) + * if len(points) == 2: */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2822, __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, 2822, __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, 2822, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3021, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 == 1); + if (__pyx_t_2) { - /* "collisions.py":2823 - * 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 + /* "collisions.py":3022 + * return NoShape() + * elif len(points) == 1: + * return Point(*points[0], bounciness) # <<<<<<<<<<<<<< + * if len(points) == 2: + * return Line(*points, bounciness) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_wheres, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_5union_2lambda39, 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, 2823, __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, 2823, __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, 2823, __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; + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3022, __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, 3022, __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, 3022, __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, 3022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3022, __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, 3022, __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, 3022, __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, 3022, __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_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; - /* "collisions.py":2824 - * 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)): + /* "collisions.py":3021 + * if len(points) == 0: + * return NoShape() + * elif len(points) == 1: # <<<<<<<<<<<<<< + * return Point(*points[0], bounciness) + * if len(points) == 2: */ - __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, 2824, __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, 2824, __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, 2824, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } - /* "collisions.py":2826 - * 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: + /* "collisions.py":3023 + * elif len(points) == 1: + * return Point(*points[0], bounciness) + * if len(points) == 2: # <<<<<<<<<<<<<< + * return Line(*points, bounciness) + * */ - __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_oshps, __pyx_v_check); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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, 2826, __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; - __pyx_t_23 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_23)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_23); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_t_5}; - __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, 2826, __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, 2826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3023, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 == 2); + if (__pyx_t_2) { - /* "collisions.py":2827 - * # Correct direction handling - * if oshps[check].collides(Point(*lns[wheres[0][1][0]][wheres[0][1][1]].p2)): - * direc = -1 # <<<<<<<<<<<<<< - * else: - * direc = 1 + /* "collisions.py":3024 + * return Point(*points[0], bounciness) + * if len(points) == 2: + * return Line(*points, bounciness) # <<<<<<<<<<<<<< + * + * if len(points) == 4: */ - __Pyx_INCREF(__pyx_int_neg_1); - __Pyx_DECREF_SET(__pyx_v_direc, __pyx_int_neg_1); + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3024, __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, 3024, __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, 3024, __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, 3024, __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; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "collisions.py":2826 - * 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: + /* "collisions.py":3023 + * elif len(points) == 1: + * return Point(*points[0], bounciness) + * if len(points) == 2: # <<<<<<<<<<<<<< + * return Line(*points, bounciness) + * */ - goto __pyx_L50; - } + } - /* "collisions.py":2829 - * direc = -1 - * else: - * direc = 1 # <<<<<<<<<<<<<< - * check = wheres[0][1][0] - * j = wheres[0][1][1] + /* "collisions.py":3026 + * return Line(*points, bounciness) + * + * if len(points) == 4: # <<<<<<<<<<<<<< + * x_vals = {p[0] for p in points} + * y_vals = {p[1] for p in points} */ - /*else*/ { - __Pyx_INCREF(__pyx_int_1); - __Pyx_DECREF_SET(__pyx_v_direc, __pyx_int_1); - } - __pyx_L50:; + __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3026, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 == 4); + if (__pyx_t_2) { - /* "collisions.py":2830 - * else: - * direc = 1 - * check = wheres[0][1][0] # <<<<<<<<<<<<<< - * j = wheres[0][1][1] - * else: + /* "collisions.py":3027 + * + * if len(points) == 4: + * x_vals = {p[0] for p in points} # <<<<<<<<<<<<<< + * y_vals = {p[1] for p in points} + * */ - __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, 2830, __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, 2830, __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, 2830, __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; + { /* enter inner scope */ + __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3027, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_points; __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = 0; + for (;;) { + { + 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, 3027, __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, 3027, __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, 3027, __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, 3027, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3027, __pyx_L8_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr84__pyx_v_p); __pyx_9genexpr84__pyx_v_p = 0; + goto __pyx_L12_exit_scope; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_9genexpr84__pyx_v_p); __pyx_9genexpr84__pyx_v_p = 0; + goto __pyx_L1_error; + __pyx_L12_exit_scope:; + } /* exit inner scope */ + __pyx_v_x_vals = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":2831 - * direc = 1 - * check = wheres[0][1][0] - * j = wheres[0][1][1] # <<<<<<<<<<<<<< - * else: - * newpts.append(p2) + /* "collisions.py":3028 + * if len(points) == 4: + * x_vals = {p[0] for p in points} + * y_vals = {p[1] for p in points} # <<<<<<<<<<<<<< + * + * # To form a rectangle, we should have exactly two unique x-values and two unique y-values */ - __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, 2831, __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, 2831, __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, 2831, __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; + { /* enter inner scope */ + __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3028, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_points; __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = 0; + for (;;) { + { + 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, 3028, __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, 3028, __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, 3028, __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, 3028, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3028, __pyx_L15_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr85__pyx_v_p); __pyx_9genexpr85__pyx_v_p = 0; + goto __pyx_L19_exit_scope; + __pyx_L15_error:; + __Pyx_XDECREF(__pyx_9genexpr85__pyx_v_p); __pyx_9genexpr85__pyx_v_p = 0; + goto __pyx_L1_error; + __pyx_L19_exit_scope:; + } /* exit inner scope */ + __pyx_v_y_vals = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":2822 - * 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]) + /* "collisions.py":3031 + * + * # 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) */ - goto __pyx_L49; - } + __pyx_t_1 = __Pyx_PySet_GET_SIZE(__pyx_v_x_vals); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3031, __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, 3031, __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":2833 - * j = wheres[0][1][1] - * else: - * newpts.append(p2) # <<<<<<<<<<<<<< - * else: - * break + /* "collisions.py":3032 + * # 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) + * */ - /*else*/ { - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_newpts, __pyx_v_p2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2833, __pyx_L1_error) - } - __pyx_L49:; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_x_vals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3032, __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, 3032, __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":2808 - * j = ps.index(False) - * while True: - * if (check, j) not in checked: # <<<<<<<<<<<<<< - * checked.append((check, j)) - * ln = lns[check][j] + /* "collisions.py":3033 + * 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) # <<<<<<<<<<<<<< + * + * return Polygon(*points, bounciness=bounciness) */ - goto __pyx_L39; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3033, __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, 3033, __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, 3033, __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, 3033, __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, 3033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_6 = 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_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_x_min, __pyx_v_y_min, __pyx_t_5, __pyx_t_9}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); + __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, 3033, __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":2835 - * newpts.append(p2) - * else: - * break # <<<<<<<<<<<<<< - * j = (j + direc) % len(lns[check]) - * outshps[i] = Polygon(*newpts) + /* "collisions.py":3031 + * + * # 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) */ - /*else*/ { - goto __pyx_L38_break; - } - __pyx_L39:; + } - /* "collisions.py":2836 - * else: - * break - * j = (j + direc) % len(lns[check]) # <<<<<<<<<<<<<< - * outshps[i] = Polygon(*newpts) - * else: + /* "collisions.py":3026 + * 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_4 = PyNumber_Add(__pyx_v_j, __pyx_v_direc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2836, __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, 2836, __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, 2836, __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, 2836, __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, 2836, __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_j, __pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L38_break:; + } - /* "collisions.py":2837 - * break - * j = (j + direc) % len(lns[check]) - * outshps[i] = Polygon(*newpts) # <<<<<<<<<<<<<< - * else: - * outshps.append(s) + /* "collisions.py":3035 + * return Rect(x_min, y_min, max(x_vals)-x_min, max(y_vals)-y_min) + * + * return Polygon(*points, bounciness=bounciness) # <<<<<<<<<<<<<< + * + * @staticmethod */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PySequence_Tuple(__pyx_v_newpts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2837, __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, 2837, __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, 2837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3035, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3035, __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, 3035, __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, 3035, __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; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; - /* "collisions.py":2797 - * if any(colls): - * for i in range(len(colls)): - * if colls[i]: # <<<<<<<<<<<<<< - * newpts = [] - * oshps = [s, outshps[i]] + /* "collisions.py":2998 + * return Shapes(*outshps) + * + * @staticmethod # <<<<<<<<<<<<<< + * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: + * """ */ - } - } - /* "collisions.py":2795 - * s = shapes.pop(0) - * colls = [i.collides(s) for i in outshps] - * if any(colls): # <<<<<<<<<<<<<< - * for i in range(len(colls)): - * if colls[i]: + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("collisions.ShapeCombiner.pointsToShape", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x_vals); + __Pyx_XDECREF(__pyx_v_y_vals); + __Pyx_XDECREF(__pyx_v_x_min); + __Pyx_XDECREF(__pyx_v_y_min); + __Pyx_XDECREF(__pyx_9genexpr84__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr85__pyx_v_p); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":3037 + * return Polygon(*points, bounciness=bounciness) + * + * @staticmethod # <<<<<<<<<<<<<< + * def pointsToPoly(*points: list[Point], ratio: Number = 0.1) -> Union[Shape, Shapes]: + * """ */ - goto __pyx_L23; + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_9pointsToPoly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_13ShapeCombiner_8pointsToPoly, "\n Converts a list of points to a polygon.\n This differs from `ShapeCombiner.pointsToShape` in that **this** will create a polygon encapsulating all the points, *instead* of connecting them all with lines.\n\n Args:\n points (list[Point]): The points to convert to a polygon.\n ratio (Number): A number in the range [0, 1]. Higher means fewer verticies/less detail.\n\n Returns:\n Shape | Shapes: A Shapes object containing one polygon with the points from the input.\n "); +static PyMethodDef __pyx_mdef_10collisions_13ShapeCombiner_9pointsToPoly = {"pointsToPoly", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_9pointsToPoly, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10collisions_13ShapeCombiner_8pointsToPoly}; +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_9pointsToPoly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ratio = 0; + PyObject *__pyx_v_points = 0; + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + 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("pointsToPoly (wrapper)", 0); + #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 + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_points = __pyx_args; + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ratio,0}; + values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)((PyObject*)__pyx_float_0_1))); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + default: + case 0: break; + } + kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); + if (kw_args == 1) { + 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, 3037, __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, 3037, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs < 0)) { + goto __pyx_L5_argtuple_error; + } else { + } + __pyx_v_ratio = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pointsToPoly", 0, 0, 0, __pyx_nargs); __PYX_ERR(0, 3037, __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_VARARGS(values[__pyx_temp]); } + } + __Pyx_DECREF(__pyx_v_points); __pyx_v_points = 0; + __Pyx_AddTraceback("collisions.ShapeCombiner.pointsToPoly", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(__pyx_self, __pyx_v_ratio, __pyx_v_points); - /* "collisions.py":2839 - * outshps[i] = Polygon(*newpts) - * else: - * outshps.append(s) # <<<<<<<<<<<<<< - * return Shapes(*outshps) - * - */ - /*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, 2839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* function exit code */ + __Pyx_DECREF(__pyx_v_points); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } - __pyx_L23:; } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":2840 - * else: - * outshps.append(s) - * return Shapes(*outshps) # <<<<<<<<<<<<<< +static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ratio, PyObject *__pyx_v_points) { + PyObject *__pyx_9genexpr86__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; + Py_ssize_t __pyx_t_8; + 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("pointsToPoly", 1); + + /* "collisions.py":3051 + * 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)) # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2840, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __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, 3051, __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, 3051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PySequence_Tuple(__pyx_v_outshps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2840, __pyx_L1_error) + __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, 3051, __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, 3051, __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, 3051, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __pyx_v_points; __Pyx_INCREF(__pyx_t_7); + __pyx_t_8 = 0; + for (;;) { + { + 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, 3051, __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, 3051, __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, 3051, __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, 3051, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 3051, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_9genexpr86__pyx_v_i); __pyx_9genexpr86__pyx_v_i = 0; + goto __pyx_L9_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_9genexpr86__pyx_v_i); __pyx_9genexpr86__pyx_v_i = 0; + goto __pyx_L1_error; + __pyx_L9_exit_scope:; + } /* exit inner scope */ + __pyx_t_7 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(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_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; + __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, 3051, __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, 3051, __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, 3051, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3051, __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, 2840, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ratio, __pyx_v_ratio) < 0) __PYX_ERR(0, 3051, __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, 3051, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_3 = NULL; + __pyx_t_10 = 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_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; + __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, 3051, __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":2773 - * return Shapes(*shapes, *others) + /* "collisions.py":3037 + * return Polygon(*points, bounciness=bounciness) * * @staticmethod # <<<<<<<<<<<<<< - * def union(*shapes: Shape) -> Shapes: # FIXME + * def pointsToPoly(*points: list[Point], ratio: Number = 0.1) -> Union[Shape, 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_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_23); - __Pyx_AddTraceback("collisions.ShapeCombiner.union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("collisions.ShapeCombiner.pointsToPoly", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_shapes); - __Pyx_XDECREF(__pyx_v_reformat); - __Pyx_XDECREF(__pyx_v_reform); - __Pyx_XDECREF(__pyx_v_outshps); - __Pyx_XDECREF(__pyx_v_colls); - __Pyx_XDECREF(__pyx_v_newpts); - __Pyx_XDECREF(__pyx_v_oshps); - __Pyx_XDECREF(__pyx_v_lns); - __Pyx_XDECREF(__pyx_v_direc); - __Pyx_XDECREF(__pyx_v_check); - __Pyx_XDECREF(__pyx_v_checked); - __Pyx_XDECREF(__pyx_v_ps); - __Pyx_XDECREF(__pyx_v_j); - __Pyx_XDECREF(__pyx_v_ln); - __Pyx_XDECREF(__pyx_v_p2); - __Pyx_XDECREF(__pyx_v_wheres); - __Pyx_XDECREF(__pyx_v_ws); - __Pyx_XDECREF(__pyx_9genexpr74__pyx_v_s); - __Pyx_XDECREF(__pyx_9genexpr76__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr77__pyx_v_j); - __Pyx_XDECREF(__pyx_9genexpr78__pyx_v_0); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XDECREF(__pyx_9genexpr86__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":2842 - * return Shapes(*outshps) +/* "collisions.py":3053 + * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) * * @staticmethod # <<<<<<<<<<<<<< - * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: + * def shapelyUnion(*shapes: Shape) -> Shape: * """ */ -static PyObject *__pyx_pf_10collisions_64__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_11shapelyUnion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_13ShapeCombiner_10shapelyUnion, "\n Combine all the input shapes with shapely to be a union.\n If the shapes are not all touching, they will *still* be combined into one shape.\n If you need to combine shapes but don't like the result of this, try the `ShapeCombiner.Union` method.\n\n Args:\n shapes (list[Shape]): The shapes to combine.\n\n Returns:\n Shape: A Shape which is the union of all the input shapes.\n "); +static PyMethodDef __pyx_mdef_10collisions_13ShapeCombiner_11shapelyUnion = {"shapelyUnion", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_11shapelyUnion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10collisions_13ShapeCombiner_10shapelyUnion}; +static PyObject *__pyx_pw_10collisions_13ShapeCombiner_11shapelyUnion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shapes = 0; + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("shapelyUnion (wrapper)", 0); + #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 + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "shapelyUnion", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_shapes = __pyx_args; + __pyx_r = __pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(__pyx_self, __pyx_v_shapes); + + /* function exit code */ + __Pyx_DECREF(__pyx_v_shapes); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shapes) { 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; + unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("shapelyUnion", 1); + + /* "collisions.py":3066 + * Shape: A Shape which is the union of all the input shapes. + * """ + * return shapelyToColl(shapelyOps.unary_union(collToShapely(Shapes(*shapes)))) # <<<<<<<<<<<<<< + * + * # TODO: Options for having func(a, b, c) OR func([a, b, c]) + */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2842, __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, 2842, __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, 2842, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3066, __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, 2842, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shapelyOps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3066, __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, 3066, __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, 3066, __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, 3066, __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, 3066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(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_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; + __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, 3066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; + __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, 3066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; + __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, 3066, __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_r = __pyx_t_2; - __pyx_t_2 = 0; goto __pyx_L0; + /* "collisions.py":3053 + * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) + * + * @staticmethod # <<<<<<<<<<<<<< + * def shapelyUnion(*shapes: Shape) -> Shape: + * """ + */ + /* 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_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.ShapeCombiner.shapelyUnion", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -95757,965 +102491,881 @@ static PyObject *__pyx_pf_10collisions_64__defaults__(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_7pointsToShape(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_13ShapeCombiner_6pointsToShape, "\n Converts a list of points to a shape object.\n \n No points: NoShape()\n One point: Point()\n 2 points: Line()\n 4 points and in the shape of a rectangle: Rect()\n Otherwise: Polygon()\n\n This differs from `ShapeCombiner.pointsToPoly` in that **this** will connect all the points with lines, *instead* of creating a polygon to envelop them all.\n\n Args:\n *points (pointLike): The points to convert to a shape.\n bounciness (float, optional): The bounciness of the output shape. Defaults to 0.7.\n\n Returns:\n Shape: The shape object made from the points\n "); -static PyMethodDef __pyx_mdef_10collisions_13ShapeCombiner_7pointsToShape = {"pointsToShape", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_7pointsToShape, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10collisions_13ShapeCombiner_6pointsToShape}; -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_7pointsToShape(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - double __pyx_v_bounciness; - PyObject *__pyx_v_points = 0; - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - 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("pointsToShape (wrapper)", 0); - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); +#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; +#endif + +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct__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__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)); + (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__genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct__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__genexpr) { + 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); + #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); + } 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__genexpr(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; + } + 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}, + {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), + 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, +}; +#else + +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "collisions.""__pyx_scope_struct__genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct__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__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__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_1_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_1_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_1_genexpr = 0; +#endif + +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_1_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 - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_1_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else #endif - __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - __Pyx_INCREF(__pyx_args); - __pyx_v_points = __pyx_args; { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bounciness,0}; - __pyx_defaults23 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_self); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - default: - case 0: break; - } - kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); - if (kw_args == 1) { - 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, 2842, __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, 2842, __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, 2843, __pyx_L3_error) - } else { - __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; - } + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pointsToShape", 0, 0, 0, __pyx_nargs); __PYX_ERR(0, 2842, __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_VARARGS(values[__pyx_temp]); + #endif + return o; +} + +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_1_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_1_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } } - __Pyx_DECREF(__pyx_v_points); __pyx_v_points = 0; - __Pyx_AddTraceback("collisions.ShapeCombiner.pointsToShape", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(__pyx_self, __pyx_v_bounciness, __pyx_v_points); - - /* function exit code */ - __Pyx_DECREF(__pyx_v_points); + #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_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_1_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)o); + } else + #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_VARARGS(values[__pyx_temp]); + #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 } - __Pyx_RefNannyFinishContext(); - return __pyx_r; } -static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_bounciness, PyObject *__pyx_v_points) { - PyObject *__pyx_v_x_vals = NULL; - PyObject *__pyx_v_y_vals = NULL; - PyObject *__pyx_v_x_min = NULL; - PyObject *__pyx_v_y_min = NULL; - PyObject *__pyx_9genexpr81__pyx_v_p = NULL; - PyObject *__pyx_9genexpr82__pyx_v_p = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - unsigned 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("pointsToShape", 1); - - /* "collisions.py":2863 - * 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, 2863, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 == 0); - if (__pyx_t_2) { - - /* "collisions.py":2864 - * """ - * if len(points) == 0: - * return NoShape() # <<<<<<<<<<<<<< - * elif len(points) == 1: - * 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, 2864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(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_6 = 1; - } - } - #endif - { - 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, 2864, __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":2863 - * Shape: The shape object made from the points - * """ - * if len(points) == 0: # <<<<<<<<<<<<<< - * return NoShape() - * elif len(points) == 1: - */ +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)o; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - - /* "collisions.py":2865 - * 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, 2865, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 == 1); - if (__pyx_t_2) { - - /* "collisions.py":2866 - * return NoShape() - * elif len(points) == 1: - * return Point(*points[0], bounciness) # <<<<<<<<<<<<<< - * if len(points) == 2: - * 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, 2866, __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, 2866, __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, 2866, __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, 2866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2866, __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, 2866, __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, 2866, __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, 2866, __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_r = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L0; - - /* "collisions.py":2865 - * if len(points) == 0: - * return NoShape() - * elif len(points) == 1: # <<<<<<<<<<<<<< - * return Point(*points[0], bounciness) - * if len(points) == 2: - */ + if (p->__pyx_v_i) { + e = (*v)(p->__pyx_v_i, a); if (e) return e; } - - /* "collisions.py":2867 - * 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, 2867, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 == 2); - if (__pyx_t_2) { - - /* "collisions.py":2868 - * return Point(*points[0], bounciness) - * if len(points) == 2: - * return Line(*points, bounciness) # <<<<<<<<<<<<<< - * - * 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, 2868, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2868, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2868, __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, 2868, __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, 2868, __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, 2868, __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; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "collisions.py":2867 - * elif len(points) == 1: - * return Point(*points[0], bounciness) - * if len(points) == 2: # <<<<<<<<<<<<<< - * return Line(*points, bounciness) - * - */ + 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_1_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_1_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_1_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_1_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_1_genexpr_spec = { + "collisions.__pyx_scope_struct_1_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_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_1_genexpr_slots, +}; +#else - /* "collisions.py":2870 - * 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, 2870, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 == 4); - if (__pyx_t_2) { - - /* "collisions.py":2871 - * - * if len(points) == 4: - * x_vals = {p[0] for p in points} # <<<<<<<<<<<<<< - * y_vals = {p[1] for p in points} - * - */ - { /* enter inner scope */ - __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2871, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_v_points; __Pyx_INCREF(__pyx_t_4); - __pyx_t_1 = 0; - for (;;) { - { - 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, 2871, __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, 2871, __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, 2871, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - __Pyx_XDECREF_SET(__pyx_9genexpr81__pyx_v_p, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr81__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2871, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_7); - if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2871, __pyx_L8_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr81__pyx_v_p); __pyx_9genexpr81__pyx_v_p = 0; - goto __pyx_L12_exit_scope; - __pyx_L8_error:; - __Pyx_XDECREF(__pyx_9genexpr81__pyx_v_p); __pyx_9genexpr81__pyx_v_p = 0; - goto __pyx_L1_error; - __pyx_L12_exit_scope:; - } /* exit inner scope */ - __pyx_v_x_vals = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "collisions.py":2872 - * if len(points) == 4: - * x_vals = {p[0] for p in points} - * y_vals = {p[1] for p in points} # <<<<<<<<<<<<<< - * - * # 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, 2872, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_v_points; __Pyx_INCREF(__pyx_t_4); - __pyx_t_1 = 0; - for (;;) { - { - 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, 2872, __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, 2872, __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, 2872, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - __Pyx_XDECREF_SET(__pyx_9genexpr82__pyx_v_p, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr82__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2872, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_7); - if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2872, __pyx_L15_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr82__pyx_v_p); __pyx_9genexpr82__pyx_v_p = 0; - goto __pyx_L19_exit_scope; - __pyx_L15_error:; - __Pyx_XDECREF(__pyx_9genexpr82__pyx_v_p); __pyx_9genexpr82__pyx_v_p = 0; - goto __pyx_L1_error; - __pyx_L19_exit_scope:; - } /* exit inner scope */ - __pyx_v_y_vals = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "collisions.py":2875 - * - * # 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, 2875, __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, 2875, __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":2876 - * # 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, 2876, __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, 2876, __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":2877 - * 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) # <<<<<<<<<<<<<< - * - * 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, 2877, __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, 2877, __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, 2877, __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, 2877, __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, 2877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_6 = 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_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_x_min, __pyx_v_y_min, __pyx_t_5, __pyx_t_9}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); - __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, 2877, __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 PyTypeObject __pyx_type_10collisions___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "collisions.""__pyx_scope_struct_1_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_1_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_1_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_1_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 - /* "collisions.py":2875 - * - * # 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) - */ - } +#if CYTHON_USE_FREELISTS +static struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_2_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_2_genexpr = 0; +#endif - /* "collisions.py":2870 - * return Line(*points, bounciness) - * - * if len(points) == 4: # <<<<<<<<<<<<<< - * x_vals = {p[0] for p in points} - * y_vals = {p[1] for p in points} - */ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_2_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_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_2_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_2_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_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; +} - /* "collisions.py":2879 - * return Rect(x_min, y_min, max(x_vals)-x_min, max(y_vals)-y_min) - * - * return Polygon(*points, bounciness=bounciness) # <<<<<<<<<<<<<< - * - * @staticmethod - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2879, __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, 2879, __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, 2879, __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; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L0; - - /* "collisions.py":2842 - * return Shapes(*outshps) - * - * @staticmethod # <<<<<<<<<<<<<< - * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: - * """ - */ +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_2_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_2_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_2_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_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_2_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_2_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 + } +} - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("collisions.ShapeCombiner.pointsToShape", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_x_vals); - __Pyx_XDECREF(__pyx_v_y_vals); - __Pyx_XDECREF(__pyx_v_x_min); - __Pyx_XDECREF(__pyx_v_y_min); - __Pyx_XDECREF(__pyx_9genexpr81__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr82__pyx_v_p); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_2_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_2_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_2_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_2_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_2_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_2_genexpr_spec = { + "collisions.__pyx_scope_struct_2_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_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_2_genexpr_slots, +}; +#else -/* "collisions.py":2881 - * return Polygon(*points, bounciness=bounciness) - * - * @staticmethod # <<<<<<<<<<<<<< - * def pointsToPoly(*points: list[Point], ratio: Number = 0.1) -> Union[Shape, Shapes]: - * """ - */ +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_2_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "collisions.""__pyx_scope_struct_2_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_2_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_2_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_2_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 -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_9pointsToPoly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_13ShapeCombiner_8pointsToPoly, "\n Converts a list of points to a polygon.\n This differs from `ShapeCombiner.pointsToShape` in that **this** will create a polygon encapsulating all the points, *instead* of connecting them all with lines.\n\n Args:\n points (list[Point]): The points to convert to a polygon.\n ratio (Number): A number in the range [0, 1]. Higher means fewer verticies/less detail.\n\n Returns:\n Shape | Shapes: A Shapes object containing one polygon with the points from the input.\n "); -static PyMethodDef __pyx_mdef_10collisions_13ShapeCombiner_9pointsToPoly = {"pointsToPoly", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_9pointsToPoly, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10collisions_13ShapeCombiner_8pointsToPoly}; -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_9pointsToPoly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_ratio = 0; - PyObject *__pyx_v_points = 0; - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - 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("pointsToPoly (wrapper)", 0); - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); +#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; +#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 - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #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 - __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - __Pyx_INCREF(__pyx_args); - __pyx_v_points = __pyx_args; { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ratio,0}; - values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)((PyObject*)__pyx_float_0_1))); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - default: - case 0: break; - } - kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); - if (kw_args == 1) { - 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, 2881, __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, 2881, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs < 0)) { - goto __pyx_L5_argtuple_error; - } else { - } - __pyx_v_ratio = values[0]; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pointsToPoly", 0, 0, 0, __pyx_nargs); __PYX_ERR(0, 2881, __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_VARARGS(values[__pyx_temp]); + #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; } } - __Pyx_DECREF(__pyx_v_points); __pyx_v_points = 0; - __Pyx_AddTraceback("collisions.ShapeCombiner.pointsToPoly", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(__pyx_self, __pyx_v_ratio, __pyx_v_points); - - /* function exit code */ - __Pyx_DECREF(__pyx_v_points); + #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 { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); + #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 } - __Pyx_RefNannyFinishContext(); - return __pyx_r; } -static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ratio, PyObject *__pyx_v_points) { - PyObject *__pyx_9genexpr83__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; - Py_ssize_t __pyx_t_8; - 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("pointsToPoly", 1); - - /* "collisions.py":2895 - * 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)) # <<<<<<<<<<<<<< - * - * @staticmethod - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2895, __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, 2895, __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, 2895, __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, 2895, __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, 2895, __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, 2895, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __pyx_v_points; __Pyx_INCREF(__pyx_t_7); - __pyx_t_8 = 0; - for (;;) { - { - 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, 2895, __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, 2895, __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, 2895, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_9); - #endif - __Pyx_XDECREF_SET(__pyx_9genexpr83__pyx_v_i, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_9genexpr83__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2895, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2895, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_9genexpr83__pyx_v_i); __pyx_9genexpr83__pyx_v_i = 0; - goto __pyx_L9_exit_scope; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr83__pyx_v_i); __pyx_9genexpr83__pyx_v_i = 0; - goto __pyx_L1_error; - __pyx_L9_exit_scope:; - } /* exit inner scope */ - __pyx_t_7 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(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_10 = 1; - } +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 - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; - __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, 2895, __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, 2895, __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, 2895, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2895, __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, 2895, __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, 2895, __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_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_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_10 = 1; - } - } + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; - __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, 2895, __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":2881 - * return Polygon(*points, bounciness=bounciness) - * - * @staticmethod # <<<<<<<<<<<<<< - * def pointsToPoly(*points: list[Point], ratio: Number = 0.1) -> Union[Shape, 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_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("collisions.ShapeCombiner.pointsToPoly", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_9genexpr83__pyx_v_i); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + #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 -/* "collisions.py":2897 - * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) - * - * @staticmethod # <<<<<<<<<<<<<< - * def shapelyUnion(*shapes: Shape) -> Shape: - * """ - */ +#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 -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_11shapelyUnion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_13ShapeCombiner_10shapelyUnion, "\n Combine all the input shapes with shapely to be a union.\n If the shapes are not all touching, they will *still* be combined into one shape.\n If you need to combine shapes but don't like the result of this, try the `ShapeCombiner.Union` method.\n\n Args:\n shapes (list[Shape]): The shapes to combine.\n\n Returns:\n Shape: A Shape which is the union of all the input shapes.\n "); -static PyMethodDef __pyx_mdef_10collisions_13ShapeCombiner_11shapelyUnion = {"shapelyUnion", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10collisions_13ShapeCombiner_11shapelyUnion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10collisions_13ShapeCombiner_10shapelyUnion}; -static PyObject *__pyx_pw_10collisions_13ShapeCombiner_11shapelyUnion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_shapes = 0; - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("shapelyUnion (wrapper)", 0); - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); +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 - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #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)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else #endif - __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "shapelyUnion", 0))) return NULL; - __Pyx_INCREF(__pyx_args); - __pyx_v_shapes = __pyx_args; - __pyx_r = __pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(__pyx_self, __pyx_v_shapes); - - /* function exit code */ - __Pyx_DECREF(__pyx_v_shapes); - __Pyx_RefNannyFinishContext(); - return __pyx_r; + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; } -static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shapes) { - 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; - unsigned int __pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("shapelyUnion", 1); - - /* "collisions.py":2910 - * Shape: A Shape which is the union of all the input shapes. - * """ - * return shapelyToColl(shapelyOps.unary_union(collToShapely(Shapes(*shapes)))) # <<<<<<<<<<<<<< - * - * # 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, 2910, __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, 2910, __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, 2910, __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, 2910, __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, 2910, __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, 2910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(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_9 = 1; +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_4_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_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 { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; - __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, 2910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_6 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_9 = 1; + #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 } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; - __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, 2910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; +} + +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_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; } - __pyx_t_5 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_9 = 1; - } + if (p->__pyx_v_i) { + e = (*v)(p->__pyx_v_i, a); if (e) return e; } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; - __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, 2910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "collisions.py":2897 - * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) - * - * @staticmethod # <<<<<<<<<<<<<< - * def shapelyUnion(*shapes: Shape) -> 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_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("collisions.ShapeCombiner.shapelyUnion", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; + 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}, + {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), + 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, +}; +#else + +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_4_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*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_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_4_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_4_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__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_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__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__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_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 @@ -96728,11 +103378,11 @@ 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_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__genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -96742,8 +103392,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct__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__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_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 { @@ -96758,9 +103408,9 @@ 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_5_genexpr(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; + 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; } @@ -96773,27 +103423,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct__genexpr(PyObject * 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_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__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_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__genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_5_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct__genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_5_genexpr = { 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_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__genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -96820,7 +103470,7 @@ 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*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_5_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -96838,7 +103488,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_5_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -96874,20 +103524,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct__genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_1_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_1_genexpr = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_6_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_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_1_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_1_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -96900,22 +103550,20 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_1_genexpr(PyTypeOb return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_1_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)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; #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_1_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_handleCollisionsPos) { 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); + Py_CLEAR(p->__pyx_v_oldPoint); #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)))) { - __pyx_freelist_10collisions___pyx_scope_struct_1_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)o); + 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); } else #endif { @@ -96930,42 +103578,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_1_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_6_handleCollisionsPos(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_1_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; + struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_6_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) { + PyObject* tmp; + struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_6_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_1_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_1_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_1_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_1_genexpr}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_1_genexpr_spec = { - "collisions.__pyx_scope_struct_1_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr), +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), 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_1_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_1_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_1_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_6_handleCollisionsPos", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_handleCollisionsPos, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -96992,8 +103644,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_1_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_1_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_6_handleCollisionsPos, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_6_handleCollisionsPos, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -97010,7 +103662,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_1_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_1_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_6_handleCollisionsPos, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -97046,20 +103698,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_1_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_2_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_2_genexpr = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_7_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_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_2_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_2_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -97072,22 +103724,20 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_2_genexpr(PyTypeOb return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_2_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *)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; #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_2_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_closestPointTo) { 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); + Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_2_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *)o); + 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); } else #endif { @@ -97102,42 +103752,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_2_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_7_closestPointTo(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_2_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; + struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_7_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) { + PyObject* tmp; + struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_7_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_2_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_2_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_2_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_2_genexpr}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_2_genexpr_spec = { - "collisions.__pyx_scope_struct_2_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr), +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), 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_2_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_2_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_2_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_7_closestPointTo", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_closestPointTo, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -97164,8 +103818,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_2_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_2_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_7_closestPointTo, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_7_closestPointTo, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -97182,7 +103836,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_2_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_2_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_7_closestPointTo, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -97218,20 +103872,20 @@ 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_8_isCorner *__pyx_freelist_10collisions___pyx_scope_struct_8_isCorner[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_8_isCorner = 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_8_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -97244,22 +103898,20 @@ 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_8_isCorner(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_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_3_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_isCorner) { 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); + Py_CLEAR(p->__pyx_v_precision); #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_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); } else #endif { @@ -97274,42 +103926,46 @@ 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_8_isCorner(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; + struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_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) { + PyObject* tmp; + struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_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_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_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}, {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_8_isCorner_spec = { + "collisions.__pyx_scope_struct_8_isCorner", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_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_3_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_8_isCorner_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_3_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_8_isCorner = { 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_8_isCorner", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_isCorner, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -97336,8 +103992,8 @@ 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*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_8_isCorner, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_8_isCorner, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -97354,7 +104010,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_8_isCorner, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -97390,20 +104046,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_9__contains *__pyx_freelist_10collisions___pyx_scope_struct_9__contains[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_9__contains = 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_9__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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -97416,22 +104072,20 @@ 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_9__contains(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9__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_4_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_9__contains) { 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); + Py_CLEAR(p->__pyx_v_self); #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_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); } else #endif { @@ -97446,42 +104100,46 @@ 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_9__contains(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; - 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; + struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9__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) { + PyObject* tmp; + struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9__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_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_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}, {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_9__contains_spec = { + "collisions.__pyx_scope_struct_9__contains", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9__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_4_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_9__contains_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_4_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_9__contains = { 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_9__contains", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9__contains), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_9__contains, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -97508,8 +104166,8 @@ 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*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_9__contains, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_9__contains, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -97526,7 +104184,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_9__contains, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -97562,20 +104220,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_10_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_10_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_10_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_10_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -97588,22 +104246,22 @@ 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_10_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10_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_10_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_s); - Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_v_p); #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_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); } else #endif { @@ -97618,42 +104276,42 @@ 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_10_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_10_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } 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; + if (p->__pyx_v_p) { + e = (*v)(p->__pyx_v_p, a); if (e) return e; } 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_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}, {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_10_genexpr_spec = { + "collisions.__pyx_scope_struct_10_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_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_10_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_5_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10_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_10_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -97680,7 +104338,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_10_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -97698,7 +104356,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_10_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -97734,20 +104392,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_11_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_11_closestPointTo[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_11_closestPointTo = 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_11_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -97760,20 +104418,20 @@ 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_11_closestPointTo(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11_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_6_handleCollisionsPos) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_closestPointTo) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_oldPoint); + Py_CLEAR(p->__pyx_v_self); #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_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); } else #endif { @@ -97788,46 +104446,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_11_closestPointTo(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; - if (p->__pyx_v_oldPoint) { - e = (*v)(p->__pyx_v_oldPoint, a); if (e) return e; + struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11_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_6_handleCollisionsPos(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_11_closestPointTo(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *)o; - tmp = ((PyObject*)p->__pyx_v_oldPoint); - p->__pyx_v_oldPoint = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11_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_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_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}, {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_11_closestPointTo_spec = { + "collisions.__pyx_scope_struct_11_closestPointTo", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_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_6_handleCollisionsPos_slots, + __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo = { 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_11_closestPointTo", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_handleCollisionsPos, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_closestPointTo, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -97854,8 +104512,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_11_closestPointTo, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_11_closestPointTo, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -97872,7 +104530,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_11_closestPointTo, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -97908,20 +104566,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_12_handleCollisionsPos *__pyx_freelist_10collisions___pyx_scope_struct_12_handleCollisionsPos[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_12_handleCollisionsPos = 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_12_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -97934,20 +104592,20 @@ 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_12_handleCollisionsPos(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_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_7_closestPointTo) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_handleCollisionsPos) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_self); + Py_CLEAR(p->__pyx_v_oldCir); #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_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); } else #endif { @@ -97962,46 +104620,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_12_handleCollisionsPos(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; - if (p->__pyx_v_self) { - e = (*v)(p->__pyx_v_self, a); if (e) return e; + struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *)o; + if (p->__pyx_v_oldCir) { + e = (*v)(p->__pyx_v_oldCir, 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_12_handleCollisionsPos(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *)o; - tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *)o; + tmp = ((PyObject*)p->__pyx_v_oldCir); + p->__pyx_v_oldCir = 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_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}, {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_12_handleCollisionsPos_spec = { + "collisions.__pyx_scope_struct_12_handleCollisionsPos", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_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_7_closestPointTo_slots, + __pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos = { 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_12_handleCollisionsPos", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_closestPointTo, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_handleCollisionsPos, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -98028,8 +104686,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_12_handleCollisionsPos, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_12_handleCollisionsPos, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -98046,7 +104704,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_12_handleCollisionsPos, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -98082,20 +104740,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_13__collides *__pyx_freelist_10collisions___pyx_scope_struct_13__collides[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_13__collides = 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_13__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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -98108,20 +104766,20 @@ 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_13__collides(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13__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_8_isCorner) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_13__collides) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_precision); + Py_CLEAR(p->__pyx_v_othershape); #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_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); } else #endif { @@ -98136,46 +104794,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_13__collides(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; - if (p->__pyx_v_precision) { - e = (*v)(p->__pyx_v_precision, a); if (e) return e; + struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13__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_8_isCorner(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_13__collides(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *)o; - tmp = ((PyObject*)p->__pyx_v_precision); - p->__pyx_v_precision = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13__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_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_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}, {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_13__collides_spec = { + "collisions.__pyx_scope_struct_13__collides", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13__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_8_isCorner_slots, + __pyx_type_10collisions___pyx_scope_struct_13__collides_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_8_isCorner = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13__collides = { 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_13__collides", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13__collides), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_isCorner, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_13__collides, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -98202,8 +104860,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_13__collides, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_13__collides, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -98220,7 +104878,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_13__collides, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -98256,20 +104914,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_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_9_closestPointTo[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_9_closestPointTo = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_9_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_14_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_9_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_9_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_9_closestPointTo]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -98282,20 +104940,22 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_9_closestPointTo(P return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_9_closestPointTo(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *)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; #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_closestPointTo) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_self); + Py_CLEAR(p->__pyx_outer_scope); + 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_9_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo)))) { - __pyx_freelist_10collisions___pyx_scope_struct_9_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_9_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *)o); + 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); } else #endif { @@ -98310,220 +104970,42 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_9_closestPointTo(Py } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_9_closestPointTo(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9_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_9_closestPointTo(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9_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_9_closestPointTo_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_9_closestPointTo}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_9_closestPointTo}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_9_closestPointTo}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_9_closestPointTo}, - {0, 0}, -}; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_9_closestPointTo_spec = { - "collisions.__pyx_scope_struct_9_closestPointTo", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_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_9_closestPointTo_slots, -}; -#else - -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_9_closestPointTo = { - PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_9_closestPointTo", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_closestPointTo), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_9_closestPointTo, /*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_9_closestPointTo, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_9_closestPointTo, /*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_9_closestPointTo, /*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_10_handleCollisionsPos *__pyx_freelist_10collisions___pyx_scope_struct_10_handleCollisionsPos[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_10_handleCollisionsPos = 0; -#endif - -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_10_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_10_handleCollisionsPos > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_10_handleCollisionsPos[--__pyx_freecount_10collisions___pyx_scope_struct_10_handleCollisionsPos]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos)); - (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_10_handleCollisionsPos(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10_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_10_handleCollisionsPos) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } + struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_oldCir); - #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_10_handleCollisionsPos < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos)))) { - __pyx_freelist_10collisions___pyx_scope_struct_10_handleCollisionsPos[__pyx_freecount_10collisions___pyx_scope_struct_10_handleCollisionsPos++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *)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 + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } -} - -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_10_handleCollisionsPos(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *)o; - if (p->__pyx_v_oldCir) { - e = (*v)(p->__pyx_v_oldCir, a); if (e) return e; + if (p->__pyx_v_i) { + e = (*v)(p->__pyx_v_i, a); if (e) return e; } return 0; } - -static int __pyx_tp_clear_10collisions___pyx_scope_struct_10_handleCollisionsPos(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos *)o; - tmp = ((PyObject*)p->__pyx_v_oldCir); - p->__pyx_v_oldCir = 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_10_handleCollisionsPos_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_10_handleCollisionsPos}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_10_handleCollisionsPos}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_10_handleCollisionsPos}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_10_handleCollisionsPos}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos_spec = { - "collisions.__pyx_scope_struct_10_handleCollisionsPos", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos), +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), 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_handleCollisionsPos_slots, + __pyx_type_10collisions___pyx_scope_struct_14_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_10_handleCollisionsPos", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_handleCollisionsPos), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_14_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_10_handleCollisionsPos, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -98550,8 +105032,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10_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_10_handleCollisionsPos, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_10_handleCollisionsPos, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_14_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -98568,7 +105050,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10_handleCollisio #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_10_handleCollisionsPos, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_14_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -98604,20 +105086,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10_handleCollisio #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *__pyx_freelist_10collisions___pyx_scope_struct_11__collides[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_11__collides = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_11__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_15_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__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11__collides)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_11__collides[--__pyx_freecount_10collisions___pyx_scope_struct_11__collides]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11__collides)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -98630,20 +105112,21 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_11__collides(PyTyp return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_11__collides(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *)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; #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__collides) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_closestPointTo) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_othershape); + Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_11__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11__collides)))) { - __pyx_freelist_10collisions___pyx_scope_struct_11__collides[__pyx_freecount_10collisions___pyx_scope_struct_11__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *)o); + 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); } else #endif { @@ -98658,46 +105141,52 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_11__collides(PyObje } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_11__collides(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_15_closestPointTo(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *)o; if (p->__pyx_v_othershape) { e = (*v)(p->__pyx_v_othershape, a); if (e) return e; } + 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__collides(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_15_closestPointTo(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *)o; tmp = ((PyObject*)p->__pyx_v_othershape); p->__pyx_v_othershape = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); + 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__collides_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_11__collides}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_11__collides}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_11__collides}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_11__collides}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_11__collides_spec = { - "collisions.__pyx_scope_struct_11__collides", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11__collides), +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), 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__collides_slots, + __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11__collides = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_11__collides", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11__collides), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_15_closestPointTo", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_11__collides, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_closestPointTo, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -98724,8 +105213,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11__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_11__collides, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_11__collides, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_15_closestPointTo, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_15_closestPointTo, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -98742,7 +105231,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11__collides = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_11__collides, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_15_closestPointTo, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -98778,20 +105267,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11__collides = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_12_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_12_genexpr = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_12_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_16_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_12_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_12_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_12_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -98804,22 +105293,20 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_12_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr *)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; #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_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_tangent) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_i); + Py_CLEAR(p->__pyx_v_point); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_12_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_12_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr *)o); + 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); } else #endif { @@ -98834,42 +105321,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_12_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_16_tangent(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; - } - 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; + struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16_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) { + PyObject* tmp; + struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16_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_12_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_12_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_12_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_12_genexpr}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_12_genexpr_spec = { - "collisions.__pyx_scope_struct_12_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr), +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), 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_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_16_tangent_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16_tangent = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_12_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_16_tangent", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_tangent, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -98896,8 +105387,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_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_12_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_16_tangent, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_16_tangent, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -98914,7 +105405,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_12_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_16_tangent, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -98950,20 +105441,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_13_closestPointTo[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_13_closestPointTo = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_13_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_17_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_13_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_13_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_13_closestPointTo]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -98976,11 +105467,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_13_closestPointTo( return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_13_closestPointTo(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *)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; #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_closestPointTo) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_closestPointTo) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -98989,8 +105480,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_13_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_13_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo)))) { - __pyx_freelist_10collisions___pyx_scope_struct_13_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_13_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *)o); + 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); } else #endif { @@ -99005,9 +105496,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_13_closestPointTo(P } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_13_closestPointTo(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_17_closestPointTo(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *)o; if (p->__pyx_v_othershape) { e = (*v)(p->__pyx_v_othershape, a); if (e) return e; } @@ -99017,9 +105508,9 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_13_closestPointTo(P return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_13_closestPointTo(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_17_closestPointTo(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *)o; tmp = ((PyObject*)p->__pyx_v_othershape); p->__pyx_v_othershape = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -99029,28 +105520,28 @@ static int __pyx_tp_clear_10collisions___pyx_scope_struct_13_closestPointTo(PyOb return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_13_closestPointTo_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_13_closestPointTo}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_13_closestPointTo}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_13_closestPointTo}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_13_closestPointTo}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_13_closestPointTo_spec = { - "collisions.__pyx_scope_struct_13_closestPointTo", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo), +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), 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_closestPointTo_slots, + __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13_closestPointTo = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_13_closestPointTo", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_closestPointTo), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_17_closestPointTo", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_13_closestPointTo, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_closestPointTo, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -99077,8 +105568,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13_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_13_closestPointTo, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_13_closestPointTo, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_17_closestPointTo, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_17_closestPointTo, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -99095,7 +105586,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13_closestPointTo #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_13_closestPointTo, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_17_closestPointTo, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -99131,20 +105622,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13_closestPointTo #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *__pyx_freelist_10collisions___pyx_scope_struct_14_tangent[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_14_tangent = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_14_tangent(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_18__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_14_tangent > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_14_tangent[--__pyx_freecount_10collisions___pyx_scope_struct_14_tangent]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -99157,20 +105648,20 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_14_tangent(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_tangent(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *)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; #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_tangent) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_18__contains) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_point); + Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_14_tangent < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent)))) { - __pyx_freelist_10collisions___pyx_scope_struct_14_tangent[__pyx_freecount_10collisions___pyx_scope_struct_14_tangent++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *)o); + 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); } else #endif { @@ -99185,46 +105676,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_tangent(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_14_tangent(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_18__contains(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *)o; - if (p->__pyx_v_point) { - e = (*v)(p->__pyx_v_point, a); if (e) return e; + struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18__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_14_tangent(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_18__contains(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent *)o; - tmp = ((PyObject*)p->__pyx_v_point); - p->__pyx_v_point = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18__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_14_tangent_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_14_tangent}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_14_tangent}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_14_tangent}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_14_tangent}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_14_tangent_spec = { - "collisions.__pyx_scope_struct_14_tangent", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent), +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), 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_tangent_slots, + __pyx_type_10collisions___pyx_scope_struct_18__contains_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14_tangent = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18__contains = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_14_tangent", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_tangent), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_18__contains", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18__contains), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_tangent, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_18__contains, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -99251,8 +105742,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14_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_14_tangent, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_14_tangent, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_18__contains, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_18__contains, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -99269,7 +105760,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14_tangent = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_14_tangent, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_18__contains, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -99305,20 +105796,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14_tangent = { #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_19_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_19_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_19_genexpr = 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_19_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -99331,21 +105822,22 @@ 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_19_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19_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_15_closestPointTo) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_19_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_othershape); - Py_CLEAR(p->__pyx_v_self); + Py_CLEAR(p->__pyx_outer_scope); + 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_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_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); } else #endif { @@ -99360,52 +105852,42 @@ 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_19_genexpr(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; - if (p->__pyx_v_othershape) { - e = (*v)(p->__pyx_v_othershape, a); if (e) return e; + struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *)o; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_self) { - e = (*v)(p->__pyx_v_self, a); if (e) return e; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_p) { + e = (*v)(p->__pyx_v_p, a); if (e) return e; } - return 0; -} - -static int __pyx_tp_clear_10collisions___pyx_scope_struct_15_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; - tmp = ((PyObject*)p->__pyx_v_othershape); - p->__pyx_v_othershape = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - 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_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_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}, {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_19_genexpr_spec = { + "collisions.__pyx_scope_struct_19_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19_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_15_closestPointTo_slots, + __pyx_type_10collisions___pyx_scope_struct_19_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19_genexpr = { 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_19_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_closestPointTo, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_19_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -99432,8 +105914,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_19_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -99450,7 +105932,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_19_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -99486,20 +105968,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__collides *__pyx_freelist_10collisions___pyx_scope_struct_16__collides[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_16__collides = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_16__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_20__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_16__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16__collides)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_16__collides[--__pyx_freecount_10collisions___pyx_scope_struct_16__collides]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16__collides)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -99512,11 +105994,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_16__collides(PyTyp return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_16__collides(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *)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; #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__collides) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_20__collides) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -99524,8 +106006,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_16__collides(PyObje PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_16__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16__collides)))) { - __pyx_freelist_10collisions___pyx_scope_struct_16__collides[__pyx_freecount_10collisions___pyx_scope_struct_16__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *)o); + 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); } else #endif { @@ -99540,46 +106022,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_16__collides(PyObje } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_16__collides(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_20__collides(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_20__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_16__collides(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_20__collides(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_20__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_16__collides_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_16__collides}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_16__collides}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_16__collides}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_16__collides}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_16__collides_spec = { - "collisions.__pyx_scope_struct_16__collides", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16__collides), +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), 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__collides_slots, + __pyx_type_10collisions___pyx_scope_struct_20__collides_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16__collides = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20__collides = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_16__collides", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16__collides), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_20__collides", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20__collides), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_16__collides, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_20__collides, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -99606,8 +106088,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16__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_16__collides, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_16__collides, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_20__collides, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_20__collides, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -99624,7 +106106,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16__collides = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_16__collides, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_20__collides, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -99660,20 +106142,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16__collides = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_17_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_17_genexpr = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_21_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_17_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_17_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_17_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -99686,11 +106168,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_17_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr *)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; #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_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_21_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -99700,8 +106182,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_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_17_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_17_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr *)o); + 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); } else #endif { @@ -99716,9 +106198,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_21_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -99731,27 +106213,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_17_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_17_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_17_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_17_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_17_genexpr}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_17_genexpr_spec = { - "collisions.__pyx_scope_struct_17_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr), +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), 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_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_21_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_17_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_21_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_21_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -99778,7 +106260,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_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_17_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_21_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -99796,7 +106278,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_17_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_21_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -99832,20 +106314,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *__pyx_freelist_10collisions___pyx_scope_struct_18_getCache[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_18_getCache = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_18_getCache(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_22_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_18_getCache > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_18_getCache[--__pyx_freecount_10collisions___pyx_scope_struct_18_getCache]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -99858,11 +106340,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_18_getCache(PyType return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_18_getCache(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *)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; #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_getCache) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_getCache) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -99871,8 +106353,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_18_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_18_getCache < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache)))) { - __pyx_freelist_10collisions___pyx_scope_struct_18_getCache[__pyx_freecount_10collisions___pyx_scope_struct_18_getCache++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *)o); + 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); } else #endif { @@ -99887,9 +106369,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_18_getCache(PyObjec } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_18_getCache(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_22_getCache(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *)o; if (p->__pyx_v_cos) { e = (*v)(p->__pyx_v_cos, a); if (e) return e; } @@ -99899,9 +106381,9 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_18_getCache(PyObjec return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_18_getCache(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_22_getCache(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *)o; tmp = ((PyObject*)p->__pyx_v_cos); p->__pyx_v_cos = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -99911,28 +106393,28 @@ static int __pyx_tp_clear_10collisions___pyx_scope_struct_18_getCache(PyObject * return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_18_getCache_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_18_getCache}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_18_getCache}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_18_getCache}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_18_getCache}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_18_getCache_spec = { - "collisions.__pyx_scope_struct_18_getCache", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache), +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), 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_getCache_slots, + __pyx_type_10collisions___pyx_scope_struct_22_getCache_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18_getCache = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_getCache = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_18_getCache", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_getCache), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_22_getCache", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_18_getCache, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_getCache, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -99959,8 +106441,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18_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_18_getCache, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_18_getCache, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_22_getCache, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_22_getCache, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -99977,7 +106459,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18_getCache = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_18_getCache, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_22_getCache, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -100013,20 +106495,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18_getCache = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *__pyx_freelist_10collisions___pyx_scope_struct_19__collides[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_19__collides = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_19__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_23__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_19__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__collides)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_19__collides[--__pyx_freecount_10collisions___pyx_scope_struct_19__collides]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__collides)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -100039,11 +106521,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_19__collides(PyTyp return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_19__collides(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *)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; #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__collides) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_23__collides) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -100051,8 +106533,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_19__collides(PyObje PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_19__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__collides)))) { - __pyx_freelist_10collisions___pyx_scope_struct_19__collides[__pyx_freecount_10collisions___pyx_scope_struct_19__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *)o); + 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); } else #endif { @@ -100067,46 +106549,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_19__collides(PyObje } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_19__collides(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_23__collides(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23__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_19__collides(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_23__collides(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23__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_19__collides_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_19__collides}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_19__collides}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_19__collides}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_19__collides}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_19__collides_spec = { - "collisions.__pyx_scope_struct_19__collides", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__collides), +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), 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__collides_slots, + __pyx_type_10collisions___pyx_scope_struct_23__collides_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19__collides = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23__collides = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_19__collides", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__collides), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_23__collides", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23__collides), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_19__collides, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_23__collides, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -100133,8 +106615,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19__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_19__collides, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_19__collides, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_23__collides, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_23__collides, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -100151,7 +106633,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19__collides = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_19__collides, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_23__collides, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -100187,20 +106669,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19__collides = { #endif #if CYTHON_USE_FREELISTS -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; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_24_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_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)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -100213,11 +106695,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_20_genexpr(PyTypeO return 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; +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; #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_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_24_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -100227,8 +106709,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_20_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_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); + 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); } else #endif { @@ -100243,9 +106725,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_20_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_24_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -100258,27 +106740,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_20_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -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}, +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}, {0, 0}, }; -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), +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), 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_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_24_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_20_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_24_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_20_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_24_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -100305,7 +106787,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20_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_20_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_24_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -100323,7 +106805,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_20_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_24_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -100359,20 +106841,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *__pyx_freelist_10collisions___pyx_scope_struct_21___setitem__[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_21___setitem__ = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_21___setitem__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_25___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_21___setitem__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_21___setitem__[--__pyx_freecount_10collisions___pyx_scope_struct_21___setitem__]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__)); + 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__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -100385,11 +106867,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_21___setitem__(PyT return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_21___setitem__(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *)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; #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___setitem__) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_25___setitem__) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -100397,8 +106879,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_21___setitem__(PyOb PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_21___setitem__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__)))) { - __pyx_freelist_10collisions___pyx_scope_struct_21___setitem__[__pyx_freecount_10collisions___pyx_scope_struct_21___setitem__++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *)o); + 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); } else #endif { @@ -100413,46 +106895,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_21___setitem__(PyOb } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_21___setitem__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_25___setitem__(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_25___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_21___setitem__(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_25___setitem__(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__ *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_25___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_21___setitem___slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_21___setitem__}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_21___setitem__}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_21___setitem__}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_21___setitem__}, +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__}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_21___setitem___spec = { - "collisions.__pyx_scope_struct_21___setitem__", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__), +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__), 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___setitem___slots, + __pyx_type_10collisions___pyx_scope_struct_25___setitem___slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21___setitem__ = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25___setitem__ = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_21___setitem__", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21___setitem__), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_25___setitem__", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_21___setitem__, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_25___setitem__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -100479,8 +106961,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21___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_21___setitem__, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_21___setitem__, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_25___setitem__, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_25___setitem__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -100497,7 +106979,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21___setitem__ = #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_21___setitem__, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_25___setitem__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -100533,20 +107015,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21___setitem__ = #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_22_area *__pyx_freelist_10collisions___pyx_scope_struct_22_area[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_22_area = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_22_area(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_26_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_22_area > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_area)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_22_area[--__pyx_freecount_10collisions___pyx_scope_struct_22_area]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_area)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -100559,11 +107041,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_22_area(PyTypeObje return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_area(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_22_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_area *)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; #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_area) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_area) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -100571,8 +107053,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_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_22_area < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_area)))) { - __pyx_freelist_10collisions___pyx_scope_struct_22_area[__pyx_freecount_10collisions___pyx_scope_struct_22_area++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_22_area *)o); + 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); } else #endif { @@ -100587,46 +107069,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_area(PyObject *o } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_22_area(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_26_area(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_22_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_area *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_26_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26_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_22_area(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_26_area(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_22_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_area *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_26_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26_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_22_area_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_22_area}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_22_area}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_22_area}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_22_area}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_22_area_spec = { - "collisions.__pyx_scope_struct_22_area", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_area), +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), 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_area_slots, + __pyx_type_10collisions___pyx_scope_struct_26_area_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_area = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26_area = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_22_area", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_area), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_26_area", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_area), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_area, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_area, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -100653,8 +107135,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_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_22_area, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_22_area, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_26_area, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_26_area, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -100671,7 +107153,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_area = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_22_area, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_26_area, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -100707,20 +107189,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_area = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_23_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_23_genexpr = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_23_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_27_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_23_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_23_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_23_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -100733,11 +107215,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_23_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_23_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr *)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; #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_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -100748,8 +107230,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_23_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_23_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_23_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_23_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr *)o); + 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); } else #endif { @@ -100764,9 +107246,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_23_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_23_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_27_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -100782,27 +107264,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_23_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_23_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_23_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_23_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_23_genexpr}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_23_genexpr_spec = { - "collisions.__pyx_scope_struct_23_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr), +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), 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_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_27_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_27_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_23_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_27_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_23_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -100829,7 +107311,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23_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_23_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_27_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -100847,7 +107329,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_23_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_27_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -100883,20 +107365,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23_genexpr = { #endif #if CYTHON_USE_FREELISTS -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; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_24__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_28__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_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)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -100909,11 +107391,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_24__collides(PyTyp return 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; +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; #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__collides) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_28__collides) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -100921,8 +107403,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_24__collides(PyObje PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - 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); + 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); } else #endif { @@ -100937,46 +107419,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_24__collides(PyObje } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_24__collides(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_28__collides(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_28__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_24__collides(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_28__collides(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_28__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_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}, +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}, {0, 0}, }; -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), +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), 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__collides_slots, + __pyx_type_10collisions___pyx_scope_struct_28__collides_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24__collides = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28__collides = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_24__collides", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24__collides), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_28__collides", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28__collides), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_24__collides, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_28__collides, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -101003,8 +107485,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24__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_24__collides, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_24__collides, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_28__collides, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_28__collides, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -101021,7 +107503,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24__collides = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_24__collides, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_28__collides, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -101057,20 +107539,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24__collides = { #endif #if CYTHON_USE_FREELISTS -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; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_29_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_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)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -101083,11 +107565,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_25_genexpr(PyTypeO return 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; +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; #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_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_29_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -101097,8 +107579,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_25_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_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); + 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); } else #endif { @@ -101113,9 +107595,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_25_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_25_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_29_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -101128,27 +107610,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_25_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -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}, +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}, {0, 0}, }; -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), +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), 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_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_29_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_29_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_25_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_29_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_25_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_29_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -101175,7 +107657,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25_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_25_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_29_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -101193,7 +107675,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_25_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_29_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -101229,20 +107711,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_26_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_26_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_26_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_26_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_26_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_26_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_26_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_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 @@ -101255,11 +107737,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_26_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_26_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26_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_26_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -101269,8 +107751,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_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_26_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_26_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_26_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_26_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 { @@ -101285,9 +107767,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_26_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_26_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26_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_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -101300,27 +107782,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_26_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_26_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_26_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_26_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_26_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_26_genexpr_spec = { - "collisions.__pyx_scope_struct_26_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_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_26_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_30_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_26_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_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_26_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -101347,7 +107829,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26_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_26_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_30_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -101365,7 +107847,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_26_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -101401,20 +107883,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26_genexpr = { #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_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_27_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_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_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 @@ -101427,11 +107909,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_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_27_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -101441,8 +107923,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_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 { @@ -101457,9 +107939,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_31_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_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; } @@ -101472,27 +107954,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_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_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_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_27_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_31_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_27_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_31_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_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_27_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -101519,7 +108001,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_31_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -101537,7 +108019,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_31_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -101573,20 +108055,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_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_28_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_28_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_28_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_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)); + 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 @@ -101599,11 +108081,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_28_genexpr(PyTypeO return 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; +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_28_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -101613,8 +108095,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_28_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_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); + 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 { @@ -101629,9 +108111,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_28_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_28_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_28_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_28_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; } @@ -101644,27 +108126,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_28_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -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}, +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_28_genexpr_spec = { - "collisions.__pyx_scope_struct_28_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28_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_28_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_32_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_32_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_28_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28_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_28_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -101691,7 +108173,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28_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_28_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_32_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -101709,7 +108191,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_28_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -101745,20 +108227,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28_genexpr = { #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_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_29_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_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_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 @@ -101771,11 +108253,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_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_29_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -101785,8 +108267,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_29_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_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_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 { @@ -101801,9 +108283,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_33_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_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; } @@ -101816,27 +108298,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_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_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_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_29_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_33_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_29_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_33_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_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_29_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -101863,7 +108345,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_33_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -101881,7 +108363,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_33_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -101917,20 +108399,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_union *__pyx_freelist_10collisions___pyx_scope_struct_30_union[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_30_union = 0; +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; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_30_union(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_34_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_30_union > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_union)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_30_union[--__pyx_freecount_10collisions___pyx_scope_struct_30_union]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_union)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -101943,22 +108425,22 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_30_union(PyTypeObj return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_union(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_30_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_30_union *)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; #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_union) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_union) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_9genexpr78__pyx_v_j); + Py_CLEAR(p->__pyx_9genexpr81__pyx_v_j); Py_CLEAR(p->__pyx_v_p1); Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_30_union < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_union)))) { - __pyx_freelist_10collisions___pyx_scope_struct_30_union[__pyx_freecount_10collisions___pyx_scope_struct_30_union++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_30_union *)o); + 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); } else #endif { @@ -101973,11 +108455,11 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_union(PyObject * } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_30_union(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_34_union(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_30_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_30_union *)o; - if (p->__pyx_9genexpr78__pyx_v_j) { - e = (*v)(p->__pyx_9genexpr78__pyx_v_j, a); if (e) return e; + struct __pyx_obj_10collisions___pyx_scope_struct_34_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_34_union *)o; + if (p->__pyx_9genexpr81__pyx_v_j) { + e = (*v)(p->__pyx_9genexpr81__pyx_v_j, a); if (e) return e; } if (p->__pyx_v_p1) { e = (*v)(p->__pyx_v_p1, a); if (e) return e; @@ -101988,11 +108470,11 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_30_union(PyObject * return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_30_union(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_34_union(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_30_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_30_union *)o; - tmp = ((PyObject*)p->__pyx_9genexpr78__pyx_v_j); - p->__pyx_9genexpr78__pyx_v_j = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_10collisions___pyx_scope_struct_34_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_34_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); tmp = ((PyObject*)p->__pyx_v_p1); p->__pyx_v_p1 = Py_None; Py_INCREF(Py_None); @@ -102003,28 +108485,28 @@ static int __pyx_tp_clear_10collisions___pyx_scope_struct_30_union(PyObject *o) return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_30_union_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_30_union}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_30_union}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_30_union}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_30_union}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_30_union_spec = { - "collisions.__pyx_scope_struct_30_union", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_union), +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), 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_union_slots, + __pyx_type_10collisions___pyx_scope_struct_34_union_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_union = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_34_union = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_30_union", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_union), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_34_union", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_union), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_union, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_union, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -102051,8 +108533,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_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_30_union, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_30_union, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_34_union, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_34_union, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -102069,7 +108551,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_union = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_30_union, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_34_union, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -102105,20 +108587,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_union = { #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_35_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_35_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_35_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_35_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -102131,11 +108613,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_35_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_35_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_35_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -102145,8 +108627,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_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_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_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); } else #endif { @@ -102161,9 +108643,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_35_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_35_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -102176,27 +108658,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_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}, {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_35_genexpr_spec = { + "collisions.__pyx_scope_struct_35_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_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_35_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_31_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_35_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_35_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_35_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -102223,7 +108705,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_35_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -102241,7 +108723,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_35_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -102304,7 +108786,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_A_rectangle_That_is_rotated_It_i, __pyx_k_A_rectangle_That_is_rotated_It_i, sizeof(__pyx_k_A_rectangle_That_is_rotated_It_i), 0, 0, 1, 0}, {&__pyx_kp_s_A_section_of_a_circle_s_circumfr, __pyx_k_A_section_of_a_circle_s_circumfr, sizeof(__pyx_k_A_section_of_a_circle_s_circumfr), 0, 0, 1, 0}, {&__pyx_kp_s_An_enum_representing_the_differ, __pyx_k_An_enum_representing_the_differ, sizeof(__pyx_k_An_enum_representing_the_differ), 0, 0, 1, 0}, - {&__pyx_kp_s_An_infintesimally_small_point_in, __pyx_k_An_infintesimally_small_point_in, sizeof(__pyx_k_An_infintesimally_small_point_in), 0, 0, 1, 0}, + {&__pyx_kp_s_An_enum_representing_the_differ_2, __pyx_k_An_enum_representing_the_differ_2, sizeof(__pyx_k_An_enum_representing_the_differ_2), 0, 0, 1, 0}, {&__pyx_n_s_Any, __pyx_k_Any, sizeof(__pyx_k_Any), 0, 0, 1, 1}, {&__pyx_n_s_Arc, __pyx_k_Arc, sizeof(__pyx_k_Arc), 0, 0, 1, 1}, {&__pyx_n_u_Arc, __pyx_k_Arc, sizeof(__pyx_k_Arc), 0, 1, 0, 1}, @@ -102317,6 +108799,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Arc___str, __pyx_k_Arc___str, sizeof(__pyx_k_Arc___str), 0, 0, 1, 1}, {&__pyx_n_s_Arc__collides, __pyx_k_Arc__collides, sizeof(__pyx_k_Arc__collides), 0, 0, 1, 1}, {&__pyx_n_s_Arc__collides_locals_genexpr, __pyx_k_Arc__collides_locals_genexpr, sizeof(__pyx_k_Arc__collides_locals_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_Arc__contains, __pyx_k_Arc__contains, sizeof(__pyx_k_Arc__contains), 0, 0, 1, 1}, {&__pyx_n_s_Arc__where, __pyx_k_Arc__where, sizeof(__pyx_k_Arc__where), 0, 0, 1, 1}, {&__pyx_n_s_Arc_angleInRange, __pyx_k_Arc_angleInRange, sizeof(__pyx_k_Arc_angleInRange), 0, 0, 1, 1}, {&__pyx_n_s_Arc_area, __pyx_k_Arc_area, sizeof(__pyx_k_Arc_area), 0, 0, 1, 1}, @@ -102328,7 +108811,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Arc_copy, __pyx_k_Arc_copy, sizeof(__pyx_k_Arc_copy), 0, 0, 1, 1}, {&__pyx_n_s_Arc_endPoints, __pyx_k_Arc_endPoints, sizeof(__pyx_k_Arc_endPoints), 0, 0, 1, 1}, {&__pyx_n_s_Arc_flip, __pyx_k_Arc_flip, sizeof(__pyx_k_Arc_flip), 0, 0, 1, 1}, + {&__pyx_n_s_Arc_isCorner, __pyx_k_Arc_isCorner, sizeof(__pyx_k_Arc_isCorner), 0, 0, 1, 1}, {&__pyx_n_s_Arc_rect, __pyx_k_Arc_rect, sizeof(__pyx_k_Arc_rect), 0, 0, 1, 1}, + {&__pyx_n_s_Arc_toPoints, __pyx_k_Arc_toPoints, sizeof(__pyx_k_Arc_toPoints), 0, 0, 1, 1}, {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, {&__pyx_n_s_BASEBOUNCINESS, __pyx_k_BASEBOUNCINESS, sizeof(__pyx_k_BASEBOUNCINESS), 0, 0, 1, 1}, {&__pyx_n_s_BASEPRECISION, __pyx_k_BASEPRECISION, sizeof(__pyx_k_BASEPRECISION), 0, 0, 1, 1}, @@ -102348,6 +108833,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Circle___setitem, __pyx_k_Circle___setitem, sizeof(__pyx_k_Circle___setitem), 0, 0, 1, 1}, {&__pyx_n_s_Circle___str, __pyx_k_Circle___str, sizeof(__pyx_k_Circle___str), 0, 0, 1, 1}, {&__pyx_n_s_Circle__collides, __pyx_k_Circle__collides, sizeof(__pyx_k_Circle__collides), 0, 0, 1, 1}, + {&__pyx_n_s_Circle__contains, __pyx_k_Circle__contains, sizeof(__pyx_k_Circle__contains), 0, 0, 1, 1}, + {&__pyx_n_s_Circle__contains_locals_genexpr, __pyx_k_Circle__contains_locals_genexpr, sizeof(__pyx_k_Circle__contains_locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_Circle__where, __pyx_k_Circle__where, sizeof(__pyx_k_Circle__where), 0, 0, 1, 1}, {&__pyx_n_s_Circle__where_locals_sign, __pyx_k_Circle__where_locals_sign, sizeof(__pyx_k_Circle__where_locals_sign), 0, 0, 1, 1}, {&__pyx_n_s_Circle_area, __pyx_k_Circle_area, sizeof(__pyx_k_Circle_area), 0, 0, 1, 1}, @@ -102366,6 +108853,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_ClosedShape___getitem, __pyx_k_ClosedShape___getitem, sizeof(__pyx_k_ClosedShape___getitem), 0, 0, 1, 1}, {&__pyx_n_s_ClosedShape___iter, __pyx_k_ClosedShape___iter, sizeof(__pyx_k_ClosedShape___iter), 0, 0, 1, 1}, {&__pyx_n_s_ClosedShape___str, __pyx_k_ClosedShape___str, sizeof(__pyx_k_ClosedShape___str), 0, 0, 1, 1}, + {&__pyx_n_s_ClosedShape__contains, __pyx_k_ClosedShape__contains, sizeof(__pyx_k_ClosedShape__contains), 0, 0, 1, 1}, + {&__pyx_n_s_ClosedShape__containsPoint, __pyx_k_ClosedShape__containsPoint, sizeof(__pyx_k_ClosedShape__containsPoint), 0, 0, 1, 1}, + {&__pyx_n_s_ClosedShape__contains_locals_gen, __pyx_k_ClosedShape__contains_locals_gen, sizeof(__pyx_k_ClosedShape__contains_locals_gen), 0, 0, 1, 1}, {&__pyx_n_s_ClosedShape__where, __pyx_k_ClosedShape__where, sizeof(__pyx_k_ClosedShape__where), 0, 0, 1, 1}, {&__pyx_n_s_ClosedShape_closestPointTo, __pyx_k_ClosedShape_closestPointTo, sizeof(__pyx_k_ClosedShape_closestPointTo), 0, 0, 1, 1}, {&__pyx_n_s_ClosedShape_closestPointTo_local, __pyx_k_ClosedShape_closestPointTo_local, sizeof(__pyx_k_ClosedShape_closestPointTo_local), 0, 0, 1, 1}, @@ -102386,12 +108876,13 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__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}, - {&__pyx_n_s_Enum, __pyx_k_Enum, sizeof(__pyx_k_Enum), 0, 0, 1, 1}, {&__pyx_n_s_GROUP, __pyx_k_GROUP, sizeof(__pyx_k_GROUP), 0, 0, 1, 1}, {&__pyx_n_s_GROUPS, __pyx_k_GROUPS, sizeof(__pyx_k_GROUPS), 0, 0, 1, 1}, {&__pyx_n_s_GeometryCollection, __pyx_k_GeometryCollection, sizeof(__pyx_k_GeometryCollection), 0, 0, 1, 1}, + {&__pyx_n_s_Group, __pyx_k_Group, sizeof(__pyx_k_Group), 0, 0, 1, 1}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_n_s_IntEnum, __pyx_k_IntEnum, sizeof(__pyx_k_IntEnum), 0, 0, 1, 1}, {&__pyx_n_s_Iterable, __pyx_k_Iterable, sizeof(__pyx_k_Iterable), 0, 0, 1, 1}, {&__pyx_kp_s_Iterable_Line, __pyx_k_Iterable_Line, sizeof(__pyx_k_Iterable_Line), 0, 0, 1, 0}, {&__pyx_kp_s_Iterable_Line_2, __pyx_k_Iterable_Line_2, sizeof(__pyx_k_Iterable_Line_2), 0, 0, 1, 0}, @@ -102411,6 +108902,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Line___str, __pyx_k_Line___str, sizeof(__pyx_k_Line___str), 0, 0, 1, 1}, {&__pyx_n_s_Line__collides, __pyx_k_Line__collides, sizeof(__pyx_k_Line__collides), 0, 0, 1, 1}, {&__pyx_n_s_Line__collides_locals_direction, __pyx_k_Line__collides_locals_direction, sizeof(__pyx_k_Line__collides_locals_direction), 0, 0, 1, 1}, + {&__pyx_n_s_Line__contains, __pyx_k_Line__contains, sizeof(__pyx_k_Line__contains), 0, 0, 1, 1}, {&__pyx_n_s_Line__onSegment, __pyx_k_Line__onSegment, sizeof(__pyx_k_Line__onSegment), 0, 0, 1, 1}, {&__pyx_n_s_Line__where, __pyx_k_Line__where, sizeof(__pyx_k_Line__where), 0, 0, 1, 1}, {&__pyx_n_s_Line__where_locals_line, __pyx_k_Line__where_locals_line, sizeof(__pyx_k_Line__where_locals_line), 0, 0, 1, 1}, @@ -102440,6 +108932,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_MultiPoint, __pyx_k_MultiPoint, sizeof(__pyx_k_MultiPoint), 0, 0, 1, 1}, {&__pyx_n_s_MultiPolygon, __pyx_k_MultiPolygon, sizeof(__pyx_k_MultiPolygon), 0, 0, 1, 1}, {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_n_s_NOTSTRAIGHT, __pyx_k_NOTSTRAIGHT, sizeof(__pyx_k_NOTSTRAIGHT), 0, 0, 1, 1}, {&__pyx_n_s_NoShape, __pyx_k_NoShape, sizeof(__pyx_k_NoShape), 0, 0, 1, 1}, {&__pyx_n_u_NoShape, __pyx_k_NoShape, sizeof(__pyx_k_NoShape), 0, 1, 0, 1}, {&__pyx_kp_u_NoShape_2, __pyx_k_NoShape_2, sizeof(__pyx_k_NoShape_2), 0, 1, 0, 0}, @@ -102447,6 +108940,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_NoShape___init, __pyx_k_NoShape___init, sizeof(__pyx_k_NoShape___init), 0, 0, 1, 1}, {&__pyx_n_s_NoShape___str, __pyx_k_NoShape___str, sizeof(__pyx_k_NoShape___str), 0, 0, 1, 1}, {&__pyx_n_s_NoShape__collides, __pyx_k_NoShape__collides, sizeof(__pyx_k_NoShape__collides), 0, 0, 1, 1}, + {&__pyx_n_s_NoShape__contains, __pyx_k_NoShape__contains, sizeof(__pyx_k_NoShape__contains), 0, 0, 1, 1}, {&__pyx_n_s_NoShape__where, __pyx_k_NoShape__where, sizeof(__pyx_k_NoShape__where), 0, 0, 1, 1}, {&__pyx_n_s_NoShape_area, __pyx_k_NoShape_area, sizeof(__pyx_k_NoShape_area), 0, 0, 1, 1}, {&__pyx_n_s_NoShape_copy, __pyx_k_NoShape_copy, sizeof(__pyx_k_NoShape_copy), 0, 0, 1, 1}, @@ -102462,6 +108956,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Point___setitem, __pyx_k_Point___setitem, sizeof(__pyx_k_Point___setitem), 0, 0, 1, 1}, {&__pyx_n_s_Point___str, __pyx_k_Point___str, sizeof(__pyx_k_Point___str), 0, 0, 1, 1}, {&__pyx_n_s_Point__collides, __pyx_k_Point__collides, sizeof(__pyx_k_Point__collides), 0, 0, 1, 1}, + {&__pyx_n_s_Point__contains, __pyx_k_Point__contains, sizeof(__pyx_k_Point__contains), 0, 0, 1, 1}, {&__pyx_n_s_Point__where, __pyx_k_Point__where, sizeof(__pyx_k_Point__where), 0, 0, 1, 1}, {&__pyx_n_s_Point_area, __pyx_k_Point_area, sizeof(__pyx_k_Point_area), 0, 0, 1, 1}, {&__pyx_n_s_Point_closestPointTo, __pyx_k_Point_closestPointTo, sizeof(__pyx_k_Point_closestPointTo), 0, 0, 1, 1}, @@ -102499,11 +108994,13 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Rect___str, __pyx_k_Rect___str, sizeof(__pyx_k_Rect___str), 0, 0, 1, 1}, {&__pyx_n_s_Rect__collides, __pyx_k_Rect__collides, sizeof(__pyx_k_Rect__collides), 0, 0, 1, 1}, {&__pyx_n_s_Rect__collides_locals_genexpr, __pyx_k_Rect__collides_locals_genexpr, sizeof(__pyx_k_Rect__collides_locals_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_Rect__containsPoint, __pyx_k_Rect__containsPoint, sizeof(__pyx_k_Rect__containsPoint), 0, 0, 1, 1}, {&__pyx_n_s_Rect_area, __pyx_k_Rect_area, sizeof(__pyx_k_Rect_area), 0, 0, 1, 1}, {&__pyx_n_s_Rect_copy, __pyx_k_Rect_copy, sizeof(__pyx_k_Rect_copy), 0, 0, 1, 1}, {&__pyx_n_s_Rect_rect, __pyx_k_Rect_rect, sizeof(__pyx_k_Rect_rect), 0, 0, 1, 1}, {&__pyx_n_s_Rect_toLines, __pyx_k_Rect_toLines, sizeof(__pyx_k_Rect_toLines), 0, 0, 1, 1}, {&__pyx_n_s_Rect_toPoints, __pyx_k_Rect_toPoints, sizeof(__pyx_k_Rect_toPoints), 0, 0, 1, 1}, + {&__pyx_n_s_RotRect, __pyx_k_RotRect, sizeof(__pyx_k_RotRect), 0, 0, 1, 1}, {&__pyx_n_s_RotatedRect, __pyx_k_RotatedRect, sizeof(__pyx_k_RotatedRect), 0, 0, 1, 1}, {&__pyx_n_u_RotatedRect, __pyx_k_RotatedRect, sizeof(__pyx_k_RotatedRect), 0, 1, 0, 1}, {&__pyx_kp_u_RotatedRect_2, __pyx_k_RotatedRect_2, sizeof(__pyx_k_RotatedRect_2), 0, 1, 0, 0}, @@ -102514,6 +109011,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_RotatedRect___str, __pyx_k_RotatedRect___str, sizeof(__pyx_k_RotatedRect___str), 0, 0, 1, 1}, {&__pyx_n_s_RotatedRect__collides, __pyx_k_RotatedRect__collides, sizeof(__pyx_k_RotatedRect__collides), 0, 0, 1, 1}, {&__pyx_n_s_RotatedRect__collides_locals_gen, __pyx_k_RotatedRect__collides_locals_gen, sizeof(__pyx_k_RotatedRect__collides_locals_gen), 0, 0, 1, 1}, + {&__pyx_n_s_RotatedRect__containsPoint, __pyx_k_RotatedRect__containsPoint, sizeof(__pyx_k_RotatedRect__containsPoint), 0, 0, 1, 1}, {&__pyx_n_s_RotatedRect_area, __pyx_k_RotatedRect_area, sizeof(__pyx_k_RotatedRect_area), 0, 0, 1, 1}, {&__pyx_n_s_RotatedRect_copy, __pyx_k_RotatedRect_copy, sizeof(__pyx_k_RotatedRect_copy), 0, 0, 1, 1}, {&__pyx_n_s_RotatedRect_getCache, __pyx_k_RotatedRect_getCache, sizeof(__pyx_k_RotatedRect_getCache), 0, 0, 1, 1}, @@ -102546,6 +109044,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Shape___setitem, __pyx_k_Shape___setitem, sizeof(__pyx_k_Shape___setitem), 0, 0, 1, 1}, {&__pyx_n_s_Shape___str, __pyx_k_Shape___str, sizeof(__pyx_k_Shape___str), 0, 0, 1, 1}, {&__pyx_n_s_Shape__collides, __pyx_k_Shape__collides, sizeof(__pyx_k_Shape__collides), 0, 0, 1, 1}, + {&__pyx_n_s_Shape__contains, __pyx_k_Shape__contains, sizeof(__pyx_k_Shape__contains), 0, 0, 1, 1}, {&__pyx_n_s_Shape__where, __pyx_k_Shape__where, sizeof(__pyx_k_Shape__where), 0, 0, 1, 1}, {&__pyx_n_s_Shape_area, __pyx_k_Shape_area, sizeof(__pyx_k_Shape_area), 0, 0, 1, 1}, {&__pyx_n_s_Shape_check_rects, __pyx_k_Shape_check_rects, sizeof(__pyx_k_Shape_check_rects), 0, 0, 1, 1}, @@ -102555,6 +109054,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Shape_distance_to, __pyx_k_Shape_distance_to, sizeof(__pyx_k_Shape_distance_to), 0, 0, 1, 1}, {&__pyx_n_s_Shape_handleCollisionsPos, __pyx_k_Shape_handleCollisionsPos, sizeof(__pyx_k_Shape_handleCollisionsPos), 0, 0, 1, 1}, {&__pyx_n_s_Shape_handleCollisionsVel, __pyx_k_Shape_handleCollisionsVel, sizeof(__pyx_k_Shape_handleCollisionsVel), 0, 0, 1, 1}, + {&__pyx_n_s_Shape_isContaining, __pyx_k_Shape_isContaining, sizeof(__pyx_k_Shape_isContaining), 0, 0, 1, 1}, {&__pyx_n_s_Shape_isCorner, __pyx_k_Shape_isCorner, sizeof(__pyx_k_Shape_isCorner), 0, 0, 1, 1}, {&__pyx_n_s_Shape_rect, __pyx_k_Shape_rect, sizeof(__pyx_k_Shape_rect), 0, 0, 1, 1}, {&__pyx_n_s_Shape_tangent, __pyx_k_Shape_tangent, sizeof(__pyx_k_Shape_tangent), 0, 0, 1, 1}, @@ -102567,6 +109067,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Shapes___getitem, __pyx_k_Shapes___getitem, sizeof(__pyx_k_Shapes___getitem), 0, 0, 1, 1}, {&__pyx_n_s_Shapes___init, __pyx_k_Shapes___init, sizeof(__pyx_k_Shapes___init), 0, 0, 1, 1}, {&__pyx_n_s_Shapes___iter, __pyx_k_Shapes___iter, sizeof(__pyx_k_Shapes___iter), 0, 0, 1, 1}, + {&__pyx_n_s_Shapes___len, __pyx_k_Shapes___len, sizeof(__pyx_k_Shapes___len), 0, 0, 1, 1}, {&__pyx_n_s_Shapes___repr, __pyx_k_Shapes___repr, sizeof(__pyx_k_Shapes___repr), 0, 0, 1, 1}, {&__pyx_n_s_Shapes___setitem, __pyx_k_Shapes___setitem, sizeof(__pyx_k_Shapes___setitem), 0, 0, 1, 1}, {&__pyx_n_s_Shapes___str, __pyx_k_Shapes___str, sizeof(__pyx_k_Shapes___str), 0, 0, 1, 1}, @@ -102579,6 +109080,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__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}, {&__pyx_n_s_Shapes_copy_locals_genexpr, __pyx_k_Shapes_copy_locals_genexpr, sizeof(__pyx_k_Shapes_copy_locals_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_Shapes_isContaining, __pyx_k_Shapes_isContaining, sizeof(__pyx_k_Shapes_isContaining), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_isCorner, __pyx_k_Shapes_isCorner, sizeof(__pyx_k_Shapes_isCorner), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_rect, __pyx_k_Shapes_rect, sizeof(__pyx_k_Shapes_rect), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_rect_locals_genexpr, __pyx_k_Shapes_rect_locals_genexpr, sizeof(__pyx_k_Shapes_rect_locals_genexpr), 0, 0, 1, 1}, @@ -102586,13 +109088,16 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__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_whereCollides, __pyx_k_Shapes_whereCollides, sizeof(__pyx_k_Shapes_whereCollides), 0, 0, 1, 1}, - {&__pyx_kp_u_Shapes_with, __pyx_k_Shapes_with, sizeof(__pyx_k_Shapes_with), 0, 1, 0, 0}, + {&__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}, {&__pyx_n_u_ShpGroups, __pyx_k_ShpGroups, sizeof(__pyx_k_ShpGroups), 0, 1, 0, 1}, + {&__pyx_n_s_ShpTyps, __pyx_k_ShpTyps, sizeof(__pyx_k_ShpTyps), 0, 0, 1, 1}, + {&__pyx_n_u_ShpTyps, __pyx_k_ShpTyps, sizeof(__pyx_k_ShpTyps), 0, 1, 0, 1}, + {&__pyx_n_s_TYPE, __pyx_k_TYPE, sizeof(__pyx_k_TYPE), 0, 0, 1, 1}, + {&__pyx_n_s_TYPE_MATCHES, __pyx_k_TYPE_MATCHES, sizeof(__pyx_k_TYPE_MATCHES), 0, 0, 1, 1}, {&__pyx_kp_s_The_base_Shape_class_This_defaul, __pyx_k_The_base_Shape_class_This_defaul, sizeof(__pyx_k_The_base_Shape_class_This_defaul), 0, 0, 1, 0}, {&__pyx_kp_s_These_are_shapes_like_rects_and, __pyx_k_These_are_shapes_like_rects_and, sizeof(__pyx_k_These_are_shapes_like_rects_and), 0, 0, 1, 0}, {&__pyx_n_s_ThisClosestP, __pyx_k_ThisClosestP, sizeof(__pyx_k_ThisClosestP), 0, 0, 1, 1}, - {&__pyx_n_s_Type, __pyx_k_Type, sizeof(__pyx_k_Type), 0, 0, 1, 1}, {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, {&__pyx_kp_s_Union_Number_pointLike, __pyx_k_Union_Number_pointLike, sizeof(__pyx_k_Union_Number_pointLike), 0, 0, 1, 0}, {&__pyx_kp_s_Union_Point_pointLike, __pyx_k_Union_Point_pointLike, sizeof(__pyx_k_Union_Point_pointLike), 0, 0, 1, 0}, @@ -102603,19 +109108,21 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2, __pyx_k_Union_Shape_Shapes_Iterable_Shap_2, sizeof(__pyx_k_Union_Shape_Shapes_Iterable_Shap_2), 0, 0, 1, 0}, {&__pyx_kp_s_Union_Shapes_Iterable_Shape, __pyx_k_Union_Shapes_Iterable_Shape, sizeof(__pyx_k_Union_Shapes_Iterable_Shape), 0, 0, 1, 0}, {&__pyx_kp_s_Union_Shapes_Iterable_Shape_2, __pyx_k_Union_Shapes_Iterable_Shape_2, sizeof(__pyx_k_Union_Shapes_Iterable_Shape_2), 0, 0, 1, 0}, - {&__pyx_kp_s_Union_Type_ShpGroups_Iterable_Un, __pyx_k_Union_Type_ShpGroups_Iterable_Un, sizeof(__pyx_k_Union_Type_ShpGroups_Iterable_Un), 0, 0, 1, 0}, + {&__pyx_kp_s_Union_ShpTyps_ShpGroups, __pyx_k_Union_ShpTyps_ShpGroups, sizeof(__pyx_k_Union_ShpTyps_ShpGroups), 0, 0, 1, 0}, {&__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__138, __pyx_k__138, sizeof(__pyx_k__138), 0, 0, 1, 1}, - {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, - {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0}, - {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0}, - {&__pyx_n_s__299, __pyx_k__299, sizeof(__pyx_k__299), 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__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 1}, - {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 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_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_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}, @@ -102658,6 +109165,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_checked, __pyx_k_checked, sizeof(__pyx_k_checked), 0, 0, 1, 1}, {&__pyx_n_s_cirO, __pyx_k_cirO, sizeof(__pyx_k_cirO), 0, 0, 1, 1}, {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, @@ -102678,6 +109186,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_combineRects, __pyx_k_combineRects, sizeof(__pyx_k_combineRects), 0, 0, 1, 1}, {&__pyx_n_s_concave_hull, __pyx_k_concave_hull, sizeof(__pyx_k_concave_hull), 0, 0, 1, 1}, {&__pyx_n_s_constrainAng, __pyx_k_constrainAng, sizeof(__pyx_k_constrainAng), 0, 0, 1, 1}, + {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, + {&__pyx_n_s_containsPoint, __pyx_k_containsPoint, sizeof(__pyx_k_containsPoint), 0, 0, 1, 1}, {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_copy_leave_shapes, __pyx_k_copy_leave_shapes, sizeof(__pyx_k_copy_leave_shapes), 0, 0, 1, 1}, @@ -102750,7 +109260,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, {&__pyx_n_s_intermediateObj, __pyx_k_intermediateObj, sizeof(__pyx_k_intermediateObj), 0, 0, 1, 1}, + {&__pyx_n_s_intersection, __pyx_k_intersection, sizeof(__pyx_k_intersection), 0, 0, 1, 1}, {&__pyx_n_s_intersections, __pyx_k_intersections, sizeof(__pyx_k_intersections), 0, 0, 1, 1}, + {&__pyx_n_s_isContaining, __pyx_k_isContaining, sizeof(__pyx_k_isContaining), 0, 0, 1, 1}, {&__pyx_n_s_isCorner, __pyx_k_isCorner, sizeof(__pyx_k_isCorner), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_is_empty, __pyx_k_is_empty, sizeof(__pyx_k_is_empty), 0, 0, 1, 1}, @@ -102763,6 +109275,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, {&__pyx_n_s_li, __pyx_k_li, sizeof(__pyx_k_li), 0, 0, 1, 1}, {&__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}, @@ -102793,6 +109306,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_newPoint, __pyx_k_newPoint, sizeof(__pyx_k_newPoint), 0, 0, 1, 1}, {&__pyx_n_s_newShp, __pyx_k_newShp, sizeof(__pyx_k_newShp), 0, 0, 1, 1}, {&__pyx_n_s_newobj, __pyx_k_newobj, sizeof(__pyx_k_newobj), 0, 0, 1, 1}, + {&__pyx_n_s_newp, __pyx_k_newp, sizeof(__pyx_k_newp), 0, 0, 1, 1}, {&__pyx_n_s_newp1, __pyx_k_newp1, sizeof(__pyx_k_newp1), 0, 0, 1, 1}, {&__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}, @@ -102908,7 +109422,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_shapely_geometry, __pyx_k_shapely_geometry, sizeof(__pyx_k_shapely_geometry), 0, 0, 1, 1}, {&__pyx_n_s_shapely_ops, __pyx_k_shapely_ops, sizeof(__pyx_k_shapely_ops), 0, 0, 1, 1}, {&__pyx_n_s_shapes, __pyx_k_shapes, sizeof(__pyx_k_shapes), 0, 0, 1, 1}, - {&__pyx_kp_u_shapes_2, __pyx_k_shapes_2, sizeof(__pyx_k_shapes_2), 0, 1, 0, 0}, + {&__pyx_n_s_shpTyps, __pyx_k_shpTyps, sizeof(__pyx_k_shpTyps), 0, 0, 1, 1}, {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, {&__pyx_n_s_sin, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1}, {&__pyx_n_s_slns, __pyx_k_slns, sizeof(__pyx_k_slns), 0, 0, 1, 1}, @@ -102954,6 +109468,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_tuple_Shape_pointLike_verboseOut, __pyx_k_tuple_Shape_pointLike_verboseOut, sizeof(__pyx_k_tuple_Shape_pointLike_verboseOut), 0, 0, 1, 0}, {&__pyx_kp_s_tuple_int_int_int, __pyx_k_tuple_int_int_int, sizeof(__pyx_k_tuple_int_int_int), 0, 0, 1, 0}, {&__pyx_kp_s_tuple_pointLike_pointLike_verbos, __pyx_k_tuple_pointLike_pointLike_verbos, sizeof(__pyx_k_tuple_pointLike_pointLike_verbos), 0, 0, 1, 0}, + {&__pyx_n_s_typ_set, __pyx_k_typ_set, sizeof(__pyx_k_typ_set), 0, 0, 1, 1}, {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, {&__pyx_n_s_typs, __pyx_k_typs, sizeof(__pyx_k_typs), 0, 0, 1, 1}, {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, @@ -103011,19 +109526,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, 875, __pyx_L1_error) - __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 897, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 168, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 173, __pyx_L1_error) - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 437, __pyx_L1_error) - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 612, __pyx_L1_error) - __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 622, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 622, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 762, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 833, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 1072, __pyx_L1_error) - __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 1132, __pyx_L1_error) - __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_n_s_any); if (!__pyx_builtin_any) __PYX_ERR(0, 2339, __pyx_L1_error) + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 961, __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, 473, __pyx_L1_error) + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 667, __pyx_L1_error) + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 677, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 677, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 825, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 1139, __pyx_L1_error) + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 1199, __pyx_L1_error) + __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_n_s_any); if (!__pyx_builtin_any) __PYX_ERR(0, 2482, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -103034,195 +109549,195 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "collisions.py":50 + /* "collisions.py":51 * def checkForPygame(): * if pygame is None: * raise ImportError( # <<<<<<<<<<<<<< * 'Pygame is not installed, so you cannot use this function without it!' * ) */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Pygame_is_not_installed_so_you_c); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Pygame_is_not_installed_so_you_c); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "collisions.py":339 + /* "collisions.py":375 * """ * 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, 339, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "collisions.py":942 + /* "collisions.py":1009 * 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__5 = 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__5)) __PYX_ERR(0, 942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_direction, 942, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 942, __pyx_L1_error) + __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, 1009, __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, 1009, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 1009, __pyx_L1_error) - /* "collisions.py":969 + /* "collisions.py":1036 * 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__7 = 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__7)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_line, 969, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 969, __pyx_L1_error) + __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, 1036, __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, 1036, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 1036, __pyx_L1_error) - /* "collisions.py":1014 + /* "collisions.py":1081 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< * p2 = ln.closestPointTo(Point(*point)) * olineP = point */ - __pyx_tuple__9 = 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__9)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 1014, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 1014, __pyx_L1_error) + __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, 1081, __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, 1081, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 1081, __pyx_L1_error) - /* "collisions.py":1041 + /* "collisions.py":1108 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< * p2 = ln.closestPointTo(Point(*point)) * olineP = point */ - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 1041, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 1041, __pyx_L1_error) + __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, 1108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 1108, __pyx_L1_error) - /* "collisions.py":1071 + /* "collisions.py":1138 * 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__12 = PyTuple_Pack(1, __pyx_n_s_x); 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(1, 0, 0, 1, 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_rountTuple, 1071, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 1071, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1138, __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, 1138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 1138, __pyx_L1_error) - /* "collisions.py":1090 + /* "collisions.py":1157 * 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__14 = PyTuple_Pack(1, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_fixangle, 1090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1157, __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, 1157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 1157, __pyx_L1_error) - /* "collisions.py":1355 + /* "collisions.py":1442 * 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__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_sign, 1355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 1355, __pyx_L1_error) + __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, 1442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1442, __pyx_L1_error) - /* "collisions.py":1773 + /* "collisions.py":1865 * 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__18 = PyTuple_Pack(3, __pyx_n_s_p, __pyx_n_s_this, __pyx_n_s_op); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_checkP, 1773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1773, __pyx_L1_error) + __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, 1865, __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, 1865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 1865, __pyx_L1_error) - /* "collisions.py":1831 + /* "collisions.py":1923 * 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__20 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_angular_distance, 1831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 1831, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1923, __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, 1923, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 1923, __pyx_L1_error) - /* "collisions.py":1983 + /* "collisions.py":2102 * 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__24 = PyTuple_Pack(2, __pyx_n_s_angle, __pyx_n_s_radians); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1983, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 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_degrees_to_vector, 1983, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 1983, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_angle, __pyx_n_s_radians); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2102, __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, 2102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 2102, __pyx_L1_error) - /* "collisions.py":2022 + /* "collisions.py":2141 * return colls * return colls[0] * def calculate(ln, oln, recalculate): # <<<<<<<<<<<<<< * p2 = oln.closestPointTo(ln) * p = ln.closestPointTo(Point(*p2)) */ - __pyx_tuple__26 = 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__26)) __PYX_ERR(0, 2022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 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_calculate, 2022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 2022, __pyx_L1_error) + __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, 2141, __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, 2141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 2141, __pyx_L1_error) - /* "collisions.py":2058 + /* "collisions.py":2177 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< * p2 = ln.closestPointTo(Point(*point)) * olineP = point */ - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 2058, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 2058, __pyx_L1_error) + __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, 2177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 2177, __pyx_L1_error) - /* "collisions.py":2442 + /* "collisions.py":2586 * 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__29 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rot, 2442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 2442, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2586, __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, 2586, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 2586, __pyx_L1_error) - /* "collisions.py":2537 + /* "collisions.py":2678 * * 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__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rot, 2537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 2537, __pyx_L1_error) + __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, 2678, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 2678, __pyx_L1_error) - /* "collisions.py":2783 + /* "collisions.py":2939 * if not shapes: * return Shapes() * def reformat(obj): # <<<<<<<<<<<<<< * if checkShpType(obj, ShpGroups.CLOSED): * return obj */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_reformat, 2783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 2783, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2939, __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, 2939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 2939, __pyx_L1_error) /* "collisions.py":11 * pygame = None # Remember to `checkForPygame()`! @@ -103231,9 +109746,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * import shapely.ops as shapelyOps * */ - __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_shapely, __pyx_n_s_geometry); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __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); /* "collisions.py":12 * import shapely @@ -103242,1821 +109757,1980 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * Number = Union[int, float] */ - __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_shapely, __pyx_n_s_ops); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); + __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); - /* "collisions.py":48 + /* "collisions.py":49 * ] * * def checkForPygame(): # <<<<<<<<<<<<<< * if pygame is None: * raise ImportError( */ - __pyx_codeobj__38 = (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, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 48, __pyx_L1_error) + __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) - /* "collisions.py":54 + /* "collisions.py":55 * ) * * def rotate(origin: pointLike, point: pointLike, angle: Number) -> pointLike: # <<<<<<<<<<<<<< * """ * Rotate a point clockwise by a given angle around a given origin. */ - __pyx_tuple__39 = 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__39)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rotate, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 54, __pyx_L1_error) + __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) - /* "collisions.py":77 + /* "collisions.py":78 * return qx, qy * * def rotateBy0(point: pointLike, angle: Number) -> pointLike: # <<<<<<<<<<<<<< * """ * Rotate a point clockwise by a given angle around the origin. */ - __pyx_tuple__41 = 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__41)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 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_rotateBy0, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 77, __pyx_L1_error) + __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) - /* "collisions.py":96 + /* "collisions.py":97 * return qx, qy * * def direction(fromPoint: pointLike, toPoint: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the direction of `toPoint` from the origin of `fromPoint` */ - __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_fromPoint, __pyx_n_s_toPoint); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_direction, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 96, __pyx_L1_error) + __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) - /* "collisions.py":109 + /* "collisions.py":110 * return math.atan2(toPoint[1]-fromPoint[1], toPoint[0]-fromPoint[0]) * * def pointOnCircle(angle: Number, strength: Number=1) -> pointLike: # <<<<<<<<<<<<<< * """ * Finds the point on the unit circle at a given angle with a given strength */ - __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_angle, __pyx_n_s_strength); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 109, __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_pointOnCircle, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 109, __pyx_L1_error) - __pyx_tuple__47 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 109, __pyx_L1_error) + __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); - /* "collisions.py":133 - * """A group of other shapes""" + /* "collisions.py":150 + * Polygon = -9 * - * def checkShpType(shape: Union['Shape', 'Shapes'], typs: Union[Type, ShpGroups, Iterable[Union[Type, ShpGroups]]]) -> bool: # <<<<<<<<<<<<<< + * 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__48 = PyTuple_Pack(3, __pyx_n_s_shape, __pyx_n_s_typs, __pyx_n_s_i); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_checkShpType, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 133, __pyx_L1_error) + __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) - /* "collisions.py":153 + /* "collisions.py":168 * return False * * def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: # <<<<<<<<<<<<<< * """ * Converts a shapely shape to a BlazeSudio Shape. */ - __pyx_tuple__50 = PyTuple_Pack(4, __pyx_n_s_shapelyShape, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); - __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __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_shapelyToColl, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 153, __pyx_L1_error) + __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) - /* "collisions.py":175 + /* "collisions.py":190 * 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__52 = PyTuple_Pack(3, __pyx_n_s_collShape, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); - __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 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_collToShapely, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 175, __pyx_L1_error) + __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) - /* "collisions.py":197 + /* "collisions.py":212 * 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__54 = 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__54)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 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_drawShape, 197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 197, __pyx_L1_error) + __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) - /* "collisions.py":248 + /* "collisions.py":264 * x: Number = 0 * y: Number = 0 * def __init__(self, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__56 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_init, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 264, __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, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 264, __pyx_L1_error) - /* "collisions.py":255 + /* "collisions.py":271 * self.bounciness: Number = bounciness * * def collides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< * """ * Whether this shape collides with another shape(s) */ - __pyx_tuple__58 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_s); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 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_collides_2, 255, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 255, __pyx_L1_error) + __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, 271, __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, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 271, __pyx_L1_error) - /* "collisions.py":272 + /* "collisions.py":288 * return False * * def whereCollides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds where this shape collides with another shape(s) */ - __pyx_tuple__60 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); - __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 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_whereCollides, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 272, __pyx_L1_error) + __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, 288, __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, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 288, __pyx_L1_error) - /* "collisions.py":289 + /* "collisions.py":305 * 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, 305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 305, __pyx_L1_error) + + /* "collisions.py":322 + * return False + * * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< * """ * Finds the distance between this shape and another shape. */ - __pyx_tuple__62 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_thisP, __pyx_n_s_otherP); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 289, __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_distance_to, 289, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 289, __pyx_L1_error) + __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, 322, __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, 322, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 322, __pyx_L1_error) - /* "collisions.py":303 + /* "collisions.py":336 * 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__64 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_thisr, __pyx_n_s_otherr); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 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_check_rects, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 303, __pyx_L1_error) + __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, 336, __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, 336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 336, __pyx_L1_error) - /* "collisions.py":318 + /* "collisions.py":351 * 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__66 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_repr, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 351, __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, 351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 351, __pyx_L1_error) - /* "collisions.py":321 + /* "collisions.py":354 * * # Replace these * def _collides(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * return True * */ - __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_othershape); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); - __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_othershape); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 354, __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, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 354, __pyx_L1_error) - /* "collisions.py":324 + /* "collisions.py":357 * return True * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: # <<<<<<<<<<<<<< * return [] * */ - __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 324, __pyx_L1_error) + __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, 357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 357, __pyx_L1_error) - /* "collisions.py":327 + /* "collisions.py":360 * 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, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 360, __pyx_L1_error) + + /* "collisions.py":363 + * 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__71 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); - __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 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_closestPointTo, 327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 327, __pyx_L1_error) - __pyx_tuple__73 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__73); - __Pyx_GIVEREF(__pyx_tuple__73); + __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, 363, __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, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_tuple__77 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); - /* "collisions.py":342 + /* "collisions.py":378 * 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__74 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); - __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 342, __pyx_L1_error) + __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, 378, __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, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 378, __pyx_L1_error) - /* "collisions.py":355 + /* "collisions.py":391 * 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__76 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_vel); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__76); - __Pyx_GIVEREF(__pyx_tuple__76); - __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 355, __pyx_L1_error) + __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, 391, __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, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 391, __pyx_L1_error) - /* "collisions.py":368 + /* "collisions.py":404 * return math.degrees(math.atan2(vel[1], vel[0])) % 360 * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_toLines, 368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 368, __pyx_L1_error) + __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, 404, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 404, __pyx_L1_error) - /* "collisions.py":375 + /* "collisions.py":411 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_toPoints, 375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 375, __pyx_L1_error) + __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, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 411, __pyx_L1_error) - /* "collisions.py":382 + /* "collisions.py":418 * return [] * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape. */ - __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_area, 382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 382, __pyx_L1_error) + __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, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 418, __pyx_L1_error) - /* "collisions.py":391 + /* "collisions.py":427 * return float('inf') * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this object. */ - __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_rect, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 391, __pyx_L1_error) + __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, 427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 427, __pyx_L1_error) - /* "collisions.py":400 + /* "collisions.py":436 * 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__82 = 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__82)) __PYX_ERR(0, 400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__82); - __Pyx_GIVEREF(__pyx_tuple__82); - __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 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_handleCollisionsPos, 400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 400, __pyx_L1_error) + __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, 436, __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, 436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 436, __pyx_L1_error) - /* "collisions.py":408 + /* "collisions.py":444 * 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__84 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_verbose); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__84); - __Pyx_GIVEREF(__pyx_tuple__84); - __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 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_handleCollisionsVel, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 408, __pyx_L1_error) + __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, 444, __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, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 444, __pyx_L1_error) - /* "collisions.py":416 + /* "collisions.py":452 * return self, vel * * def copy(self) -> 'Shape': # <<<<<<<<<<<<<< * """ * Copy this shape to return another with the same properties */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 416, __pyx_L1_error) + __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, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 452, __pyx_L1_error) - /* "collisions.py":422 + /* "collisions.py":458 * return Shape(self.bounciness) * * def __getitem__(self, it: int) -> None: # <<<<<<<<<<<<<< * return 0 * */ - __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_it); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); - __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_tuple__91 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_it); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 458, __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, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 458, __pyx_L1_error) - /* "collisions.py":425 + /* "collisions.py":461 * return 0 * * def __setitem__(self, it: int, new: Number) -> None: # <<<<<<<<<<<<<< * pass * */ - __pyx_tuple__89 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_it, __pyx_n_s_new); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__89); - __Pyx_GIVEREF(__pyx_tuple__89); - __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 425, __pyx_L1_error) + __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, 461, __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, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 461, __pyx_L1_error) - /* "collisions.py":428 + /* "collisions.py":464 * pass * * def __iter__(self): # <<<<<<<<<<<<<< * return iter([]) * */ - __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_iter, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 428, __pyx_L1_error) + __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, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 464, __pyx_L1_error) - /* "collisions.py":431 + /* "collisions.py":467 * return iter([]) * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_str, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 431, __pyx_L1_error) + __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, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 467, __pyx_L1_error) - /* "collisions.py":436 + /* "collisions.py":472 * 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__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_init, 436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 436, __pyx_L1_error) + __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, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 472, __pyx_L1_error) - /* "collisions.py":439 + /* "collisions.py":475 * super().__init__(0) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 439, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 439, __pyx_L1_error) + __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, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 475, __pyx_L1_error) - /* "collisions.py":442 + /* "collisions.py":478 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * return [] * */ - __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 442, __pyx_L1_error) + __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, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 478, __pyx_L1_error) - /* "collisions.py":445 + /* "collisions.py":481 * 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, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 481, __pyx_L1_error) + + /* "collisions.py":484 + * return False + * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; 0. */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 445, __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__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 484, __pyx_L1_error) - /* "collisions.py":454 + /* "collisions.py":493 * return 0 * * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< * """Make a copy of this non-existant shape""" * return NoShape() */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 454, __pyx_L1_error) + __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, 493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 493, __pyx_L1_error) - /* "collisions.py":458 + /* "collisions.py":497 * return NoShape() * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_str, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 458, __pyx_L1_error) + __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, 497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 497, __pyx_L1_error) - /* "collisions.py":464 - * """A class which holds multiple shapes and can be used to do things with all of them at once.""" - * GROUPS = [ShpGroups.GROUP] + /* "collisions.py":504 + * GROUPS = {ShpGroups.GROUP} + * TYPE = ShpTyps.Group * def __init__(self, *shapes: Shape): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__99 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shapes); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__99); - __Pyx_GIVEREF(__pyx_tuple__99); - __pyx_codeobj__100 = (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__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_tuple__104 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shapes); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 504, __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, 504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 504, __pyx_L1_error) - /* "collisions.py":474 + /* "collisions.py":514 * self.shapes = list(shapes) * * def add_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< * """ * Adds a shape to this Shapes object. */ - __pyx_tuple__101 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__101); - __Pyx_GIVEREF(__pyx_tuple__101); - __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__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_add_shape, 474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_tuple__106 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 514, __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, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 514, __pyx_L1_error) - /* "collisions.py":483 + /* "collisions.py":523 * self.shapes.append(shape) * * def add_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< * """ * Adds multiple shapes to this object. */ - __pyx_codeobj__103 = (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__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_add_shapes, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 483, __pyx_L1_error) + __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, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 523, __pyx_L1_error) - /* "collisions.py":495 + /* "collisions.py":535 * self.shapes.extend(list(shapes)) * * def remove_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< * """ * Removes a specific shape from this object. */ - __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__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_remove_shape, 495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 495, __pyx_L1_error) + __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, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 535, __pyx_L1_error) - /* "collisions.py":504 + /* "collisions.py":544 * self.shapes.remove(shape) * * def remove_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< * """ * Removes multiple shapes from this object. */ - __pyx_tuple__105 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_shapes, __pyx_n_s_s); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__105); - __Pyx_GIVEREF(__pyx_tuple__105); - __pyx_codeobj__106 = (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__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_remove_shapes, 504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 504, __pyx_L1_error) + __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, 544, __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, 544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 544, __pyx_L1_error) - /* "collisions.py":517 + /* "collisions.py":557 * self.shapes.remove(s) * - * def collides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< + * 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__107 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides_2, 517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 517, __pyx_L1_error) + __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, 557, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 557, __pyx_L1_error) - /* "collisions.py":532 + /* "collisions.py":572 * return False * - * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * 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__108 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_shapes, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__108); - __Pyx_GIVEREF(__pyx_tuple__108); - __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __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_whereCollides, 532, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 532, __pyx_L1_error) + __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, 572, __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, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 572, __pyx_L1_error) - /* "collisions.py":547 + /* "collisions.py":587 * 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. */ - __pyx_tuple__110 = 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__110)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__110); - __Pyx_GIVEREF(__pyx_tuple__110); - __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 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_closestPointTo, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 547, __pyx_L1_error) + __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, 587, __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, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 587, __pyx_L1_error) + + /* "collisions.py":607 + * 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. + */ + __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, 607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 607, __pyx_L1_error) - /* "collisions.py":569 + /* "collisions.py":624 * # 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_tuple__112 = 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__112)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__112); - __Pyx_GIVEREF(__pyx_tuple__112); - __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __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_isCorner, 569, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 569, __pyx_L1_error) + __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, 624, __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, 624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 624, __pyx_L1_error) - /* "collisions.py":585 + /* "collisions.py":640 * return cs * * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Finds the tangent on each of these objects for the specified point. -90 = normal. */ - __pyx_tuple__114 = 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__114)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__114); - __Pyx_GIVEREF(__pyx_tuple__114); - __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 585, __pyx_L1_error) + __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, 640, __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, 640, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 640, __pyx_L1_error) - /* "collisions.py":605 + /* "collisions.py":660 * # TODO: to_points and to_lines * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the combined area of all the shapes. */ - __pyx_tuple__116 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__116); - __Pyx_GIVEREF(__pyx_tuple__116); - __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 605, __pyx_L1_error) + __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, 660, __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, 660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 660, __pyx_L1_error) - /* "collisions.py":614 + /* "collisions.py":669 * 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__118 = 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__118)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__118); - __Pyx_GIVEREF(__pyx_tuple__118); - __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 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_rect, 614, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 614, __pyx_L1_error) + __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, 669, __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, 669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 669, __pyx_L1_error) - /* "collisions.py":624 + /* "collisions.py":679 * 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__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 624, __pyx_L1_error) + __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, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 679, __pyx_L1_error) - /* "collisions.py":630 + /* "collisions.py":685 * 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__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_copy_leave_shapes, 630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 630, __pyx_L1_error) + __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, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 685, __pyx_L1_error) - /* "collisions.py":636 + /* "collisions.py":691 * return Shapes(*self.shapes) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self.shapes) * */ - __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_iter, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 636, __pyx_L1_error) + __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, 691, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 691, __pyx_L1_error) - /* "collisions.py":639 + /* "collisions.py":694 * 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, 694, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 694, __pyx_L1_error) + + /* "collisions.py":697 + * return len(self.shapes) + * * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< * return self.shapes[index] * */ - __pyx_tuple__123 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_index); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__123); - __Pyx_GIVEREF(__pyx_tuple__123); - __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_getitem, 639, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_tuple__130 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_index); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 697, __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, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 697, __pyx_L1_error) - /* "collisions.py":642 + /* "collisions.py":700 * return self.shapes[index] * * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< * self.shapes[index] = new * */ - __pyx_tuple__125 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_new); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__125); - __Pyx_GIVEREF(__pyx_tuple__125); - __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 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_setitem, 642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 642, __pyx_L1_error) + __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, 700, __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, 700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 700, __pyx_L1_error) - /* "collisions.py":645 + /* "collisions.py":703 * self.shapes[index] = new * * def __repr__(self): return str(self) # <<<<<<<<<<<<<< * * def __str__(self): */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_repr, 645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 645, __pyx_L1_error) + __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, 703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 703, __pyx_L1_error) - /* "collisions.py":647 + /* "collisions.py":705 * def __repr__(self): return str(self) * * def __str__(self): # <<<<<<<<<<<<<< - * return f'' - * + * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") + * return f'' */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 647, __pyx_L1_error) + __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, 705, __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, 705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 705, __pyx_L1_error) - /* "collisions.py":656 - * class Point(Shape): + /* "collisions.py":716 + * 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__129 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__129); - __Pyx_GIVEREF(__pyx_tuple__129); - __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 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_init, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 656, __pyx_L1_error) + __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, 716, __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, 716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 716, __pyx_L1_error) - /* "collisions.py":666 + /* "collisions.py":726 * self.x, self.y = x, y * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this point. */ - __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_rect, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 666, __pyx_L1_error) + __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, 726, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 726, __pyx_L1_error) - /* "collisions.py":675 + /* "collisions.py":735 * return self.x, self.y, self.x, self.y * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; 0. */ - __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_area, 675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 675, __pyx_L1_error) + __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, 735, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 735, __pyx_L1_error) - /* "collisions.py":684 + /* "collisions.py":744 * return 0.0 * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_toPoints, 684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 684, __pyx_L1_error) + __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, 744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 744, __pyx_L1_error) - /* "collisions.py":691 + /* "collisions.py":751 * return [self] * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return self.x == othershape.x and self.y == othershape.y */ - __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 691, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 691, __pyx_L1_error) + __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, 751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 751, __pyx_L1_error) - /* "collisions.py":696 + /* "collisions.py":756 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] */ - __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 696, __pyx_L1_error) + __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, 756, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 756, __pyx_L1_error) - /* "collisions.py":701 + /* "collisions.py":761 * 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__136 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 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_closestPointTo, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 701, __pyx_L1_error) + __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, 761, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 761, __pyx_L1_error) - /* "collisions.py":716 + /* "collisions.py":776 * return (self.x, self.y) * * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< * """ * Gets this object in a tuple format: (x, y). */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getTuple, 716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 716, __pyx_L1_error) + __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, 776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 776, __pyx_L1_error) - /* "collisions.py":723 + /* "collisions.py":783 * 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, 783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 783, __pyx_L1_error) + + /* "collisions.py":786 + * return False + * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldPoint: Union['Point',pointLike], * newPoint: Union['Point', pointLike], */ - __pyx_tuple__139 = 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__138); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__139); - __Pyx_GIVEREF(__pyx_tuple__139); - __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 26, 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_handleCollisionsPos, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 723, __pyx_L1_error) + __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, 786, __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, 786, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 786, __pyx_L1_error) - /* "collisions.py":791 + /* "collisions.py":854 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes,Iterable[Shape]], */ - __pyx_tuple__141 = 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__141)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__141); - __Pyx_GIVEREF(__pyx_tuple__141); - __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 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_handleCollisionsVel, 791, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 791, __pyx_L1_error) + __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, 854, __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, 854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(0, 854, __pyx_L1_error) - /* "collisions.py":821 + /* "collisions.py":884 * return o[0], o[1] * * def copy(self) -> 'Point': # <<<<<<<<<<<<<< * """ * Make a brand new Point with the same values! */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 821, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 821, __pyx_L1_error) + __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, 884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 884, __pyx_L1_error) - /* "collisions.py":827 + /* "collisions.py":890 * return Point(self.x, self.y, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_tuple__144 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__144); - __Pyx_GIVEREF(__pyx_tuple__144); - __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_getitem, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_tuple__153 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 890, __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, 890, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 890, __pyx_L1_error) - /* "collisions.py":837 + /* "collisions.py":900 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_tuple__146 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_new); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__146); - __Pyx_GIVEREF(__pyx_tuple__146); - __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 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_setitem, 837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(0, 837, __pyx_L1_error) + __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, 900, __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, 900, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 900, __pyx_L1_error) - /* "collisions.py":847 + /* "collisions.py":910 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter([self.x, self.y]) * */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 847, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 847, __pyx_L1_error) + __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, 910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 910, __pyx_L1_error) - /* "collisions.py":850 + /* "collisions.py":913 * return iter([self.x, self.y]) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 850, __pyx_L1_error) + __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, 913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 913, __pyx_L1_error) - /* "collisions.py":856 - * """A line segment object defined by a start and an end point.""" - * GROUPS = [ShpGroups.LINES] + /* "collisions.py":920 + * GROUPS = {ShpGroups.LINES} + * TYPE = ShpTyps.Line * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__150 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_bounciness); 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(4, 0, 0, 4, 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_init, 856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(0, 856, __pyx_L1_error) + __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, 920, __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, 920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 920, __pyx_L1_error) - /* "collisions.py":866 + /* "collisions.py":930 * 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__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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 866, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 866, __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__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 930, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 930, __pyx_L1_error) - /* "collisions.py":875 + /* "collisions.py":939 * 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__153 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_x, 875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(0, 875, __pyx_L1_error) + __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, 939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 939, __pyx_L1_error) - /* "collisions.py":879 + /* "collisions.py":943 * """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__154 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_diff); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__154); - __Pyx_GIVEREF(__pyx_tuple__154); - __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(0, 879, __pyx_L1_error) + __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, 943, __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, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 943, __pyx_L1_error) - /* "collisions.py":885 + /* "collisions.py":949 * 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__156 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_y, 885, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 885, __pyx_L1_error) + __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, 949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(0, 949, __pyx_L1_error) - /* "collisions.py":889 + /* "collisions.py":953 * """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__157 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 889, __pyx_L1_error) + __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, 953, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 953, __pyx_L1_error) - /* "collisions.py":897 + /* "collisions.py":961 * # 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__158 = PyTuple_Pack(4, __pyx_n_s_p, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_cross_product); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__158); - __Pyx_GIVEREF(__pyx_tuple__158); - __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_onSegment, 897, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(0, 897, __pyx_L1_error) + __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, 961, __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, 961, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 961, __pyx_L1_error) - /* "collisions.py":912 + /* "collisions.py":976 * 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__160 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_rect, 912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 912, __pyx_L1_error) + __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, 976, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(0, 976, __pyx_L1_error) - /* "collisions.py":921 + /* "collisions.py":985 * 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__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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 921, __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__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 985, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 985, __pyx_L1_error) - /* "collisions.py":928 + /* "collisions.py":992 * return [self] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 928, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 928, __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__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(0, 992, __pyx_L1_error) - /* "collisions.py":935 + /* "collisions.py":999 * 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, 999, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 999, __pyx_L1_error) + + /* "collisions.py":1002 + * return False + * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) */ - __pyx_tuple__163 = 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__163)) __PYX_ERR(0, 935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__163); - __Pyx_GIVEREF(__pyx_tuple__163); - __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 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_collides, 935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 935, __pyx_L1_error) + __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, 1002, __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, 1002, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 1002, __pyx_L1_error) - /* "collisions.py":962 + /* "collisions.py":1029 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] */ - __pyx_tuple__165 = 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__165)) __PYX_ERR(0, 962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__165); - __Pyx_GIVEREF(__pyx_tuple__165); - __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 962, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 962, __pyx_L1_error) + __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, 1029, __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, 1029, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 1029, __pyx_L1_error) - /* "collisions.py":986 + /* "collisions.py":1053 * 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__167 = 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__167)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__167); - __Pyx_GIVEREF(__pyx_tuple__167); - __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 18, 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_closestPointTo, 986, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 986, __pyx_L1_error) + __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, 1053, __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, 1053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 1053, __pyx_L1_error) - /* "collisions.py":1060 + /* "collisions.py":1127 * 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__169 = 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__169)) __PYX_ERR(0, 1060, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__169); - __Pyx_GIVEREF(__pyx_tuple__169); - __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 1060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 1060, __pyx_L1_error) + __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, 1127, __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, 1127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 1127, __pyx_L1_error) - /* "collisions.py":1075 + /* "collisions.py":1142 * 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__171 = 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__171)) __PYX_ERR(0, 1075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__171); - __Pyx_GIVEREF(__pyx_tuple__171); - __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 1075, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 1075, __pyx_L1_error) + __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, 1142, __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, 1142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 1142, __pyx_L1_error) - /* "collisions.py":1100 + /* "collisions.py":1167 * return [(phi-180)%360, phi % 360][tries.index(min(tries))] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldLine: 'Line', * newLine: 'Line', */ - __pyx_tuple__173 = 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_cLine, __pyx_n_s_thisIsOnP, __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__173)) __PYX_ERR(0, 1100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__173); - __Pyx_GIVEREF(__pyx_tuple__173); - __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 42, 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_handleCollisionsPos, 1100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 1100, __pyx_L1_error) + __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, 1167, __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, 1167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 1167, __pyx_L1_error) - /* "collisions.py":1231 + /* "collisions.py":1304 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_tuple__175 = 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__175)) __PYX_ERR(0, 1231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__175); - __Pyx_GIVEREF(__pyx_tuple__175); - __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 9, 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_handleCollisionsVel, 1231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 1231, __pyx_L1_error) + __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, 1304, __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, 1304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 1304, __pyx_L1_error) - /* "collisions.py":1263 + /* "collisions.py":1336 * return out, outvel * * def copy(self) -> 'Line': # <<<<<<<<<<<<<< * """ * Make a copy of the Line with the same values! */ - __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_copy, 1263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 1263, __pyx_L1_error) + __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, 1336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 1336, __pyx_L1_error) - /* "collisions.py":1269 + /* "collisions.py":1342 * return Line(self.p1, self.p2, self.bounciness) * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< * if item == 0: * return self.p1 */ - __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_getitem, 1269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 1269, __pyx_L1_error) + __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, 1342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 1342, __pyx_L1_error) - /* "collisions.py":1279 + /* "collisions.py":1352 * ) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.p1 = new */ - __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 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_setitem, 1279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(0, 1279, __pyx_L1_error) + __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, 1352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 1352, __pyx_L1_error) - /* "collisions.py":1289 + /* "collisions.py":1362 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.p1, self.p2)) * */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 1289, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 1289, __pyx_L1_error) + __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, 1362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 1362, __pyx_L1_error) - /* "collisions.py":1292 + /* "collisions.py":1365 * return iter((self.p1, self.p2)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_str, 1292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 1292, __pyx_L1_error) + __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, 1365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 1365, __pyx_L1_error) - /* "collisions.py":1300 - * `.toLines()` or `.toPoints()` it will return an empty list; so please check for it *before* closed shapes.""" - * GROUPS = [ShpGroups.CLOSED] + /* "collisions.py":1374 + * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} + * TYPE = ShpTyps.Circle * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__182 = 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__182)) __PYX_ERR(0, 1300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__182); - __Pyx_GIVEREF(__pyx_tuple__182); - __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 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_init, 1300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 1300, __pyx_L1_error) + __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, 1374, __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, 1374, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 1374, __pyx_L1_error) - /* "collisions.py":1311 + /* "collisions.py":1385 * self.x, self.y, self.r = x, y, r * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this circle. */ - __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_rect, 1311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 1311, __pyx_L1_error) + __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, 1385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 1385, __pyx_L1_error) - /* "collisions.py":1320 + /* "collisions.py":1394 * 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__185 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_area, 1320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 1320, __pyx_L1_error) + __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, 1394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 1394, __pyx_L1_error) - /* "collisions.py":1329 + /* "collisions.py":1403 * return math.pi * self.r**2 * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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__186 = 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__186)) __PYX_ERR(0, 1329, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__186); - __Pyx_GIVEREF(__pyx_tuple__186); - __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 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_collides, 1329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 1329, __pyx_L1_error) + __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, 1403, __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, 1403, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(0, 1403, __pyx_L1_error) - /* "collisions.py":1349 + /* "collisions.py":1416 + * 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, 1416, __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, 1416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 1416, __pyx_L1_error) + + /* "collisions.py":1436 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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__188 = 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__188)) __PYX_ERR(0, 1349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__188); - __Pyx_GIVEREF(__pyx_tuple__188); - __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 29, 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_where, 1349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 1349, __pyx_L1_error) + __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, 1436, __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, 1436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 1436, __pyx_L1_error) - /* "collisions.py":1420 + /* "collisions.py":1507 * 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__190 = 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__190)) __PYX_ERR(0, 1420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__190); - __Pyx_GIVEREF(__pyx_tuple__190); - __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 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_closestPointTo, 1420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 1420, __pyx_L1_error) + __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, 1507, __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, 1507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 1507, __pyx_L1_error) - /* "collisions.py":1469 + /* "collisions.py":1556 * return self.closestPointTo(Point(*ps[0])) * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldCir: 'Circle', * newCir: 'Circle', */ - __pyx_tuple__192 = 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__138); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__192); - __Pyx_GIVEREF(__pyx_tuple__192); - __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 33, 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, 1469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 1469, __pyx_L1_error) + __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, 1556, __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, 1556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 1556, __pyx_L1_error) - /* "collisions.py":1564 + /* "collisions.py":1652 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes,Iterable[Shape]], */ - __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 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_handleCollisionsVel, 1564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 1564, __pyx_L1_error) + __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, 1652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(0, 1652, __pyx_L1_error) - /* "collisions.py":1594 + /* "collisions.py":1682 * 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. + * 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__195 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 1594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 1594, __pyx_L1_error) + __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, 1682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 1682, __pyx_L1_error) - /* "collisions.py":1607 + /* "collisions.py":1695 * 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__196 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 1607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 1607, __pyx_L1_error) + __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, 1695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 1695, __pyx_L1_error) - /* "collisions.py":1622 + /* "collisions.py":1710 * 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__197 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_copy, 1622, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(0, 1622, __pyx_L1_error) + __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, 1710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 1710, __pyx_L1_error) - /* "collisions.py":1628 + /* "collisions.py":1716 * return Circle(self.x, self.y, self.r, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_getitem, 1628, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 1628, __pyx_L1_error) + __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, 1716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(0, 1716, __pyx_L1_error) - /* "collisions.py":1640 + /* "collisions.py":1728 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 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_setitem, 1640, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 1640, __pyx_L1_error) + __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, 1728, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 1728, __pyx_L1_error) - /* "collisions.py":1652 + /* "collisions.py":1740 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.r)) * */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 1652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(0, 1652, __pyx_L1_error) + __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, 1740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(0, 1740, __pyx_L1_error) - /* "collisions.py":1655 + /* "collisions.py":1743 * return iter((self.x, self.y, self.r)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_str, 1655, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 1655, __pyx_L1_error) + __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, 1743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 1743, __pyx_L1_error) - /* "collisions.py":1664 - * **ANGLES ARE MEASURED IN DEGREES.**""" - * GROUPS = [ShpGroups.LINES] + /* "collisions.py":1753 + * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} + * TYPE = ShpTyps.Arc * def __init__(self, # <<<<<<<<<<<<<< * x: Number, * y: Number, */ - __pyx_tuple__202 = 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__202)) __PYX_ERR(0, 1664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__202); - __Pyx_GIVEREF(__pyx_tuple__202); - __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 8, 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_init, 1664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 1664, __pyx_L1_error) + __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, 1753, __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, 1753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 1753, __pyx_L1_error) - /* "collisions.py":1690 + /* "collisions.py":1779 * self.bounciness = bounciness * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; the length of the arc. */ - __pyx_tuple__204 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_diff); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 1690, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__204); - __Pyx_GIVEREF(__pyx_tuple__204); - __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(1, 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_area, 1690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 1690, __pyx_L1_error) + __pyx_tuple__216 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_diff); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1779, __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, 1779, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(0, 1779, __pyx_L1_error) - /* "collisions.py":1703 + /* "collisions.py":1792 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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__206 = 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__206)) __PYX_ERR(0, 1703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__206); - __Pyx_GIVEREF(__pyx_tuple__206); - __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 1703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 1703, __pyx_L1_error) + __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, 1792, __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, 1792, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 1792, __pyx_L1_error) - /* "collisions.py":1727 + /* "collisions.py":1816 * 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__208 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_flip, 1727, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 1727, __pyx_L1_error) + __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, 1816, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 1816, __pyx_L1_error) - /* "collisions.py":1733 + /* "collisions.py":1822 * 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, 1822, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 1822, __pyx_L1_error) + + /* "collisions.py":1825 + * return False + * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): */ - __pyx_tuple__209 = 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__209)) __PYX_ERR(0, 1733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__209); - __Pyx_GIVEREF(__pyx_tuple__209); - __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 1733, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(0, 1733, __pyx_L1_error) + __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, 1825, __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, 1825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 1825, __pyx_L1_error) - /* "collisions.py":1746 + /* "collisions.py":1838 * 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__211 = 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__211)) __PYX_ERR(0, 1746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__211); - __Pyx_GIVEREF(__pyx_tuple__211); - __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 1746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(0, 1746, __pyx_L1_error) + __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, 1838, __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, 1838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 1838, __pyx_L1_error) - /* "collisions.py":1828 + /* "collisions.py":1920 * 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__213 = 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__213)) __PYX_ERR(0, 1828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__213); - __Pyx_GIVEREF(__pyx_tuple__213); - __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_constrainAng, 1828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(0, 1828, __pyx_L1_error) + __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, 1920, __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, 1920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 1920, __pyx_L1_error) - /* "collisions.py":1848 + /* "collisions.py":1940 * return phi * * def angleInRange(self, angle: Number) -> bool: # <<<<<<<<<<<<<< * """ * Check to see if an angle is in the range of this arc. */ - __pyx_tuple__215 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 1848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__215); - __Pyx_GIVEREF(__pyx_tuple__215); - __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_angleInRange, 1848, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(0, 1848, __pyx_L1_error) + __pyx_tuple__228 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 1940, __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, 1940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 1940, __pyx_L1_error) - /* "collisions.py":1864 + /* "collisions.py":1956 * return self.startAng <= angle%360 <= self.endAng * * def endPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Gets the end points of the arc */ - __pyx_tuple__217 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_startAng, __pyx_n_s_endAng); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 1864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__217); - __Pyx_GIVEREF(__pyx_tuple__217); - __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_endPoints, 1864, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(0, 1864, __pyx_L1_error) + __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, 1956, __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, 1956, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 1956, __pyx_L1_error) - /* "collisions.py":1876 + /* "collisions.py":1968 * (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__219 = 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__219)) __PYX_ERR(0, 1876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__219); - __Pyx_GIVEREF(__pyx_tuple__219); - __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 1876, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 1876, __pyx_L1_error) + __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, 1968, __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, 1968, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 1968, __pyx_L1_error) - /* "collisions.py":1903 + /* "collisions.py":1995 * 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, 1995, __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, 1995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 1995, __pyx_L1_error) + + /* "collisions.py":2012 + * 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, 2012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(0, 2012, __pyx_L1_error) + + /* "collisions.py":2022 + * ] + * * def copy(self) -> 'Arc': # <<<<<<<<<<<<<< * """ * Because Noah's first arc broke, now you need another one. */ - __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_copy, 1903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 1903, __pyx_L1_error) + __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, 2022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 2022, __pyx_L1_error) - /* "collisions.py":1909 + /* "collisions.py":2028 * 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__222 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_getitem, 1909, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(0, 1909, __pyx_L1_error) + __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, 2028, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 2028, __pyx_L1_error) - /* "collisions.py":1925 + /* "collisions.py":2044 * ) * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 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_setitem, 1925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 1925, __pyx_L1_error) + __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, 2044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 2044, __pyx_L1_error) - /* "collisions.py":1941 + /* "collisions.py":2060 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * */ - __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_iter, 1941, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(0, 1941, __pyx_L1_error) + __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, 2060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 2060, __pyx_L1_error) - /* "collisions.py":1944 + /* "collisions.py":2063 * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 1944, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 1944, __pyx_L1_error) + __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, 2063, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 2063, __pyx_L1_error) - /* "collisions.py":1951 + /* "collisions.py":2070 * 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} * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return [] */ - __pyx_tuple__226 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_i, __pyx_n_s_points_2); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 1951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__226); - __Pyx_GIVEREF(__pyx_tuple__226); - __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 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_where, 1951, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 1951, __pyx_L1_error) + __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, 2070, __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, 2070, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(0, 2070, __pyx_L1_error) - /* "collisions.py":1965 + /* "collisions.py":2084 * 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__228 = 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__228)) __PYX_ERR(0, 1965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__228); - __Pyx_GIVEREF(__pyx_tuple__228); - __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 16, 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_tangent, 1965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 1965, __pyx_L1_error) + __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, 2084, __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, 2084, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(0, 2084, __pyx_L1_error) - /* "collisions.py":1999 + /* "collisions.py":2118 * 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__230 = 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__230)) __PYX_ERR(0, 1999, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__230); - __Pyx_GIVEREF(__pyx_tuple__230); - __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 27, 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_closestPointTo, 1999, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 1999, __pyx_L1_error) + __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, 2118, __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, 2118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) __PYX_ERR(0, 2118, __pyx_L1_error) - /* "collisions.py":2079 + /* "collisions.py":2198 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldShp: 'ClosedShape', * newShp: 'ClosedShape', */ - __pyx_tuple__232 = 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_cLines, __pyx_n_s_thisIsOnP, __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__232)) __PYX_ERR(0, 2079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__232); - __Pyx_GIVEREF(__pyx_tuple__232); - __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 45, 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_handleCollisionsPos, 2079, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 2079, __pyx_L1_error) + __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, 2198, __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, 2198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(0, 2198, __pyx_L1_error) - /* "collisions.py":2226 + /* "collisions.py":2351 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_tuple__234 = 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__234)) __PYX_ERR(0, 2226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__234); - __Pyx_GIVEREF(__pyx_tuple__234); - __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 10, 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_handleCollisionsVel, 2226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 2226, __pyx_L1_error) + __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, 2351, __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, 2351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(0, 2351, __pyx_L1_error) - /* "collisions.py":2260 + /* "collisions.py":2385 * 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, 2385, __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, 2385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 2385, __pyx_L1_error) + + /* "collisions.py":2388 + * 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, 2388, __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, 2388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 2388, __pyx_L1_error) + + /* "collisions.py":2398 + * 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__236 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision, __pyx_n_s_i); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 2260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__236); - __Pyx_GIVEREF(__pyx_tuple__236); - __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 2260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 2260, __pyx_L1_error) + __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, 2398, __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, 2398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 2398, __pyx_L1_error) - /* "collisions.py":2276 + /* "collisions.py":2414 * return False * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_toLines, 2276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 2276, __pyx_L1_error) + __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, 2414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(0, 2414, __pyx_L1_error) - /* "collisions.py":2283 + /* "collisions.py":2421 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_toPoints, 2283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 2283, __pyx_L1_error) + __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, 2421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 2421, __pyx_L1_error) - /* "collisions.py":2290 + /* "collisions.py":2428 * return [] * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< * return self.toPoints()[item] * */ - __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_getitem, 2290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 2290, __pyx_L1_error) + __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, 2428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 2428, __pyx_L1_error) - /* "collisions.py":2293 + /* "collisions.py":2431 * return self.toPoints()[item] * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self.toPoints()) * */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 2293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 2293, __pyx_L1_error) + __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, 2431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(0, 2431, __pyx_L1_error) - /* "collisions.py":2296 + /* "collisions.py":2434 * return iter(self.toPoints()) * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_str, 2296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(0, 2296, __pyx_L1_error) + __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, 2434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 2434, __pyx_L1_error) - /* "collisions.py":2301 - * class Rect(ClosedShape): + /* "collisions.py":2440 * """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__243 = 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__243)) __PYX_ERR(0, 2301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__243); - __Pyx_GIVEREF(__pyx_tuple__243); - __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 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_init, 2301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(0, 2301, __pyx_L1_error) + __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, 2440, __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, 2440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(0, 2440, __pyx_L1_error) - /* "collisions.py":2313 + /* "collisions.py":2452 * 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__245 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_rect, 2313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(0, 2313, __pyx_L1_error) + __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, 2452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 2452, __pyx_L1_error) - /* "collisions.py":2322 + /* "collisions.py":2461 * 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__246 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_area, 2322, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(0, 2322, __pyx_L1_error) + __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, 2461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(0, 2461, __pyx_L1_error) - /* "collisions.py":2331 + /* "collisions.py":2470 * 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, 2470, __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, 2470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(0, 2470, __pyx_L1_error) + + /* "collisions.py":2474 + * 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, Point): + * if checkShpType(othershape, ShpTyps.Point): */ - __pyx_tuple__247 = 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__247)) __PYX_ERR(0, 2331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__247); - __Pyx_GIVEREF(__pyx_tuple__247); - __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 14, 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_collides, 2331, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 2331, __pyx_L1_error) + __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, 2474, __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, 2474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(0, 2474, __pyx_L1_error) - /* "collisions.py":2362 + /* "collisions.py":2505 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(0, 2362, __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__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 2505, __pyx_L1_error) - /* "collisions.py":2374 + /* "collisions.py":2517 * ] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2374, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 2374, __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__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(0, 2517, __pyx_L1_error) - /* "collisions.py":2386 + /* "collisions.py":2529 * ] * * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< * """ * Clone this object using the latest cloning technology. */ - __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_copy, 2386, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(0, 2386, __pyx_L1_error) + __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, 2529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(0, 2529, __pyx_L1_error) - /* "collisions.py":2392 + /* "collisions.py":2535 * 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__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__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 2392, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(0, 2392, __pyx_L1_error) + __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, 2535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(0, 2535, __pyx_L1_error) - /* "collisions.py":2406 + /* "collisions.py":2549 * ) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 2406, __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__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(0, 2549, __pyx_L1_error) - /* "collisions.py":2413 - * It is rotated around it's x and y coordinates. + /* "collisions.py":2557 * 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__254 = 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__254)) __PYX_ERR(0, 2413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__254); - __Pyx_GIVEREF(__pyx_tuple__254); - __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 7, 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_init, 2413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 2413, __pyx_L1_error) + __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, 2557, __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, 2557, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(0, 2557, __pyx_L1_error) - /* "collisions.py":2428 + /* "collisions.py":2572 * 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__256 = 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__256)) __PYX_ERR(0, 2428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__256); - __Pyx_GIVEREF(__pyx_tuple__256); - __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 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_getCache, 2428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 2428, __pyx_L1_error) + __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, 2572, __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, 2572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(0, 2572, __pyx_L1_error) - /* "collisions.py":2452 + /* "collisions.py":2596 * 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__258 = 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__258)) __PYX_ERR(0, 2452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__258); - __Pyx_GIVEREF(__pyx_tuple__258); - __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__258, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 2452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 2452, __pyx_L1_error) + __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, 2596, __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, 2596, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 2596, __pyx_L1_error) - /* "collisions.py":2462 + /* "collisions.py":2606 * 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__260 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_area, 2462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 2462, __pyx_L1_error) + __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, 2606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(0, 2606, __pyx_L1_error) - /* "collisions.py":2471 + /* "collisions.py":2615 * 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, 2615, __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, 2615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(0, 2615, __pyx_L1_error) + + /* "collisions.py":2619 + * 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__261 = 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__261)) __PYX_ERR(0, 2471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__261); - __Pyx_GIVEREF(__pyx_tuple__261); - __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 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_collides, 2471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 2471, __pyx_L1_error) + __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, 2619, __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, 2619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(0, 2619, __pyx_L1_error) - /* "collisions.py":2512 + /* "collisions.py":2653 * return othershape._collides(self) * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_toPoints, 2512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(0, 2512, __pyx_L1_error) + __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, 2653, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(0, 2653, __pyx_L1_error) - /* "collisions.py":2519 + /* "collisions.py":2660 * return self.getCache() * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_tuple__264 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ps, __pyx_n_s_i); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 2519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__264); - __Pyx_GIVEREF(__pyx_tuple__264); - __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 2519, __pyx_L1_error) + __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, 2660, __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, 2660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) __PYX_ERR(0, 2660, __pyx_L1_error) - /* "collisions.py":2530 + /* "collisions.py":2671 * ] + [Line(ps[len(ps)-1], ps[0])] * * def copy(self) -> 'RotatedRect': # <<<<<<<<<<<<<< * """ * Spawn in a duplicate object */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(0, 2530, __pyx_L1_error) + __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, 2671, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(0, 2671, __pyx_L1_error) - /* "collisions.py":2536 + /* "collisions.py":2677 * 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__267 = 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__267)) __PYX_ERR(0, 2536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__267); - __Pyx_GIVEREF(__pyx_tuple__267); - __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 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_setitem, 2536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(0, 2536, __pyx_L1_error) + __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, 2677, __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, 2677, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(0, 2677, __pyx_L1_error) - /* "collisions.py":2556 + /* "collisions.py":2697 * ) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 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_str, 2556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) __PYX_ERR(0, 2556, __pyx_L1_error) + __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, 2697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(0, 2697, __pyx_L1_error) - /* "collisions.py":2561 - * class Polygon(ClosedShape): + /* "collisions.py":2703 * """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__270 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_errorOnLT3, __pyx_n_s_bounciness, __pyx_n_s_points_2); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(0, 2561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__270); - __Pyx_GIVEREF(__pyx_tuple__270); - __pyx_codeobj__271 = (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__270, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 2561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 2561, __pyx_L1_error) + __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, 2703, __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, 2703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(0, 2703, __pyx_L1_error) - /* "collisions.py":2579 + /* "collisions.py":2721 * 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__272 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(0, 2579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__272); - __Pyx_GIVEREF(__pyx_tuple__272); - __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 2579, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(0, 2579, __pyx_L1_error) + __pyx_tuple__296 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 2721, __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, 2721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(0, 2721, __pyx_L1_error) - /* "collisions.py":2583 + /* "collisions.py":2725 * """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__274 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_new, __pyx_n_s_diff, __pyx_n_s_i); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(0, 2583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__274); - __Pyx_GIVEREF(__pyx_tuple__274); - __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__274, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 2583, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(0, 2583, __pyx_L1_error) + __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, 2725, __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, 2725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) __PYX_ERR(0, 2725, __pyx_L1_error) - /* "collisions.py":2587 + /* "collisions.py":2729 * 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__276 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 2587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(0, 2587, __pyx_L1_error) + __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, 2729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(0, 2729, __pyx_L1_error) - /* "collisions.py":2591 + /* "collisions.py":2733 * """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__277 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__274, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 2591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(0, 2591, __pyx_L1_error) + __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, 2733, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(0, 2733, __pyx_L1_error) - /* "collisions.py":2596 + /* "collisions.py":2738 * 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__278 = 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__278)) __PYX_ERR(0, 2596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__278); - __Pyx_GIVEREF(__pyx_tuple__278); - __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 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_rect, 2596, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(0, 2596, __pyx_L1_error) + __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, 2738, __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, 2738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(0, 2738, __pyx_L1_error) - /* "collisions.py":2605 + /* "collisions.py":2747 * 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__280 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 2605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(0, 2605, __pyx_L1_error) + __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, 2747, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) __PYX_ERR(0, 2747, __pyx_L1_error) - /* "collisions.py":2617 + /* "collisions.py":2759 * ) + (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_codeobj__281 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 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_collides, 2617, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 2617, __pyx_L1_error) + __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, 2759, __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, 2759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(0, 2759, __pyx_L1_error) - /* "collisions.py":2663 + /* "collisions.py":2805 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(0, 2663, __pyx_L1_error) + __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, 2805, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) __PYX_ERR(0, 2805, __pyx_L1_error) - /* "collisions.py":2673 + /* "collisions.py":2815 * ] + [Line(self.points[len(self.points)-1], self.points[0])] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2673, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(0, 2673, __pyx_L1_error) + __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, 2815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(0, 2815, __pyx_L1_error) - /* "collisions.py":2680 + /* "collisions.py":2822 * 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__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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2680, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(0, 2680, __pyx_L1_error) + __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, 2822, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(0, 2822, __pyx_L1_error) - /* "collisions.py":2686 + /* "collisions.py":2828 * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * self.points[item] = new * */ - __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 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_setitem, 2686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 2686, __pyx_L1_error) + __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, 2828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(0, 2828, __pyx_L1_error) - /* "collisions.py":2689 + /* "collisions.py":2831 * self.points[item] = new * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2689, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(0, 2689, __pyx_L1_error) + __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, 2831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(0, 2831, __pyx_L1_error) - /* "collisions.py":2695 + /* "collisions.py":2851 * """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__287 = 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__287)) __PYX_ERR(0, 2695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__287); - __Pyx_GIVEREF(__pyx_tuple__287); - __pyx_codeobj__288 = (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__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_boundingBox, 2695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(0, 2695, __pyx_L1_error) + __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, 2851, __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, 2851, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(0, 2851, __pyx_L1_error) - /* "collisions.py":2719 + /* "collisions.py":2875 * )) * * @staticmethod # <<<<<<<<<<<<<< * def combineRects(*shapes: Rect) -> Shapes: * """ */ - __pyx_tuple__289 = 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__289)) __PYX_ERR(0, 2719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__289); - __Pyx_GIVEREF(__pyx_tuple__289); - __pyx_codeobj__290 = (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__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_combineRects, 2719, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(0, 2719, __pyx_L1_error) + __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, 2875, __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, 2875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(0, 2875, __pyx_L1_error) - /* "collisions.py":2773 + /* "collisions.py":2929 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< * def union(*shapes: Shape) -> Shapes: # FIXME * """ */ - __pyx_tuple__291 = 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__138); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 2773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__291); - __Pyx_GIVEREF(__pyx_tuple__291); - __pyx_codeobj__292 = (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__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_union, 2773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(0, 2773, __pyx_L1_error) + __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, 2929, __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, 2929, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(0, 2929, __pyx_L1_error) - /* "collisions.py":2842 + /* "collisions.py":2998 * return Shapes(*outshps) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: * """ */ - __pyx_tuple__293 = 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__293)) __PYX_ERR(0, 2842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__293); - __Pyx_GIVEREF(__pyx_tuple__293); - __pyx_codeobj__294 = (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__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_pointsToShape, 2842, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(0, 2842, __pyx_L1_error) + __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, 2998, __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, 2998, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) __PYX_ERR(0, 2998, __pyx_L1_error) - /* "collisions.py":2881 + /* "collisions.py":3037 * return Polygon(*points, bounciness=bounciness) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToPoly(*points: list[Point], ratio: Number = 0.1) -> Union[Shape, Shapes]: * """ */ - __pyx_tuple__295 = PyTuple_Pack(3, __pyx_n_s_ratio, __pyx_n_s_points_2, __pyx_n_s_i); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 2881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__295); - __Pyx_GIVEREF(__pyx_tuple__295); - __pyx_codeobj__296 = (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__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_pointsToPoly, 2881, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(0, 2881, __pyx_L1_error) + __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, 3037, __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, 3037, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) __PYX_ERR(0, 3037, __pyx_L1_error) - /* "collisions.py":2897 + /* "collisions.py":3053 * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) * * @staticmethod # <<<<<<<<<<<<<< * def shapelyUnion(*shapes: Shape) -> Shape: * """ */ - __pyx_tuple__297 = PyTuple_Pack(1, __pyx_n_s_shapes); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(0, 2897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__297); - __Pyx_GIVEREF(__pyx_tuple__297); - __pyx_codeobj__298 = (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__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_shapelyUnion, 2897, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(0, 2897, __pyx_L1_error) + __pyx_tuple__322 = PyTuple_Pack(1, __pyx_n_s_shapes); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(0, 3053, __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, 3053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -105070,6 +111744,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_umethod_PyList_Type_copy.method_name = &__pyx_n_s_copy; __pyx_umethod_PyList_Type_index.type = (PyObject*)&PyList_Type; __pyx_umethod_PyList_Type_index.method_name = &__pyx_n_s_index; + __pyx_umethod_PySet_Type_intersection.type = (PyObject*)&PySet_Type; + __pyx_umethod_PySet_Type_intersection.method_name = &__pyx_n_s_intersection; if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_1 = PyFloat_FromDouble(0.1); if (unlikely(!__pyx_float_0_1)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -105086,6 +111762,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_int_270 = PyInt_FromLong(270); if (unlikely(!__pyx_int_270)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_360 = PyInt_FromLong(360); if (unlikely(!__pyx_int_360)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_3 = PyInt_FromLong(-3); if (unlikely(!__pyx_int_neg_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_4 = PyInt_FromLong(-4); if (unlikely(!__pyx_int_neg_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_5 = PyInt_FromLong(-5); if (unlikely(!__pyx_int_neg_5)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_6 = PyInt_FromLong(-6); if (unlikely(!__pyx_int_neg_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_7 = PyInt_FromLong(-7); if (unlikely(!__pyx_int_neg_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_8 = PyInt_FromLong(-8); if (unlikely(!__pyx_int_neg_8)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_9 = PyInt_FromLong(-9); if (unlikely(!__pyx_int_neg_9)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -105137,15 +111821,15 @@ 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, 612, __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, 612, __pyx_L1_error) + __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, 667, __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, 667, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct__genexpr = &__pyx_type_10collisions___pyx_scope_struct__genexpr; #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, 612, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 667, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct__genexpr->tp_print = 0; @@ -105156,15 +111840,15 @@ static int __Pyx_modinit_type_init_code(void) { } #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, 622, __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, 622, __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, 677, __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, 677, __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, 622, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 677, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_1_genexpr->tp_print = 0; @@ -105175,15 +111859,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, 622, __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, 622, __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, 677, __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, 677, __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, 622, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 677, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_2_genexpr->tp_print = 0; @@ -105194,15 +111878,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, 622, __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, 622, __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, 677, __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, 677, __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, 622, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 677, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_3_genexpr->tp_print = 0; @@ -105213,15 +111897,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, 622, __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, 622, __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, 677, __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, 677, __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, 622, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 677, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_4_genexpr->tp_print = 0; @@ -105232,15 +111916,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, 628, __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, 628, __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, 683, __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, 683, __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, 628, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 683, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_5_genexpr->tp_print = 0; @@ -105251,15 +111935,15 @@ 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, 723, __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, 723, __pyx_L1_error) + __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, 786, __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, 786, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos = &__pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos; #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, 723, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos) < 0) __PYX_ERR(0, 786, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos->tp_print = 0; @@ -105270,15 +111954,15 @@ static int __Pyx_modinit_type_init_code(void) { } #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, 986, __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, 986, __pyx_L1_error) + __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, 1053, __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, 1053, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_7_closestPointTo; #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, 986, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo) < 0) __PYX_ERR(0, 1053, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo->tp_print = 0; @@ -105289,15 +111973,15 @@ static int __Pyx_modinit_type_init_code(void) { } #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, 1060, __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, 1060, __pyx_L1_error) + __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, 1127, __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, 1127, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_8_isCorner = &__pyx_type_10collisions___pyx_scope_struct_8_isCorner; #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, 1060, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_8_isCorner) < 0) __PYX_ERR(0, 1127, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_8_isCorner->tp_print = 0; @@ -105308,440 +111992,516 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_9_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo)) __PYX_ERR(0, 1420, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_9_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo) < 0) __PYX_ERR(0, 1420, __pyx_L1_error) + __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, 1403, __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, 1403, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_9_closestPointTo; + __pyx_ptype_10collisions___pyx_scope_struct_9__contains = &__pyx_type_10collisions___pyx_scope_struct_9__contains; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo) < 0) __PYX_ERR(0, 1420, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_9__contains) < 0) __PYX_ERR(0, 1403, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_9__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_9_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_9_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos)) __PYX_ERR(0, 1469, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos_spec, __pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) + __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, 1414, __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, 1414, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos = &__pyx_type_10collisions___pyx_scope_struct_10_handleCollisionsPos; + __pyx_ptype_10collisions___pyx_scope_struct_10_genexpr = &__pyx_type_10collisions___pyx_scope_struct_10_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 1414, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_10_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_10_handleCollisionsPos->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_10_handleCollisionsPos->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_11__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_11__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_11__collides)) __PYX_ERR(0, 1703, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_11__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_11__collides) < 0) __PYX_ERR(0, 1703, __pyx_L1_error) + __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, 1507, __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, 1507, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_11__collides = &__pyx_type_10collisions___pyx_scope_struct_11__collides; + __pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_11_closestPointTo; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_11__collides) < 0) __PYX_ERR(0, 1703, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo) < 0) __PYX_ERR(0, 1507, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_11__collides->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_11_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_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; + } + #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, 1556, __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, 1556, __pyx_L1_error) + #else + __pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos = &__pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_11__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_11__collides->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_11__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos) < 0) __PYX_ERR(0, 1556, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_10collisions___pyx_scope_struct_12_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_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; + } + #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, 1792, __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, 1792, __pyx_L1_error) + #else + __pyx_ptype_10collisions___pyx_scope_struct_13__collides = &__pyx_type_10collisions___pyx_scope_struct_13__collides; + #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, 1792, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_10collisions___pyx_scope_struct_13__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_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; + } + #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, 1800, __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, 1800, __pyx_L1_error) + #else + __pyx_ptype_10collisions___pyx_scope_struct_14_genexpr = &__pyx_type_10collisions___pyx_scope_struct_14_genexpr; + #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, 1800, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_10collisions___pyx_scope_struct_14_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_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; + } + #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, 1838, __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, 1838, __pyx_L1_error) + #else + __pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_15_closestPointTo; + #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, 1838, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_10collisions___pyx_scope_struct_15_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_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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_12_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_12_genexpr)) __PYX_ERR(0, 1711, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_12_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 1711, __pyx_L1_error) + __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, 2084, __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, 2084, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_12_genexpr = &__pyx_type_10collisions___pyx_scope_struct_12_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_16_tangent = &__pyx_type_10collisions___pyx_scope_struct_16_tangent; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 1711, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_16_tangent) < 0) __PYX_ERR(0, 2084, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_12_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_16_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_12_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_12_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_12_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_13_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo)) __PYX_ERR(0, 1746, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_13_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo) < 0) __PYX_ERR(0, 1746, __pyx_L1_error) + __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, 2118, __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, 2118, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_13_closestPointTo; + __pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_17_closestPointTo; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo) < 0) __PYX_ERR(0, 1746, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo) < 0) __PYX_ERR(0, 2118, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_17_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_13_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_13_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_14_tangent = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_14_tangent_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_14_tangent)) __PYX_ERR(0, 1965, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_14_tangent_spec, __pyx_ptype_10collisions___pyx_scope_struct_14_tangent) < 0) __PYX_ERR(0, 1965, __pyx_L1_error) + __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, 2388, __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, 2388, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_14_tangent = &__pyx_type_10collisions___pyx_scope_struct_14_tangent; + __pyx_ptype_10collisions___pyx_scope_struct_18__contains = &__pyx_type_10collisions___pyx_scope_struct_18__contains; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_14_tangent) < 0) __PYX_ERR(0, 1965, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_18__contains) < 0) __PYX_ERR(0, 2388, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_14_tangent->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_18__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_14_tangent->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_14_tangent->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_14_tangent->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #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, 1999, __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, 1999, __pyx_L1_error) + __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, 2396, __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, 2396, __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_19_genexpr = &__pyx_type_10collisions___pyx_scope_struct_19_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, 1999, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_19_genexpr) < 0) __PYX_ERR(0, 2396, __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_19_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_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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_16__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_16__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_16__collides)) __PYX_ERR(0, 2331, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_16__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_16__collides) < 0) __PYX_ERR(0, 2331, __pyx_L1_error) + __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, 2474, __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, 2474, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_16__collides = &__pyx_type_10collisions___pyx_scope_struct_16__collides; + __pyx_ptype_10collisions___pyx_scope_struct_20__collides = &__pyx_type_10collisions___pyx_scope_struct_20__collides; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_16__collides) < 0) __PYX_ERR(0, 2331, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_20__collides) < 0) __PYX_ERR(0, 2474, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_16__collides->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_20__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_16__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_16__collides->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_16__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_17_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_17_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_17_genexpr)) __PYX_ERR(0, 2351, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_17_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 2351, __pyx_L1_error) + __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, 2494, __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, 2494, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_17_genexpr = &__pyx_type_10collisions___pyx_scope_struct_17_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_21_genexpr = &__pyx_type_10collisions___pyx_scope_struct_21_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 2351, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_21_genexpr) < 0) __PYX_ERR(0, 2494, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_17_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_21_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_17_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_17_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_17_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_18_getCache = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_18_getCache_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_18_getCache)) __PYX_ERR(0, 2428, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_18_getCache_spec, __pyx_ptype_10collisions___pyx_scope_struct_18_getCache) < 0) __PYX_ERR(0, 2428, __pyx_L1_error) + __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, 2572, __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, 2572, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_18_getCache = &__pyx_type_10collisions___pyx_scope_struct_18_getCache; + __pyx_ptype_10collisions___pyx_scope_struct_22_getCache = &__pyx_type_10collisions___pyx_scope_struct_22_getCache; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_18_getCache) < 0) __PYX_ERR(0, 2428, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_22_getCache) < 0) __PYX_ERR(0, 2572, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_18_getCache->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_22_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_18_getCache->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_18_getCache->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_18_getCache->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_19__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_19__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_19__collides)) __PYX_ERR(0, 2471, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_19__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_19__collides) < 0) __PYX_ERR(0, 2471, __pyx_L1_error) + __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, 2619, __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, 2619, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_19__collides = &__pyx_type_10collisions___pyx_scope_struct_19__collides; + __pyx_ptype_10collisions___pyx_scope_struct_23__collides = &__pyx_type_10collisions___pyx_scope_struct_23__collides; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_19__collides) < 0) __PYX_ERR(0, 2471, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_23__collides) < 0) __PYX_ERR(0, 2619, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_19__collides->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_23__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_19__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_19__collides->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_19__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __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, 2499, __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, 2499, __pyx_L1_error) + __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, 2640, __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, 2640, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_20_genexpr = &__pyx_type_10collisions___pyx_scope_struct_20_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_24_genexpr = &__pyx_type_10collisions___pyx_scope_struct_24_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_genexpr) < 0) __PYX_ERR(0, 2499, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_24_genexpr) < 0) __PYX_ERR(0, 2640, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_20_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_24_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_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; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_21___setitem__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_21___setitem___spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_21___setitem__)) __PYX_ERR(0, 2536, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_21___setitem___spec, __pyx_ptype_10collisions___pyx_scope_struct_21___setitem__) < 0) __PYX_ERR(0, 2536, __pyx_L1_error) + __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, 2677, __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, 2677, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_21___setitem__ = &__pyx_type_10collisions___pyx_scope_struct_21___setitem__; + __pyx_ptype_10collisions___pyx_scope_struct_25___setitem__ = &__pyx_type_10collisions___pyx_scope_struct_25___setitem__; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_21___setitem__) < 0) __PYX_ERR(0, 2536, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_25___setitem__) < 0) __PYX_ERR(0, 2677, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_21___setitem__->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_25___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_21___setitem__->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_21___setitem__->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_21___setitem__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_22_area = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_22_area_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_22_area)) __PYX_ERR(0, 2605, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_22_area_spec, __pyx_ptype_10collisions___pyx_scope_struct_22_area) < 0) __PYX_ERR(0, 2605, __pyx_L1_error) + __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, 2747, __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, 2747, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_22_area = &__pyx_type_10collisions___pyx_scope_struct_22_area; + __pyx_ptype_10collisions___pyx_scope_struct_26_area = &__pyx_type_10collisions___pyx_scope_struct_26_area; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_22_area) < 0) __PYX_ERR(0, 2605, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_26_area) < 0) __PYX_ERR(0, 2747, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_22_area->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_26_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_22_area->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_22_area->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_22_area->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_23_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_23_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_23_genexpr)) __PYX_ERR(0, 2613, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_23_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_23_genexpr) < 0) __PYX_ERR(0, 2613, __pyx_L1_error) + __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, 2755, __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, 2755, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_23_genexpr = &__pyx_type_10collisions___pyx_scope_struct_23_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_27_genexpr = &__pyx_type_10collisions___pyx_scope_struct_27_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_23_genexpr) < 0) __PYX_ERR(0, 2613, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_27_genexpr) < 0) __PYX_ERR(0, 2755, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_23_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_27_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_23_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_23_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_23_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __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, 2617, __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, 2617, __pyx_L1_error) + __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, 2759, __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, 2759, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_24__collides = &__pyx_type_10collisions___pyx_scope_struct_24__collides; + __pyx_ptype_10collisions___pyx_scope_struct_28__collides = &__pyx_type_10collisions___pyx_scope_struct_28__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__collides) < 0) __PYX_ERR(0, 2617, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_28__collides) < 0) __PYX_ERR(0, 2759, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_24__collides->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_28__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__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; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __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, 2645, __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, 2645, __pyx_L1_error) + __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, 2787, __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, 2787, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_25_genexpr = &__pyx_type_10collisions___pyx_scope_struct_25_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_29_genexpr = &__pyx_type_10collisions___pyx_scope_struct_29_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_genexpr) < 0) __PYX_ERR(0, 2645, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_29_genexpr) < 0) __PYX_ERR(0, 2787, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_25_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_29_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_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; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_26_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_26_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_26_genexpr)) __PYX_ERR(0, 2707, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_26_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_26_genexpr) < 0) __PYX_ERR(0, 2707, __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, 2863, __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, 2863, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_26_genexpr = &__pyx_type_10collisions___pyx_scope_struct_26_genexpr; + __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_26_genexpr) < 0) __PYX_ERR(0, 2707, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr) < 0) __PYX_ERR(0, 2863, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_26_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_30_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_26_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_26_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_26_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_30_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_30_genexpr->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, 2708, __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, 2708, __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, 2864, __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, 2864, __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_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_27_genexpr) < 0) __PYX_ERR(0, 2708, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr) < 0) __PYX_ERR(0, 2864, __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_31_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_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_31_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __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, 2710, __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, 2710, __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, 2866, __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, 2866, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_28_genexpr = &__pyx_type_10collisions___pyx_scope_struct_28_genexpr; + __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_28_genexpr) < 0) __PYX_ERR(0, 2710, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr) < 0) __PYX_ERR(0, 2866, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_28_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_32_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_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; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_32_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_32_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, 2711, __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, 2711, __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, 2867, __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, 2867, __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_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_29_genexpr) < 0) __PYX_ERR(0, 2711, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr) < 0) __PYX_ERR(0, 2867, __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_33_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_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_33_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_33_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_33_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_30_union = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_30_union_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_30_union)) __PYX_ERR(0, 2773, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_30_union_spec, __pyx_ptype_10collisions___pyx_scope_struct_30_union) < 0) __PYX_ERR(0, 2773, __pyx_L1_error) + __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, 2929, __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, 2929, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_30_union = &__pyx_type_10collisions___pyx_scope_struct_30_union; + __pyx_ptype_10collisions___pyx_scope_struct_34_union = &__pyx_type_10collisions___pyx_scope_struct_34_union; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_30_union) < 0) __PYX_ERR(0, 2773, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_34_union) < 0) __PYX_ERR(0, 2929, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_30_union->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_34_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_30_union->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_30_union->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_30_union->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #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, 2805, __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, 2805, __pyx_L1_error) + __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, 2961, __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, 2961, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr = &__pyx_type_10collisions___pyx_scope_struct_31_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_35_genexpr = &__pyx_type_10collisions___pyx_scope_struct_35_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, 2805, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_35_genexpr) < 0) __PYX_ERR(0, 2961, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_35_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_31_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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; } #endif __Pyx_RefNannyFinishContext(); @@ -106067,8 +112827,8 @@ if (!__Pyx_RefNanny) { /* "collisions.py":1 * import math # <<<<<<<<<<<<<< - * from enum import Enum - * from typing import Type, Union, Iterable, Any, Dict + * from enum import IntEnum + * from typing import Union, Iterable, Any, Dict */ __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); @@ -106077,55 +112837,48 @@ if (!__Pyx_RefNanny) { /* "collisions.py":2 * import math - * from enum import Enum # <<<<<<<<<<<<<< - * from typing import Type, Union, Iterable, Any, Dict + * from enum import IntEnum # <<<<<<<<<<<<<< + * from typing import Union, Iterable, Any, Dict * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_Enum); - __Pyx_GIVEREF(__pyx_n_s_Enum); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Enum)) __PYX_ERR(0, 2, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_s_IntEnum); + __Pyx_GIVEREF(__pyx_n_s_IntEnum); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_IntEnum)) __PYX_ERR(0, 2, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Enum, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IntEnum, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "collisions.py":3 * import math - * from enum import Enum - * from typing import Type, Union, Iterable, Any, Dict # <<<<<<<<<<<<<< + * from enum import IntEnum + * from typing import Union, Iterable, Any, Dict # <<<<<<<<<<<<<< * * # Just for utility funcs, not the actual collision library */ - __pyx_t_3 = PyList_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_Type); - __Pyx_GIVEREF(__pyx_n_s_Type); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Type)) __PYX_ERR(0, 3, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Union); __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Union)) __PYX_ERR(0, 3, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Union)) __PYX_ERR(0, 3, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Iterable); __Pyx_GIVEREF(__pyx_n_s_Iterable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Iterable)) __PYX_ERR(0, 3, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Iterable)) __PYX_ERR(0, 3, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Any); __Pyx_GIVEREF(__pyx_n_s_Any); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_Any)) __PYX_ERR(0, 3, __pyx_L1_error); + 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, 4, __pyx_n_s_Dict)) __PYX_ERR(0, 3, __pyx_L1_error); + 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; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Type); 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_Type, __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_Union); 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_Union, __pyx_t_3) < 0) __PYX_ERR(0, 3, __pyx_L1_error) @@ -106258,7 +113011,7 @@ if (!__Pyx_RefNanny) { * import shapely.ops as shapelyOps * */ - __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_shapely_geometry, __pyx_tuple__36); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 11, __pyx_L1_error) + __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_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; @@ -106270,7 +113023,7 @@ if (!__Pyx_RefNanny) { * * Number = Union[int, float] */ - __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_shapely_ops, __pyx_tuple__37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error) + __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_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; @@ -106383,7 +113136,7 @@ if (!__Pyx_RefNanny) { * 'rotate', * 'rotateBy0', */ - __pyx_t_2 = PyList_New(21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_t_2 = PyList_New(22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_u_rotate); __Pyx_GIVEREF(__pyx_n_u_rotate); @@ -106409,1768 +113162,2061 @@ if (!__Pyx_RefNanny) { __Pyx_INCREF(__pyx_n_u_ShpGroups); __Pyx_GIVEREF(__pyx_n_u_ShpGroups); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_u_ShpGroups)) __PYX_ERR(0, 21, __pyx_L1_error); + __Pyx_INCREF(__pyx_n_u_ShpTyps); + __Pyx_GIVEREF(__pyx_n_u_ShpTyps); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 8, __pyx_n_u_ShpTyps)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_checkShpType); __Pyx_GIVEREF(__pyx_n_u_checkShpType); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 8, __pyx_n_u_checkShpType)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 9, __pyx_n_u_checkShpType)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_ClosedShape); __Pyx_GIVEREF(__pyx_n_u_ClosedShape); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 9, __pyx_n_u_ClosedShape)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 10, __pyx_n_u_ClosedShape)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_Shape); __Pyx_GIVEREF(__pyx_n_u_Shape); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 10, __pyx_n_u_Shape)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 11, __pyx_n_u_Shape)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_NoShape); __Pyx_GIVEREF(__pyx_n_u_NoShape); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 11, __pyx_n_u_NoShape)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 12, __pyx_n_u_NoShape)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_Shapes); __Pyx_GIVEREF(__pyx_n_u_Shapes); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 12, __pyx_n_u_Shapes)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 13, __pyx_n_u_Shapes)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_Point); __Pyx_GIVEREF(__pyx_n_u_Point); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 13, __pyx_n_u_Point)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 14, __pyx_n_u_Point)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_Line); __Pyx_GIVEREF(__pyx_n_u_Line); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 14, __pyx_n_u_Line)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 15, __pyx_n_u_Line)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_Circle); __Pyx_GIVEREF(__pyx_n_u_Circle); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 15, __pyx_n_u_Circle)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 16, __pyx_n_u_Circle)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_Arc); __Pyx_GIVEREF(__pyx_n_u_Arc); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 16, __pyx_n_u_Arc)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 17, __pyx_n_u_Arc)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_Rect); __Pyx_GIVEREF(__pyx_n_u_Rect); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 17, __pyx_n_u_Rect)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 18, __pyx_n_u_Rect)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_RotatedRect); __Pyx_GIVEREF(__pyx_n_u_RotatedRect); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 18, __pyx_n_u_RotatedRect)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 19, __pyx_n_u_RotatedRect)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_Polygon); __Pyx_GIVEREF(__pyx_n_u_Polygon); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 19, __pyx_n_u_Polygon)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 20, __pyx_n_u_Polygon)) __PYX_ERR(0, 21, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_ShapeCombiner); __Pyx_GIVEREF(__pyx_n_u_ShapeCombiner); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 20, __pyx_n_u_ShapeCombiner)) __PYX_ERR(0, 21, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 21, __pyx_n_u_ShapeCombiner)) __PYX_ERR(0, 21, __pyx_L1_error); if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":48 + /* "collisions.py":49 * ] * * def checkForPygame(): # <<<<<<<<<<<<<< * 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__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __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__40)); 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, 48, __pyx_L1_error) + 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; - /* "collisions.py":54 + /* "collisions.py":55 * ) * * def rotate(origin: pointLike, point: pointLike, angle: Number) -> pointLike: # <<<<<<<<<<<<<< * """ * Rotate a point clockwise by a given angle around a given origin. */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_origin, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 54, __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__40)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_origin, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + 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_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate, __pyx_t_7) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate, __pyx_t_7) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":77 + /* "collisions.py":78 * return qx, qy * * def rotateBy0(point: pointLike, angle: Number) -> pointLike: # <<<<<<<<<<<<<< * """ * Rotate a point clockwise by a given angle around the origin. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __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, 77, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 77, __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__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + 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_GOTREF(__pyx_t_2); __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_rotateBy0, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotateBy0, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":96 + /* "collisions.py":97 * return qx, qy * * def direction(fromPoint: pointLike, toPoint: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the direction of `toPoint` from the origin of `fromPoint` */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fromPoint, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 96, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_toPoint, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 96, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 96, __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__44)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error) + 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_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_direction, __pyx_t_7) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_direction, __pyx_t_7) < 0) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":109 + /* "collisions.py":110 * return math.atan2(toPoint[1]-fromPoint[1], toPoint[0]-fromPoint[0]) * * def pointOnCircle(angle: Number, strength: Number=1) -> pointLike: # <<<<<<<<<<<<<< * """ * Finds the point on the unit circle at a given angle with a given strength */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 109, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_strength, __pyx_n_s_Number) < 0) __PYX_ERR(0, 109, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 109, __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__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + 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_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__47); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__49); __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, 109, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pointOnCircle, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":122 + /* "collisions.py":123 * return math.cos(angle)*strength, math.sin(angle)*strength * - * class ShpGroups(Enum): # <<<<<<<<<<<<<< + * class ShpGroups(IntEnum): # <<<<<<<<<<<<<< * """ * An enum representing the different groups you can put shapes in. */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __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, 122, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 123, __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, 122, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __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, 122, __pyx_L1_error) + __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_2, __pyx_n_s_ShpGroups, __pyx_n_s_ShpGroups, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_An_enum_representing_the_differ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_2, __pyx_n_s_ShpGroups, __pyx_n_s_ShpGroups, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_An_enum_representing_the_differ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2 != __pyx_t_7) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 122, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 123, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":126 + /* "collisions.py":127 * An enum representing the different groups you can put shapes in. * """ * CLOSED = 0 # <<<<<<<<<<<<<< * """These shapes start in one spot and end in the same spot""" * LINES = 1 */ - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CLOSED, __pyx_int_0) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CLOSED, __pyx_int_0) < 0) __PYX_ERR(0, 127, __pyx_L1_error) - /* "collisions.py":128 + /* "collisions.py":129 * CLOSED = 0 * """These shapes start in one spot and end in the same spot""" * LINES = 1 # <<<<<<<<<<<<<< * """Shapes that make the outer edges of other shapes""" - * GROUP = 2 + * NOTSTRAIGHT = 2 */ - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LINES, __pyx_int_1) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LINES, __pyx_int_1) < 0) __PYX_ERR(0, 129, __pyx_L1_error) - /* "collisions.py":130 + /* "collisions.py":131 * LINES = 1 * """Shapes that make the outer edges of other shapes""" - * GROUP = 2 # <<<<<<<<<<<<<< + * NOTSTRAIGHT = 2 # <<<<<<<<<<<<<< + * """Shapes that are not straight; e.g. Circles""" + * GROUP = 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 # <<<<<<<<<<<<<< * """A group of other shapes""" * */ - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GROUP, __pyx_int_2) < 0) __PYX_ERR(0, 130, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GROUP, __pyx_int_3) < 0) __PYX_ERR(0, 133, __pyx_L1_error) - /* "collisions.py":122 + /* "collisions.py":123 * return math.cos(angle)*strength, math.sin(angle)*strength * - * class ShpGroups(Enum): # <<<<<<<<<<<<<< + * class ShpGroups(IntEnum): # <<<<<<<<<<<<<< * """ * An enum representing the different groups you can put shapes in. */ - __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ShpGroups, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ShpGroups, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShpGroups, __pyx_t_7) < 0) __PYX_ERR(0, 122, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShpGroups, __pyx_t_7) < 0) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":133 + /* "collisions.py":136 * """A group of other shapes""" * - * def checkShpType(shape: Union['Shape', 'Shapes'], typs: Union[Type, ShpGroups, Iterable[Union[Type, ShpGroups]]]) -> bool: # <<<<<<<<<<<<<< + * class ShpTyps(IntEnum): # <<<<<<<<<<<<<< * """ - * Checks to see if a shape is of a certain type or group. + * An enum representing the different possible shapes. */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __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, 133, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_typs, __pyx_kp_s_Union_Type_ShpGroups_Iterable_Un) < 0) __PYX_ERR(0, 133, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 133, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11checkShpType, 0, __pyx_n_s_checkShpType, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_checkShpType, __pyx_t_8) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 136, __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_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_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_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) + } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":153 + /* "collisions.py":140 + * 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) + + /* "collisions.py":141 + * """ + * 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) + + /* "collisions.py":142 + * 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) + + /* "collisions.py":143 + * 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) + + /* "collisions.py":144 + * 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) + + /* "collisions.py":145 + * 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) + + /* "collisions.py":146 + * 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) + + /* "collisions.py":147 + * 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) + + /* "collisions.py":148 + * 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) + + /* "collisions.py":136 + * """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_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShpTyps, __pyx_t_8) < 0) __PYX_ERR(0, 136, __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 + * 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_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) + __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) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":168 * return False * * def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: # <<<<<<<<<<<<<< * """ * Converts a shapely shape to a BlazeSudio Shape. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapelyShape, __pyx_kp_s_shapelyGeom_base_BaseGeometry) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes) < 0) __PYX_ERR(0, 153, __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__51)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __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) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_shapelyToColl, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + __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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":175 + /* "collisions.py":190 * 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, 175, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __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, 175, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_shapelyGeom_base_BaseGeometry) < 0) __PYX_ERR(0, 175, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_15collToShapely, 0, __pyx_n_s_collToShapely, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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) + __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_8) < 0) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_collToShapely, __pyx_t_3) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":197 + /* "collisions.py":212 * 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_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_surface, __pyx_n_s_Any) < 0) __PYX_ERR(0, 197, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 197, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_colour, __pyx_kp_s_tuple_int_int_int) < 0) __PYX_ERR(0, 197, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_width, __pyx_n_s_int) < 0) __PYX_ERR(0, 197, __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__55)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __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) __Pyx_GOTREF(__pyx_t_2); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 197, __pyx_L1_error) - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 197, __pyx_L1_error) + 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) __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_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_drawShape, __pyx_t_2) < 0) __PYX_ERR(0, 197, __pyx_L1_error) + __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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":242 + /* "collisions.py":257 * 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, 242, __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, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __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, 242, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 242, __pyx_L1_error) - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_annotations, __pyx_t_8) < 0) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __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, 257, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 257, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_annotations, __pyx_t_3) < 0) __PYX_ERR(0, 257, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":245 + /* "collisions.py":260 * """The base Shape class. This defaults to always collide. * This class always collides; so *can* be used as an infinite plane, but why?""" - * GROUPS = [] # <<<<<<<<<<<<<< + * GROUPS = set() # <<<<<<<<<<<<<< + * TYPE = ShpTyps.NoShape * x: Number = 0 - * y: Number = 0 */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_GROUPS, __pyx_t_8) < 0) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __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, 260, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":246 + /* "collisions.py":261 * This class always collides; so *can* be used as an infinite plane, but why?""" - * GROUPS = [] + * 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, 261, __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, 261, __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, 261, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":262 + * 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, 246, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_x, __pyx_int_0) < 0) __PYX_ERR(0, 262, __pyx_L1_error) - /* "collisions.py":247 - * GROUPS = [] + /* "collisions.py":263 + * 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, 247, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_y, __pyx_int_0) < 0) __PYX_ERR(0, 263, __pyx_L1_error) - /* "collisions.py":248 + /* "collisions.py":264 * x: Number = 0 * y: Number = 0 * def __init__(self, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 248, __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__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults1), 0)) __PYX_ERR(0, 248, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __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, 248, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 264, __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, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults1), 0)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __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, 264, __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_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 248, __pyx_L1_error) + __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, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":255 + /* "collisions.py":271 * 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, 255, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __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, 255, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 255, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_3collides, 0, __pyx_n_s_Shape_collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 271, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 271, __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, 271, __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_8) < 0) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_collides_2, __pyx_t_7) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":272 + /* "collisions.py":288 * return False * * def whereCollides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds where this shape collides with another shape(s) */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __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) < 0) __PYX_ERR(0, 272, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 272, __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__61)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __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, 288, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 288, __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, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_whereCollides, __pyx_t_3) < 0) __PYX_ERR(0, 272, __pyx_L1_error) + __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, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":289 + /* "collisions.py":305 * 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, 305, __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, 305, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 305, __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, 305, __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, 305, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":322 + * return False + * * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< * """ * Finds the distance between this shape and another shape. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __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, 322, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 322, __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, 322, __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, 289, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 289, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_7distance_to, 0, __pyx_n_s_Shape_distance_to, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_distance_to, __pyx_t_8) < 0) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":303 + /* "collisions.py":336 * 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_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 303, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 303, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_9check_rects, 0, __pyx_n_s_Shape_check_rects, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_check_rects, __pyx_t_3) < 0) __PYX_ERR(0, 303, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 336, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 336, __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, 336, __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, 336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":318 + /* "collisions.py":351 * 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_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_11__repr__, 0, __pyx_n_s_Shape___repr, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_3) < 0) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 351, __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, 351, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":321 + /* "collisions.py":354 * * # Replace these * def _collides(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * return True * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __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, 354, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 354, __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, 354, __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, 321, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 321, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_13_collides, 0, __pyx_n_s_Shape__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 354, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_collides, __pyx_t_8) < 0) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":324 + /* "collisions.py":357 * return True * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: # <<<<<<<<<<<<<< * return [] * */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 324, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 324, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_15_where, 0, __pyx_n_s_Shape__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_where, __pyx_t_3) < 0) __PYX_ERR(0, 324, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 357, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 357, __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, 357, __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, 357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":327 + /* "collisions.py":360 * return [] * + * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< + * return True + * + */ + __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, 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_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, 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_contains, __pyx_t_3) < 0) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":363 + * 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, 327, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); 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, 327, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 327, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 327, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_17closestPointTo, 0, __pyx_n_s_Shape_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__73); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); + 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_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 363, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 363, __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, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__77); + __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_8) < 0) __PYX_ERR(0, 327, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_closestPointTo, __pyx_t_7) < 0) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":342 + /* "collisions.py":378 * 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_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __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, 342, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 342, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 342, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_19isCorner, 0, __pyx_n_s_Shape_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_3)->__pyx_arg_precision = __pyx_t_7; - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 378, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 378, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 378, __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, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 378, __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); + __pyx_t_8 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_22__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isCorner, __pyx_t_3) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + __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, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":355 + /* "collisions.py":391 * 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, 355, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __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, 355, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 355, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 355, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_21tangent, 0, __pyx_n_s_Shape_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 391, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 391, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 391, __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, 391, __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_8) < 0) __PYX_ERR(0, 355, __pyx_L1_error) - __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, 391, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":368 + /* "collisions.py":404 * return math.degrees(math.atan2(vel[1], vel[0])) % 360 * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 368, __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, 368, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_23toLines, 0, __pyx_n_s_Shape_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __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, 404, __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, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_toLines, __pyx_t_3) < 0) __PYX_ERR(0, 368, __pyx_L1_error) + __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, 404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":375 + /* "collisions.py":411 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __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, 375, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_25toPoints, 0, __pyx_n_s_Shape_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 411, __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, 411, __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_8) < 0) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_toPoints, __pyx_t_7) < 0) __PYX_ERR(0, 411, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":382 + /* "collisions.py":418 * return [] * * 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, 382, __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, 382, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_27area, 0, __pyx_n_s_Shape_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __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, 418, __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, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 382, __pyx_L1_error) + __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, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":391 + /* "collisions.py":427 * 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, 391, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __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, 391, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_29rect, 0, __pyx_n_s_Shape_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 427, __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, 427, __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_8) < 0) __PYX_ERR(0, 391, __pyx_L1_error) - __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, 427, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":400 + /* "collisions.py":436 * 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_8 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_oldP, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 400, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_newP, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 400, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape) < 0) __PYX_ERR(0, 400, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 400, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 400, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_tuple_Shape_pointLike_verboseOut) < 0) __PYX_ERR(0, 400, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_31handleCollisionsPos, 0, __pyx_n_s_Shape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 400, __pyx_L1_error) - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __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, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_newP, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_tuple_Shape_pointLike_verboseOut) < 0) __PYX_ERR(0, 436, __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, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 436, __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_7, 0, __pyx_int_0)) __PYX_ERR(0, 400, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_int_0)) __PYX_ERR(0, 436, __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, 400, __pyx_L1_error); - __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_3)->__pyx_arg_vel = __pyx_t_7; - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_int_0)) __PYX_ERR(0, 436, __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_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_handleCollisionsPos, __pyx_t_3) < 0) __PYX_ERR(0, 400, __pyx_L1_error) + __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, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":408 + /* "collisions.py":444 * 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, 408, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __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, 408, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape) < 0) __PYX_ERR(0, 408, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 408, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Shape_pointLike_verboseOut) < 0) __PYX_ERR(0, 408, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_33handleCollisionsVel, 0, __pyx_n_s_Shape_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__73); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 444, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape) < 0) __PYX_ERR(0, 444, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 444, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Shape_pointLike_verboseOut) < 0) __PYX_ERR(0, 444, __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, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__77); + __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_8) < 0) __PYX_ERR(0, 408, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_handleCollisionsVel, __pyx_t_7) < 0) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":416 + /* "collisions.py":452 * return self, vel * * def copy(self) -> 'Shape': # <<<<<<<<<<<<<< * """ * Copy this shape to return another with the same properties */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_35copy, 0, __pyx_n_s_Shape_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __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, 452, __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, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_copy, __pyx_t_3) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + __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, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":422 + /* "collisions.py":458 * 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, 422, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __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, 422, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 422, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_37__getitem__, 0, __pyx_n_s_Shape___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_it, __pyx_n_s_int) < 0) __PYX_ERR(0, 458, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 458, __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, 458, __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_8) < 0) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_7) < 0) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":425 + /* "collisions.py":461 * return 0 * * def __setitem__(self, it: int, new: Number) -> None: # <<<<<<<<<<<<<< * pass * */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_it, __pyx_n_s_int) < 0) __PYX_ERR(0, 425, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 425, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 425, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_39__setitem__, 0, __pyx_n_s_Shape___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 461, __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, 461, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 461, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 461, __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, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_3) < 0) __PYX_ERR(0, 425, __pyx_L1_error) + __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, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":428 + /* "collisions.py":464 * pass * * def __iter__(self): # <<<<<<<<<<<<<< * return iter([]) * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_41__iter__, 0, __pyx_n_s_Shape___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __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__95)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __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, 428, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_3) < 0) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":431 + /* "collisions.py":467 * return iter([]) * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_43__str__, 0, __pyx_n_s_Shape___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __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__96)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __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, 431, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_3) < 0) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":242 + /* "collisions.py":257 * 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, 242, __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, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Shape, __pyx_t_3) < 0) __PYX_ERR(0, 242, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Shape, __pyx_t_3) < 0) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":434 + /* "collisions.py":470 * 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, 434, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __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, 434, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 470, __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, 434, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __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, 434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __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_7)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 470, __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, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_2 != __pyx_t_3) { - if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 434, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 470, __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, 434, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "collisions.py":436 + /* "collisions.py":472 * 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__93)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 436, __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__97)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 472, __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_7, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":439 + /* "collisions.py":475 * 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, 439, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 475, __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, 439, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 439, __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__94)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 475, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 475, __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, 475, __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_7, __pyx_n_s_collides, __pyx_t_11) < 0) __PYX_ERR(0, 439, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_collides, __pyx_t_11) < 0) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":442 + /* "collisions.py":478 * 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, 442, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 478, __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, 442, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 442, __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__95)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 442, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 478, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 478, __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, 478, __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_7, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":445 + /* "collisions.py":481 * return [] * - * def area(self) -> Number: # <<<<<<<<<<<<<< - * """ - * Gets the area of the shape; 0. + * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< + * return False + * */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 445, __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_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 445, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_7area, 0, __pyx_n_s_NoShape_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 445, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 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_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, 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_7, __pyx_n_s_area, __pyx_t_11) < 0) __PYX_ERR(0, 445, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_contains, __pyx_t_11) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "collisions.py":484 + * 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, 484, __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, 484, __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, 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_area, __pyx_t_10) < 0) __PYX_ERR(0, 484, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":454 + /* "collisions.py":493 * return 0 * * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< * """Make a copy of this non-existant shape""" * return NoShape() */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_NoShape_3) < 0) __PYX_ERR(0, 454, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_9copy, 0, __pyx_n_s_NoShape_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 493, __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_7, __pyx_n_s_copy, __pyx_t_10) < 0) __PYX_ERR(0, 454, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_NoShape_3) < 0) __PYX_ERR(0, 493, __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, 493, __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, 493, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":458 + /* "collisions.py":497 * return NoShape() * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_11__str__, 0, __pyx_n_s_NoShape___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_str, __pyx_t_10) < 0) __PYX_ERR(0, 458, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 497, __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, 497, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":434 + /* "collisions.py":470 * 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_10 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_NoShape, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_3, __pyx_t_10) < 0) __PYX_ERR(0, 434, __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, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_3, __pyx_t_11) < 0) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoShape, __pyx_t_10) < 0) __PYX_ERR(0, 434, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoShape, __pyx_t_11) < 0) __PYX_ERR(0, 470, __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":461 + /* "collisions.py":500 * 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] + * 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, 461, __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, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":463 + /* "collisions.py":502 * class Shapes: * """A class which holds multiple shapes and can be used to do things with all of them at once.""" - * GROUPS = [ShpGroups.GROUP] # <<<<<<<<<<<<<< + * GROUPS = {ShpGroups.GROUP} # <<<<<<<<<<<<<< + * TYPE = ShpTyps.Group * def __init__(self, *shapes: Shape): - * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __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, 502, __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, 463, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + if (PySet_Add(__pyx_t_7, __pyx_t_8) < 0) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 463, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_GROUPS, __pyx_t_7) < 0) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":503 + * """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): + * """ + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __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, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 463, __pyx_L1_error); - __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_GROUPS, __pyx_t_8) < 0) __PYX_ERR(0, 463, __pyx_L1_error) + __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, 503, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":464 - * """A class which holds multiple shapes and can be used to do things with all of them at once.""" - * GROUPS = [ShpGroups.GROUP] + /* "collisions.py":504 + * GROUPS = {ShpGroups.GROUP} + * TYPE = ShpTyps.Group * def __init__(self, *shapes: Shape): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __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, 464, __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__100)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 504, __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, 504, __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_init, __pyx_t_7) < 0) __PYX_ERR(0, 464, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":474 + /* "collisions.py":514 * 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, 474, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __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, 474, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 474, __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__102)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 474, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 514, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 514, __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, 514, __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, 474, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_add_shape, __pyx_t_8) < 0) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":483 + /* "collisions.py":523 * 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, 483, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __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, 483, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 483, __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__103)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 523, __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, 523, __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, 483, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_add_shapes, __pyx_t_7) < 0) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":495 + /* "collisions.py":535 * 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, 495, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 535, __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, 495, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 495, __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__104)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 535, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 535, __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, 535, __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, 495, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_remove_shape, __pyx_t_8) < 0) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":504 + /* "collisions.py":544 * 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, 504, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __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, 504, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 504, __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__106)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 544, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 544, __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, 544, __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, 504, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_remove_shapes, __pyx_t_7) < 0) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":517 + /* "collisions.py":557 * self.shapes.remove(s) * - * def collides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< + * 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, 517, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 557, __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, 517, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 517, __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__107)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 517, __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, 557, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 557, __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, 557, __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, 517, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_collides_2, __pyx_t_8) < 0) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":532 + /* "collisions.py":572 * return False * - * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * 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, 532, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __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, 532, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 532, __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__109)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __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, 572, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 572, __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, 572, __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, 532, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_whereCollides, __pyx_t_7) < 0) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":547 + /* "collisions.py":587 * 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. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 587, __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, 547, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 547, __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__111)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 587, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 587, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 587, __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, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__73); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__77); __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, 547, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_closestPointTo, __pyx_t_8) < 0) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":569 - * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) + /* "collisions.py":607 + * return points * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> Dict[Union[Shape,'Shapes'], bool]: # <<<<<<<<<<<<<< + * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< * """ - * Takes each object and finds whether the input point is on the corner of that object. + * 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(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 607, __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, 569, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 569, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Dict_Union_Shape_Shapes_bool) < 0) __PYX_ERR(0, 569, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_17isCorner, 0, __pyx_n_s_Shapes_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __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, 607, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 607, __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, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults4), 1)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_7)->__pyx_arg_precision = __pyx_t_10; - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; - __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_isCorner, __pyx_t_7) < 0) __PYX_ERR(0, 569, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isContaining, __pyx_t_7) < 0) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":585 - * return cs + /* "collisions.py":624 + * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) * - * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> Dict[Union[Shape,'Shapes'], bool]: # <<<<<<<<<<<<<< * """ - * Finds the tangent on each of these objects for the specified point. -90 = normal. + * Takes each object and finds whether the input point is on the corner of that object. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 624, __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, 585, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 585, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 585, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_19tangent, 0, __pyx_n_s_Shapes_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 585, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 624, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 624, __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, 624, __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, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults4), 1)) __PYX_ERR(0, 624, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_CyFunction_Defaults(__pyx_defaults4, __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_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_tangent, __pyx_t_8) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isCorner, __pyx_t_8) < 0) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":605 - * # TODO: to_points and to_lines + /* "collisions.py":640 + * return cs * - * def area(self) -> Number: # <<<<<<<<<<<<<< + * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ - * Gets the combined area of all the shapes. + * Finds the tangent on each of these objects for the specified point. -90 = normal. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 605, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 640, __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, 605, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_21area, 0, __pyx_n_s_Shapes_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 605, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 640, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 640, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 640, __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, 640, __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_area, __pyx_t_7) < 0) __PYX_ERR(0, 605, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tangent, __pyx_t_7) < 0) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":614 - * return sum(s.area() for s in self.shapes) + /* "collisions.py":660 + * # TODO: to_points and to_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. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 614, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_23rect, 0, __pyx_n_s_Shapes_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 614, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 660, __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, 660, __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_rect, __pyx_t_8) < 0) __PYX_ERR(0, 614, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":624 - * 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":669 + * 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. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 624, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 669, __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, 624, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_25copy, 0, __pyx_n_s_Shapes_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 624, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 669, __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, 669, __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, __pyx_t_7) < 0) __PYX_ERR(0, 624, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":630 - * return Shapes(s.copy() for s in self.shapes) + /* "collisions.py":679 + * 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': # <<<<<<<<<<<<<< * """ - * Makes a copy of this class but keeps the same 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, 630, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __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, 630, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_27copy_leave_shapes, 0, __pyx_n_s_Shapes_copy_leave_shapes, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Shapes_2) < 0) __PYX_ERR(0, 679, __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, 679, __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_leave_shapes, __pyx_t_8) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":636 + /* "collisions.py":685 + * 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, 685, __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, 685, __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, 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_copy_leave_shapes, __pyx_t_7) < 0) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":691 * return Shapes(*self.shapes) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self.shapes) * */ - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_29__iter__, 0, __pyx_n_s_Shapes___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_8) < 0) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 691, __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, 691, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":639 + /* "collisions.py":694 * 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, 694, __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, 694, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":697 + * return len(self.shapes) + * * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< * return self.shapes[index] * */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 639, __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, 639, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes_2) < 0) __PYX_ERR(0, 639, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_31__getitem__, 0, __pyx_n_s_Shapes___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 697, __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_getitem, __pyx_t_7) < 0) __PYX_ERR(0, 639, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_index, __pyx_n_s_int) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes_2) < 0) __PYX_ERR(0, 697, __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, 697, __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, 697, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":642 + /* "collisions.py":700 * return self.shapes[index] * * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< * self.shapes[index] = new * */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __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, 642, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_kp_s_Union_Shape_Shapes_2) < 0) __PYX_ERR(0, 642, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 642, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_33__setitem__, 0, __pyx_n_s_Shapes___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__126)); 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, 700, __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_setitem, __pyx_t_8) < 0) __PYX_ERR(0, 642, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_index, __pyx_n_s_int) < 0) __PYX_ERR(0, 700, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_new, __pyx_kp_s_Union_Shape_Shapes_2) < 0) __PYX_ERR(0, 700, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 700, __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, 700, __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, 700, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":645 + /* "collisions.py":703 * self.shapes[index] = new * * def __repr__(self): return str(self) # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_35__repr__, 0, __pyx_n_s_Shapes___repr, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_8) < 0) __PYX_ERR(0, 645, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 703, __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, 703, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":647 + /* "collisions.py":705 * def __repr__(self): return str(self) * * def __str__(self): # <<<<<<<<<<<<<< - * return f'' - * + * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") + * return f'' */ - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_37__str__, 0, __pyx_n_s_Shapes___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_8) < 0) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 705, __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, 705, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":461 + /* "collisions.py":500 * 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] + * GROUPS = {ShpGroups.GROUP} */ - __pyx_t_8 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Shapes, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Shapes, __pyx_t_8) < 0) __PYX_ERR(0, 461, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Shapes, __pyx_t_7) < 0) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":654 + /* "collisions.py":713 * # 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.""" - * def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 713, __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, 654, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 713, __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, 654, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __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, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_n_s_Point, __pyx_n_s_Point, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_An_infintesimally_small_point_in); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 654, __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, 654, __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, 654, __pyx_L1_error) + __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 713, __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, 713, __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, 713, __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, 713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); - /* "collisions.py":656 + /* "collisions.py":714 + * * 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, 714, __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, 714, __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, 714, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "collisions.py":716 + * 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_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 716, __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, 716, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 716, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 716, __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, 716, __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, 656, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 656, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 656, __pyx_L1_error) - __pyx_t_11 = __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__130)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_t_11); - PyList_Append(__pyx_t_8, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, sizeof(__pyx_defaults5), 0)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 656, __pyx_L1_error) + __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, 716, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 716, __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, 656, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_11)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_10collisions_28__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + __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_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, 716, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_init, __pyx_t_11) < 0) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":666 + /* "collisions.py":726 * self.x, self.y = x, y * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this point. */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __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, 666, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_3rect, 0, __pyx_n_s_Point_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __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_rect, __pyx_t_3) < 0) __PYX_ERR(0, 666, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 726, __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, 726, __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, 726, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":675 + /* "collisions.py":735 * return self.x, self.y, self.x, self.y * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; 0. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 735, __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, 735, __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, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 675, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_5area, 0, __pyx_n_s_Point_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __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, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_area, __pyx_t_11) < 0) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":684 + /* "collisions.py":744 * return 0.0 * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 684, __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, 684, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_7toPoints, 0, __pyx_n_s_Point_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __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, 684, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 744, __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, 744, __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, 744, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":691 + /* "collisions.py":751 * return [self] * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return self.x == othershape.x and self.y == othershape.y */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); 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_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 751, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 751, __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, 751, __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, 691, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 691, __pyx_L1_error) - __pyx_t_11 = __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__134)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __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, 751, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_collides, __pyx_t_11) < 0) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":696 + /* "collisions.py":756 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 696, __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, 696, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 696, __pyx_L1_error) - __pyx_t_3 = __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__135)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __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_where, __pyx_t_3) < 0) __PYX_ERR(0, 696, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 756, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 756, __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, 756, __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, 756, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":701 + /* "collisions.py":761 * 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_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 761, __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, 761, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 761, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 761, __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, 761, __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, 701, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_13closestPointTo, 0, __pyx_n_s_Point_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_tuple__73); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__77); + __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, 761, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_closestPointTo, __pyx_t_11) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":716 + /* "collisions.py":776 * return (self.x, self.y) * * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< * """ * Gets this object in a tuple format: (x, y). */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_tuple_Number) < 0) __PYX_ERR(0, 716, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_15getTuple, 0, __pyx_n_s_Point_getTuple, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __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_getTuple, __pyx_t_3) < 0) __PYX_ERR(0, 716, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Number) < 0) __PYX_ERR(0, 776, __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, 776, __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, 776, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":723 + /* "collisions.py":783 * 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, 783, __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, 783, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 783, __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, 783, __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, 783, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":786 + * 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, 723, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __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, 723, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_newPoint, __pyx_kp_s_Union_Point_pointLike) < 0) __PYX_ERR(0, 723, __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, 723, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 723, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 723, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 723, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 723, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 723, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_17handleCollisionsPos, 0, __pyx_n_s_Point_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, sizeof(__pyx_defaults6), 2)) __PYX_ERR(0, 723, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_oldPoint, __pyx_kp_s_Union_Point_pointLike) < 0) __PYX_ERR(0, 786, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_newPoint, __pyx_kp_s_Union_Point_pointLike) < 0) __PYX_ERR(0, 786, __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, 786, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 786, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 786, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 786, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 786, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 786, __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, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults6), 2)) __PYX_ERR(0, 786, __pyx_L1_error) - /* "collisions.py":727 + /* "collisions.py":790 * 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, 727, __pyx_L1_error) + __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 790, __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, 727, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0)) __PYX_ERR(0, 790, __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, 727, __pyx_L1_error); - __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_11)->__pyx_arg_vel = __pyx_t_12; + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_int_0)) __PYX_ERR(0, 790, __pyx_L1_error); + __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_10)->__pyx_arg_vel = __pyx_t_12; __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":729 + /* "collisions.py":792 * 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, 729, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_11)->__pyx_arg_precision = __pyx_t_12; + __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_10)->__pyx_arg_precision = __pyx_t_12; __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_10collisions_30__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_30__defaults__); + __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_handleCollisionsPos, __pyx_t_11) < 0) __PYX_ERR(0, 723, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_handleCollisionsPos, __pyx_t_10) < 0) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":791 + /* "collisions.py":854 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes,Iterable[Shape]], */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 791, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 791, __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, 791, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 791, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 791, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 791, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 791, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_19handleCollisionsVel, 0, __pyx_n_s_Point_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 854, __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, 854, __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, 854, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 854, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 854, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 854, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 854, __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, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults7), 1)) __PYX_ERR(0, 791, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults7), 1)) __PYX_ERR(0, 854, __pyx_L1_error) - /* "collisions.py":795 + /* "collisions.py":858 * 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, 795, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_Defaults(__pyx_defaults7, __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_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_handleCollisionsVel, __pyx_t_3) < 0) __PYX_ERR(0, 791, __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_handleCollisionsVel, __pyx_t_3) < 0) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":821 + /* "collisions.py":884 * 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, 821, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __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, 821, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_21copy, 0, __pyx_n_s_Point_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 821, __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_Point_3) < 0) __PYX_ERR(0, 884, __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, 884, __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, 821, __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, 884, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":827 + /* "collisions.py":890 * return Point(self.x, self.y, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 827, __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, 827, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 827, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_23__getitem__, 0, __pyx_n_s_Point___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 890, __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, 890, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 890, __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, 890, __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_getitem, __pyx_t_3) < 0) __PYX_ERR(0, 827, __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_getitem, __pyx_t_3) < 0) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":837 + /* "collisions.py":900 * ) * * 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, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 900, __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, 837, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 837, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 837, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_25__setitem__, 0, __pyx_n_s_Point___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 837, __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_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 900, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 900, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 900, __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, 900, __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_setitem, __pyx_t_11) < 0) __PYX_ERR(0, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_setitem, __pyx_t_10) < 0) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":847 + /* "collisions.py":910 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter([self.x, self.y]) * */ - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_27__iter__, 0, __pyx_n_s_Point___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_iter, __pyx_t_11) < 0) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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, 910, __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, 910, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":850 + /* "collisions.py":913 * return iter([self.x, self.y]) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_29__str__, 0, __pyx_n_s_Point___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_str, __pyx_t_11) < 0) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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, 913, __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, 913, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":654 + /* "collisions.py":713 * # 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.""" - * def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): */ - __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Point, __pyx_t_2, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_8, __pyx_t_11) < 0) __PYX_ERR(0, 654, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Point, __pyx_t_11) < 0) __PYX_ERR(0, 654, __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_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, 713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_7, __pyx_t_10) < 0) __PYX_ERR(0, 713, __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, 713, __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":853 + /* "collisions.py":916 * return f'' * * class Line(Shape): # <<<<<<<<<<<<<< * """A line segment object defined by a start and an end point.""" - * GROUPS = [ShpGroups.LINES] + * GROUPS = {ShpGroups.LINES} */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 853, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 916, __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, 853, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __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, 853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __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_11)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 916, __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, 853, __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, 916, __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, 916, __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, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "collisions.py":918 + * 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, 918, __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, 918, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + if (PySet_Add(__pyx_t_7, __pyx_t_3) < 0) __PYX_ERR(0, 918, __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, 918, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":855 - * class Line(Shape): + /* "collisions.py":919 * """A line segment object defined by a start and an end point.""" - * GROUPS = [ShpGroups.LINES] # <<<<<<<<<<<<<< + * GROUPS = {ShpGroups.LINES} + * TYPE = ShpTyps.Line # <<<<<<<<<<<<<< * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_LINES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 919, __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, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 855, __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, 855, __pyx_L1_error); - __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_GROUPS, __pyx_t_8) < 0) __PYX_ERR(0, 855, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 919, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":856 - * """A line segment object defined by a start and an end point.""" - * GROUPS = [ShpGroups.LINES] + /* "collisions.py":920 + * GROUPS = {ShpGroups.LINES} + * TYPE = ShpTyps.Line * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_p1, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_p2, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - __pyx_t_3 = __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__151)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __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_defaults8), 0)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 856, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_p1, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 920, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_p2, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 920, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 920, __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, 920, __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, 920, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 920, __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, 856, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_3)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_34__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 856, __pyx_L1_error) + __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_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, 920, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":866 + /* "collisions.py":930 * 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_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 930, __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, 930, __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, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 866, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_3area, 0, __pyx_n_s_Line_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 930, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 866, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":875 + /* "collisions.py":939 * 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_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_5x, 0, __pyx_n_s_Line_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 875, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __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__162)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 939, __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, 939, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":879 + /* "collisions.py":943 * """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_t_8 = PyObject_GetItem(__pyx_t_11, __pyx_n_s_x); - if (unlikely(!__pyx_t_8)) { + __pyx_t_3 = PyObject_GetItem(__pyx_t_10, __pyx_n_s_x); + if (unlikely(!__pyx_t_3)) { PyErr_Clear(); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_x); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_x); } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 879, __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, 879, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __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, 943, __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_4Line_7x, 0, __pyx_n_s_Line_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __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, 943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = NULL; __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS @@ -108186,2080 +115232,2330 @@ if (!__Pyx_RefNanny) { } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_8}; - __pyx_t_3 = __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_3}; + __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_3)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 943, __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_3) < 0) __PYX_ERR(0, 879, __pyx_L1_error) - __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, 943, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":885 + /* "collisions.py":949 * 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_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_9y, 0, __pyx_n_s_Line_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 885, __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__165)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 949, __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, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 885, __pyx_L1_error) + __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, 949, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":889 + /* "collisions.py":953 * """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_t_3 = PyObject_GetItem(__pyx_t_11, __pyx_n_s_y); - if (unlikely(!__pyx_t_3)) { + __pyx_t_7 = PyObject_GetItem(__pyx_t_10, __pyx_n_s_y); + if (unlikely(!__pyx_t_7)) { PyErr_Clear(); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_y); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_y); } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 889, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_11y, 0, __pyx_n_s_Line_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __pyx_L1_error) + 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_setter); 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 = __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, 953, __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_8))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_14 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_3}; - __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_7}; + __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":897 + /* "collisions.py":961 * # 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__159)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 897, __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__168)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_onSegment, __pyx_t_8) < 0) __PYX_ERR(0, 897, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_onSegment, __pyx_t_3) < 0) __PYX_ERR(0, 961, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":912 + /* "collisions.py":976 * 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_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 912, __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, 912, __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__160)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 912, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __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, 976, __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, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_rect, __pyx_t_12) < 0) __PYX_ERR(0, 912, __pyx_L1_error) + __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, 976, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":921 + /* "collisions.py":985 * 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, 921, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 985, __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, 921, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_17toLines, 0, __pyx_n_s_Line_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 921, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_Line) < 0) __PYX_ERR(0, 985, __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, 985, __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_11, __pyx_n_s_toLines, __pyx_t_8) < 0) __PYX_ERR(0, 921, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_toLines, __pyx_t_3) < 0) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":928 + /* "collisions.py":992 * return [self] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 928, __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, 928, __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__162)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __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, 992, __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, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_toPoints, __pyx_t_12) < 0) __PYX_ERR(0, 928, __pyx_L1_error) + __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, 992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":935 + /* "collisions.py":999 * 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, 999, __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, 999, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 999, __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, 999, __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, 999, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":1002 + * return False + * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __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, 1002, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1002, __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, 1002, __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, 935, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 935, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_21_collides, 0, __pyx_n_s_Line__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 1002, __pyx_L1_error) __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, 935, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":962 + /* "collisions.py":1029 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 962, __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, 962, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 962, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_23_where, 0, __pyx_n_s_Line__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_where, __pyx_t_12) < 0) __PYX_ERR(0, 962, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1029, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1029, __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, 1029, __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, 1029, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":986 + /* "collisions.py":1053 * 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_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 986, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __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, 1053, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1053, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 1053, __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, 1053, __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, 986, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 986, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 986, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_25closestPointTo, 0, __pyx_n_s_Line_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__73); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_12); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__77); + __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, 1053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_closestPointTo, __pyx_t_8) < 0) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1060 + /* "collisions.py":1127 * 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_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1060, __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, 1060, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1060, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1060, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_27isCorner, 0, __pyx_n_s_Line_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1060, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults9), 1)) __PYX_ERR(0, 1060, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1127, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1127, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1127, __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, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_t_12)->__pyx_arg_precision = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_10collisions_36__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_isCorner, __pyx_t_12) < 0) __PYX_ERR(0, 1060, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults9), 1)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_Defaults(__pyx_defaults9, __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_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, 1127, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1075 + /* "collisions.py":1142 * 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_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1075, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __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, 1142, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1142, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1142, __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, 1142, __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, 1075, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1075, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1075, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_29tangent, 0, __pyx_n_s_Line_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 1142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_tangent, __pyx_t_8) < 0) __PYX_ERR(0, 1075, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1100 + /* "collisions.py":1167 * return [(phi-180)%360, phi % 360][tries.index(min(tries))] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldLine: 'Line', * newLine: 'Line', */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_oldLine, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_newLine, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1100, __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, 1100, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_tuple_Line_pointLike_verboseOutp) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_31handleCollisionsPos, 0, __pyx_n_s_Line_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults10), 2)) __PYX_ERR(0, 1100, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_oldLine, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1167, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_newLine, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1167, __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, 1167, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1167, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1167, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1167, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1167, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_tuple_Line_pointLike_verboseOutp) < 0) __PYX_ERR(0, 1167, __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, 1167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults10), 2)) __PYX_ERR(0, 1167, __pyx_L1_error) - /* "collisions.py":1104 + /* "collisions.py":1171 * newLine: 'Line', * objs: Union[Shapes, Iterable[Shape]], * vel: pointLike = [0, 0], # <<<<<<<<<<<<<< * replaceSelf: bool = True, * precision: Number = BASEPRECISION, */ - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1171, __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_3, 0, __pyx_int_0)) __PYX_ERR(0, 1104, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_0)) __PYX_ERR(0, 1171, __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, 1104, __pyx_L1_error); - __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_12)->__pyx_arg_vel = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_0)) __PYX_ERR(0, 1171, __pyx_L1_error); + __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_3)->__pyx_arg_vel = __pyx_t_7; + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; - /* "collisions.py":1106 + /* "collisions.py":1173 * vel: pointLike = [0, 0], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['Line', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_12)->__pyx_arg_precision = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_10collisions_38__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_handleCollisionsPos, __pyx_t_12) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1173, __pyx_L1_error) + __Pyx_GOTREF(__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_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_handleCollisionsPos, __pyx_t_3) < 0) __PYX_ERR(0, 1167, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1231 + /* "collisions.py":1304 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __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, 1304, __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, 1304, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Line_pointLike_verboseOutp) < 0) __PYX_ERR(0, 1304, __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, 1304, __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, 1231, __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, 1231, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1231, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1231, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1231, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_tuple_Line_pointLike_verboseOutp) < 0) __PYX_ERR(0, 1231, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_33handleCollisionsVel, 0, __pyx_n_s_Line_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults11), 1)) __PYX_ERR(0, 1231, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults11), 1)) __PYX_ERR(0, 1304, __pyx_L1_error) - /* "collisions.py":1235 + /* "collisions.py":1308 * objs: Union[Shapes, Iterable[Shape]], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['Line', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_8)->__pyx_arg_precision = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_40__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_12); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_Defaults(__pyx_defaults11, __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_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, 1304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_handleCollisionsVel, __pyx_t_8) < 0) __PYX_ERR(0, 1231, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1263 + /* "collisions.py":1336 * return out, outvel * * def copy(self) -> 'Line': # <<<<<<<<<<<<<< * """ * Make a copy of the Line with the same values! */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1263, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_35copy, 0, __pyx_n_s_Line_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1263, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); - __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, 1263, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1336, __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, 1336, __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, 1336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1269 + /* "collisions.py":1342 * return Line(self.p1, self.p2, self.bounciness) * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< * if item == 0: * return self.p1 */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __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, 1342, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1342, __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, 1342, __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, 1269, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_37__getitem__, 0, __pyx_n_s_Line___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 1342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_getitem, __pyx_t_8) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1279 + /* "collisions.py":1352 * ) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.p1 = new */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1279, __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, 1279, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_39__setitem__, 0, __pyx_n_s_Line___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_setitem, __pyx_t_12) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1352, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1352, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 1352, __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, 1352, __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, 1352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1289 + /* "collisions.py":1362 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.p1, self.p2)) * */ - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_41__iter__, 0, __pyx_n_s_Line___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_iter, __pyx_t_12) < 0) __PYX_ERR(0, 1289, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __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, 1362, __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, 1362, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1292 + /* "collisions.py":1365 * return iter((self.p1, self.p2)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_43__str__, 0, __pyx_n_s_Line___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_str, __pyx_t_12) < 0) __PYX_ERR(0, 1292, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __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, 1365, __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, 1365, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":853 + /* "collisions.py":916 * return f'' * * class Line(Shape): # <<<<<<<<<<<<<< * """A line segment object defined by a start and an end point.""" - * GROUPS = [ShpGroups.LINES] + * GROUPS = {ShpGroups.LINES} */ - __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_Line, __pyx_t_2, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_7, __pyx_t_12) < 0) __PYX_ERR(0, 853, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Line, __pyx_t_12) < 0) __PYX_ERR(0, 853, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_8, __pyx_t_3) < 0) __PYX_ERR(0, 916, __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, 916, __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":1295 + /* "collisions.py":1368 * 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, 1295, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1368, __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, 1295, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 1368, __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, 1295, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __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, 1295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __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_12)) __PYX_ERR(0, 1295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__pyx_t_2 != __pyx_t_10) { - if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(0, 1295, __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, 1295, __pyx_L1_error) + __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1368, __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, 1368, __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, 1368, __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, 1368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); - /* "collisions.py":1299 + /* "collisions.py":1372 * 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] # <<<<<<<<<<<<<< + * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} # <<<<<<<<<<<<<< + * TYPE = ShpTyps.Circle * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): - * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1299, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1372, __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, 1372, __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, 1372, __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, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1299, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PySet_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + if (PySet_Add(__pyx_t_8, __pyx_t_12) < 0) __PYX_ERR(0, 1372, __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, 1372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1299, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GROUPS, __pyx_t_8) < 0) __PYX_ERR(0, 1372, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "collisions.py":1373 + * `.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, 1373, __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, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_8)) __PYX_ERR(0, 1299, __pyx_L1_error); - __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GROUPS, __pyx_t_7) < 0) __PYX_ERR(0, 1299, __pyx_L1_error) + __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, 1373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1300 - * `.toLines()` or `.toPoints()` it will return an empty list; so please check for it *before* closed shapes.""" - * GROUPS = [ShpGroups.CLOSED] + /* "collisions.py":1374 + * 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, 1300, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __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, 1300, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1300, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_r, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1300, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 1300, __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__183)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1300, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_r, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 1374, __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, 1374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_8); - PyList_Append(__pyx_t_10, __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, 1300, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults12), 0)) __PYX_ERR(0, 1374, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1374, __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, 1374, __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_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 1300, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1311 + /* "collisions.py":1385 * self.x, self.y, self.r = x, y, r * * 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, 1311, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1385, __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, 1311, __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__184)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1311, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 1385, __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, 1385, __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_12, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 1311, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 1385, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1320 + /* "collisions.py":1394 * 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, 1320, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1394, __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, 1320, __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__185)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1320, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1394, __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, 1394, __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_12, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 1320, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 1394, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1329 + /* "collisions.py":1403 * return math.pi * self.r**2 * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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, 1329, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1403, __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, 1329, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1329, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_7_collides, 0, __pyx_n_s_Circle__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1329, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1403, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1403, __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, 1403, __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_12, __pyx_n_s_collides, __pyx_t_7) < 0) __PYX_ERR(0, 1329, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_contains, __pyx_t_7) < 0) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1349 - * return othershape._collides(self) + /* "collisions.py":1416 + * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + * 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, 1349, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1416, __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, 1349, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1349, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_9_where, 0, __pyx_n_s_Circle__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1349, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1416, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1416, __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, 1416, __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_12, __pyx_n_s_where, __pyx_t_8) < 0) __PYX_ERR(0, 1349, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_collides, __pyx_t_8) < 0) __PYX_ERR(0, 1416, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "collisions.py":1436 + * 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, 1436, __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, 1436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1436, __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, 1436, __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, 1436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1420 + /* "collisions.py":1507 * 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_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1420, __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, 1420, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1420, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 1420, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_11closestPointTo, 0, __pyx_n_s_Circle_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__73); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __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, 1420, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1507, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1507, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 1507, __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, 1507, __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_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, 1507, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1469 + /* "collisions.py":1556 * return self.closestPointTo(Point(*ps[0])) * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldCir: 'Circle', * newCir: 'Circle', */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_oldCir, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_newCir, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1469, __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, 1469, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_13handleCollisionsPos, 0, __pyx_n_s_Circle_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1469, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults13), 2)) __PYX_ERR(0, 1469, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_oldCir, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1556, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_newCir, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1556, __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, 1556, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1556, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1556, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1556, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1556, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 1556, __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, 1556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults13), 2)) __PYX_ERR(0, 1556, __pyx_L1_error) - /* "collisions.py":1473 + /* "collisions.py":1560 * newCir: 'Circle', * objs: Union[Shapes, Iterable[Shape]], * vel: pointLike = [0,0], # <<<<<<<<<<<<<< * replaceSelf: bool = True, * precision: Number = BASEPRECISION, */ - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1560, __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_3, 0, __pyx_int_0)) __PYX_ERR(0, 1473, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0)) __PYX_ERR(0, 1560, __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, 1473, __pyx_L1_error); - __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_8)->__pyx_arg_vel = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_int_0)) __PYX_ERR(0, 1560, __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; - /* "collisions.py":1475 + /* "collisions.py":1562 * vel: pointLike = [0,0], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple[pointLike, pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_8)->__pyx_arg_precision = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __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_12, __pyx_n_s_handleCollisionsPos, __pyx_t_8) < 0) __PYX_ERR(0, 1469, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1562, __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, 1556, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1564 + /* "collisions.py":1652 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes,Iterable[Shape]], */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1564, __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, 1564, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1564, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1564, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1564, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_tuple_Circle_pointLike_verboseOu) < 0) __PYX_ERR(0, 1564, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_15handleCollisionsVel, 0, __pyx_n_s_Circle_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1564, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults14), 1)) __PYX_ERR(0, 1564, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1652, __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, 1652, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1652, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1652, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1652, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_tuple_Circle_pointLike_verboseOu) < 0) __PYX_ERR(0, 1652, __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, 1652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults14), 1)) __PYX_ERR(0, 1652, __pyx_L1_error) - /* "collisions.py":1568 + /* "collisions.py":1656 * objs: Union[Shapes,Iterable[Shape]], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['Circle', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_7)->__pyx_arg_precision = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_46__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_handleCollisionsVel, __pyx_t_7) < 0) __PYX_ERR(0, 1564, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1656, __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_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, 1652, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1594 + /* "collisions.py":1682 * 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. + * 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_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1594, __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, 1594, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1594, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1594, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_17isCorner, 0, __pyx_n_s_Circle_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults15), 1)) __PYX_ERR(0, 1594, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_t_8)->__pyx_arg_precision = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_48__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_isCorner, __pyx_t_8) < 0) __PYX_ERR(0, 1594, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1682, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1682, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1682, __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, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults15), 1)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1682, __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, 1682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1607 + /* "collisions.py":1695 * 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_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1607, __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, 1607, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1607, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1607, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_19tangent, 0, __pyx_n_s_Circle_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1607, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1695, __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_12, __pyx_n_s_tangent, __pyx_t_7) < 0) __PYX_ERR(0, 1607, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1695, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1695, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1695, __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, 1695, __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_3, __pyx_n_s_tangent, __pyx_t_8) < 0) __PYX_ERR(0, 1695, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1622 + /* "collisions.py":1710 * 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_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1622, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_21copy, 0, __pyx_n_s_Circle_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1622, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1710, __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_12, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(0, 1622, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1710, __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, 1710, __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, 1710, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1628 + /* "collisions.py":1716 * return Circle(self.x, self.y, self.r, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1628, __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, 1628, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1628, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_23__getitem__, 0, __pyx_n_s_Circle___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1628, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1716, __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_12, __pyx_n_s_getitem, __pyx_t_7) < 0) __PYX_ERR(0, 1628, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1716, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1716, __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, 1716, __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_3, __pyx_n_s_getitem, __pyx_t_8) < 0) __PYX_ERR(0, 1716, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1640 + /* "collisions.py":1728 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1640, __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, 1640, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1640, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 1640, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_25__setitem__, 0, __pyx_n_s_Circle___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1640, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1728, __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_12, __pyx_n_s_setitem, __pyx_t_8) < 0) __PYX_ERR(0, 1640, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1728, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1728, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 1728, __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, 1728, __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, 1728, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1652 + /* "collisions.py":1740 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.r)) * */ - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_27__iter__, 0, __pyx_n_s_Circle___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_iter, __pyx_t_8) < 0) __PYX_ERR(0, 1652, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 1740, __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, 1740, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1655 + /* "collisions.py":1743 * return iter((self.x, self.y, self.r)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_29__str__, 0, __pyx_n_s_Circle___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_str, __pyx_t_8) < 0) __PYX_ERR(0, 1655, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 1743, __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, 1743, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1295 + /* "collisions.py":1368 * 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_8 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_Circle, __pyx_t_2, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_10, __pyx_t_8) < 0) __PYX_ERR(0, 1295, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Circle, __pyx_t_8) < 0) __PYX_ERR(0, 1295, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __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, 1368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_11, __pyx_t_7) < 0) __PYX_ERR(0, 1368, __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, 1368, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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":1658 + /* "collisions.py":1746 * 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, 1658, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 1658, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2)) __PYX_ERR(0, 1746, __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, 1658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __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_8)) __PYX_ERR(0, 1658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_2 != __pyx_t_11) { - if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(0, 1658, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1746, __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, 1746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_2 != __pyx_t_10) { + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(0, 1746, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1663 + /* "collisions.py":1751 * * **ANGLES ARE MEASURED IN DEGREES.**""" - * GROUPS = [ShpGroups.LINES] # <<<<<<<<<<<<<< + * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} # <<<<<<<<<<<<<< + * TYPE = ShpTyps.Arc * def __init__(self, - * x: Number, */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_LINES); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1663, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1663, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_LINES); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_10)) __PYX_ERR(0, 1663, __pyx_L1_error); - __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_GROUPS, __pyx_t_11) < 0) __PYX_ERR(0, 1663, __pyx_L1_error) + __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, 1751, __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, 1751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PySet_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PySet_Add(__pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 1751, __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, 1751, __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, 1751, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1664 + /* "collisions.py":1752 * **ANGLES ARE MEASURED IN DEGREES.**""" - * GROUPS = [ShpGroups.LINES] + * 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, 1752, __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, 1752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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, 1752, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "collisions.py":1753 + * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} + * TYPE = ShpTyps.Arc * def __init__(self, # <<<<<<<<<<<<<< * x: Number, * y: Number, */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1664, __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, 1664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_rad, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_startAngle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_endAngle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 1664, __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__203)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1664, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1753, __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, 1753, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1753, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_rad, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1753, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_startAngle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1753, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_endAngle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1753, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1753, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 1753, __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, 1753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults16), 1)) __PYX_ERR(0, 1664, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults16), 1)) __PYX_ERR(0, 1753, __pyx_L1_error) - /* "collisions.py":1670 + /* "collisions.py":1759 * startAngle: Number, * endAngle: Number, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * bounciness: float = BASEBOUNCINESS * ): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_t_10)->__pyx_arg_precision = __pyx_t_7; - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_t_10)->__pyx_arg_precision = __pyx_t_11; + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; - /* "collisions.py":1671 + /* "collisions.py":1760 * endAngle: Number, * precision: Number = BASEPRECISION, * bounciness: float = BASEBOUNCINESS # <<<<<<<<<<<<<< * ): * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1671, __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, 1671, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1760, __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, 1760, __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_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 1664, __pyx_L1_error) + __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, 1753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1690 + /* "collisions.py":1779 * 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, 1690, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1779, __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, 1690, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_3area, 0, __pyx_n_s_Arc_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1690, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1779, __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, 1779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_area, __pyx_t_11) < 0) __PYX_ERR(0, 1690, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 1779, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1703 + /* "collisions.py":1792 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * 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_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1703, __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, 1703, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1703, __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__207)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1703, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1792, __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, 1792, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1792, __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, 1792, __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_collides, __pyx_t_10) < 0) __PYX_ERR(0, 1703, __pyx_L1_error) + __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, 1792, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1727 + /* "collisions.py":1816 * 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__208)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1727, __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__220)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_flip, __pyx_t_10) < 0) __PYX_ERR(0, 1727, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_flip, __pyx_t_10) < 0) __PYX_ERR(0, 1816, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1733 + /* "collisions.py":1822 * 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, 1822, __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, 1822, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1822, __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, 1822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 1822, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "collisions.py":1825 + * return False + * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, Point): + * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1733, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1825, __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, 1825, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1825, __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, 1825, __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, 1733, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1733, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_9_where, 0, __pyx_n_s_Arc__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __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, 1825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_where, __pyx_t_11) < 0) __PYX_ERR(0, 1733, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":1746 + /* "collisions.py":1838 * 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_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1746, __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, 1746, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1746, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 1746, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_11closestPointTo, 0, __pyx_n_s_Arc_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1746, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__73); - __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_closestPointTo, __pyx_t_10) < 0) __PYX_ERR(0, 1746, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1838, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1838, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 1838, __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, 1838, __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); __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, 1838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1828 + /* "collisions.py":1920 * 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_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1828, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1920, __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, 1920, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1920, __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, 1920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_phi, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1828, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1828, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_13constrainAng, 0, __pyx_n_s_Arc_constrainAng, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __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, 1920, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_constrainAng, __pyx_t_11) < 0) __PYX_ERR(0, 1828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":1848 + /* "collisions.py":1940 * return phi * * def angleInRange(self, angle: Number) -> bool: # <<<<<<<<<<<<<< * """ * Check to see if an angle is in the range of this arc. */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1848, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1848, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_15angleInRange, 0, __pyx_n_s_Arc_angleInRange, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1848, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1940, __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_angleInRange, __pyx_t_10) < 0) __PYX_ERR(0, 1848, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1940, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1940, __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, 1940, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 1940, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1864 + /* "collisions.py":1956 * return self.startAng <= angle%360 <= self.endAng * * def endPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Gets the end points of the arc */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1864, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1956, __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, 1956, __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, 1956, __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, 1864, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_17endPoints, 0, __pyx_n_s_Arc_endPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __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, 1956, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_endPoints, __pyx_t_11) < 0) __PYX_ERR(0, 1864, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":1876 + /* "collisions.py":1968 * (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_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1876, __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, 1876, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_19rect, 0, __pyx_n_s_Arc_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1876, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1968, __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_rect, __pyx_t_10) < 0) __PYX_ERR(0, 1876, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 1968, __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, 1968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 1968, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1903 + /* "collisions.py":1995 * 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, 1995, __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, 1995, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1995, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1995, __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, 1995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults17), 1)) __PYX_ERR(0, 1995, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1995, __pyx_L1_error) + __Pyx_GOTREF(__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; + __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, 1995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "collisions.py":2012 + * 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, 2012, __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, 2012, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "collisions.py":2022 + * ] + * * 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, 1903, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2022, __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, 1903, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_21copy, 0, __pyx_n_s_Arc_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1903, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Arc_3) < 0) __PYX_ERR(0, 2022, __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, 2022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __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, 1903, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(0, 2022, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1909 + /* "collisions.py":2028 * 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_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1909, __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, 1909, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Union_Number_pointLike) < 0) __PYX_ERR(0, 1909, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_23__getitem__, 0, __pyx_n_s_Arc___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1909, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2028, __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, 2028, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Union_Number_pointLike) < 0) __PYX_ERR(0, 2028, __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, 2028, __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_getitem, __pyx_t_10) < 0) __PYX_ERR(0, 1909, __pyx_L1_error) + __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, 2028, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1925 + /* "collisions.py":2044 * ) * * 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, 1925, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2044, __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, 1925, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_new, __pyx_kp_s_Union_Number_pointLike) < 0) __PYX_ERR(0, 1925, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 1925, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_25__setitem__, 0, __pyx_n_s_Arc___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2044, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_new, __pyx_kp_s_Union_Number_pointLike) < 0) __PYX_ERR(0, 2044, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2044, __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, 2044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_setitem, __pyx_t_11) < 0) __PYX_ERR(0, 1925, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_setitem, __pyx_t_8) < 0) __PYX_ERR(0, 2044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1941 + /* "collisions.py":2060 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * */ - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_27__iter__, 0, __pyx_n_s_Arc___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_iter, __pyx_t_11) < 0) __PYX_ERR(0, 1941, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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, 2060, __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, 2060, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1944 + /* "collisions.py":2063 * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_29__str__, 0, __pyx_n_s_Arc___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1944, __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, 1944, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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, 2063, __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, 2063, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1658 + /* "collisions.py":1746 * 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_11 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_n_s_Arc, __pyx_t_2, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Arc, __pyx_t_11) < 0) __PYX_ERR(0, 1658, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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, 1746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Arc, __pyx_t_8) < 0) __PYX_ERR(0, 1746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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":1947 + /* "collisions.py":2066 * 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, 1947, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 1947, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1947, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __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, 1947, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2066, __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, 2066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __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_11)) __PYX_ERR(0, 1947, __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, 1947, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_3) { + if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 2066, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1950 + /* "collisions.py":2069 * """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} # <<<<<<<<<<<<<< * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if not self.check_rects(othershape): */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1950, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2069, __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, 2069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_10)) __PYX_ERR(0, 1950, __pyx_L1_error); - __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_GROUPS, __pyx_t_12) < 0) __PYX_ERR(0, 1950, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PySet_Add(__pyx_t_3, __pyx_t_10) < 0) __PYX_ERR(0, 2069, __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, 2069, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1951 + /* "collisions.py":2070 * 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} * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return [] */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1951, __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, 1951, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1951, __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__227)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1951, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2070, __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, 2070, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2070, __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, 2070, __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_11, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 1951, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __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, 2070, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1965 + /* "collisions.py":2084 * 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, 1965, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2084, __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, 1965, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1965, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1965, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_3tangent, 0, __pyx_n_s_ClosedShape_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1965, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2084, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2084, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2084, __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, 2084, __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_tangent, __pyx_t_12) < 0) __PYX_ERR(0, 1965, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_tangent, __pyx_t_3) < 0) __PYX_ERR(0, 2084, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1999 + /* "collisions.py":2118 * 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_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1999, __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, 1999, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1999, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 1999, __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__231)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1999, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2118, __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, 2118, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2118, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 2118, __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, 2118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__73); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_closestPointTo, __pyx_t_10) < 0) __PYX_ERR(0, 1999, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__77); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __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, 2118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2079 + /* "collisions.py":2198 * 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, 2079, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2198, __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, 2079, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_newShp, __pyx_kp_s_ClosedShape_2) < 0) __PYX_ERR(0, 2079, __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, 2079, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2079, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2079, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2079, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2079, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_tuple_ClosedShape_pointLike_verb) < 0) __PYX_ERR(0, 2079, __pyx_L1_error) - __pyx_t_12 = __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__233)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults17), 2)) __PYX_ERR(0, 2079, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_oldShp, __pyx_kp_s_ClosedShape_2) < 0) __PYX_ERR(0, 2198, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_newShp, __pyx_kp_s_ClosedShape_2) < 0) __PYX_ERR(0, 2198, __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, 2198, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2198, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2198, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2198, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2198, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_tuple_ClosedShape_pointLike_verb) < 0) __PYX_ERR(0, 2198, __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, 2198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults18), 2)) __PYX_ERR(0, 2198, __pyx_L1_error) - /* "collisions.py":2083 + /* "collisions.py":2202 * newShp: 'ClosedShape', * 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, 2083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __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, 2083, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_int_0)) __PYX_ERR(0, 2202, __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, 2083, __pyx_L1_error); - __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_t_12)->__pyx_arg_vel = __pyx_t_7; - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_int_0)) __PYX_ERR(0, 2202, __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; - /* "collisions.py":2085 + /* "collisions.py":2204 * vel: pointLike = [0, 0], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['ClosedShape', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2085, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults17, __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_52__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_10); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2204, __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_11, __pyx_n_s_handleCollisionsPos, __pyx_t_12) < 0) __PYX_ERR(0, 2079, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_handleCollisionsPos, __pyx_t_3) < 0) __PYX_ERR(0, 2198, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2226 + /* "collisions.py":2351 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2226, __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, 2226, __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, 2226, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2226, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2226, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2226, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_tuple_ClosedShape_pointLike_verb) < 0) __PYX_ERR(0, 2226, __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__235)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2226, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2351, __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, 2351, __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, 2351, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2351, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2351, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2351, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_ClosedShape_pointLike_verb) < 0) __PYX_ERR(0, 2351, __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, 2351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults18), 1)) __PYX_ERR(0, 2226, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults19), 1)) __PYX_ERR(0, 2351, __pyx_L1_error) - /* "collisions.py":2230 + /* "collisions.py":2355 * objs: Union[Shapes, Iterable[Shape]], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['ClosedShape', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_t_10)->__pyx_arg_precision = __pyx_t_7; - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_54__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_handleCollisionsVel, __pyx_t_10) < 0) __PYX_ERR(0, 2226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2355, __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_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, 2351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2260 + /* "collisions.py":2385 * 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, 2385, __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, 2385, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2385, __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, 2385, __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, 2385, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":2388 + * 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, 2388, __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, 2388, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2388, __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, 2388, __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_8, __pyx_n_s_contains, __pyx_t_10) < 0) __PYX_ERR(0, 2388, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "collisions.py":2398 + * 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, 2260, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2398, __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, 2260, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2260, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2260, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_11isCorner, 0, __pyx_n_s_ClosedShape_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults19), 1)) __PYX_ERR(0, 2260, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults19, __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_56__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2398, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2398, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2398, __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, 2398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults20), 1)) __PYX_ERR(0, 2398, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2398, __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_11, __pyx_n_s_isCorner, __pyx_t_12) < 0) __PYX_ERR(0, 2260, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_isCorner, __pyx_t_3) < 0) __PYX_ERR(0, 2398, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2276 + /* "collisions.py":2414 * return False * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2276, __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, 2276, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_13toLines, 0, __pyx_n_s_ClosedShape_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2276, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2414, __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, 2414, __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, 2414, __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_11, __pyx_n_s_toLines, __pyx_t_10) < 0) __PYX_ERR(0, 2276, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __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, 2414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2283 + /* "collisions.py":2421 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2283, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2421, __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, 2283, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_15toPoints, 0, __pyx_n_s_ClosedShape_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2421, __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, 2421, __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_toPoints, __pyx_t_12) < 0) __PYX_ERR(0, 2283, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_toPoints, __pyx_t_3) < 0) __PYX_ERR(0, 2421, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2290 + /* "collisions.py":2428 * return [] * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< * return self.toPoints()[item] * */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2290, __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, 2290, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2290, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_17__getitem__, 0, __pyx_n_s_ClosedShape___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2290, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2428, __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, 2428, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2428, __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, 2428, __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_11, __pyx_n_s_getitem, __pyx_t_10) < 0) __PYX_ERR(0, 2290, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __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, 2428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2293 + /* "collisions.py":2431 * return self.toPoints()[item] * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self.toPoints()) * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19__iter__, 0, __pyx_n_s_ClosedShape___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2293, __pyx_L1_error) + __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, 2431, __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, 2293, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_iter, __pyx_t_10) < 0) __PYX_ERR(0, 2431, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2296 + /* "collisions.py":2434 * return iter(self.toPoints()) * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_21__str__, 0, __pyx_n_s_ClosedShape___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2296, __pyx_L1_error) + __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, 2434, __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, 2296, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_str, __pyx_t_10) < 0) __PYX_ERR(0, 2434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1947 + /* "collisions.py":2066 * 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_8, __pyx_n_s_ClosedShape, __pyx_t_2, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1947, __pyx_L1_error) + __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, 2066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ClosedShape, __pyx_t_10) < 0) __PYX_ERR(0, 1947, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ClosedShape, __pyx_t_10) < 0) __PYX_ERR(0, 2066, __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_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2299 + /* "collisions.py":2437 * return '' * * class Rect(ClosedShape): # <<<<<<<<<<<<<< * """A Rectangle. It is defined with an x, y, width and height.""" - * def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = BASEBOUNCINESS): + * TYPE = ShpTyps.Rect */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2299, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2437, __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, 2299, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 2437, __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, 2299, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2437, __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, 2299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __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, 2299, __pyx_L1_error) + __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2437, __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, 2437, __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, 2299, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_7) { + if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 2437, __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, 2299, __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, 2437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "collisions.py":2439 + * 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, 2439, __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, 2439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __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, 2439, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2301 - * class Rect(ClosedShape): + /* "collisions.py":2440 * """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_12 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2301, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2301, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_w, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2301, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_h, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2301, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2301, __pyx_L1_error) - __pyx_t_7 = __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__244)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2301, __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_defaults20), 0)) __PYX_ERR(0, 2301, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2301, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2440, __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, 2440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_w, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_h, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2440, __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, 2440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2301, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_t_7)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_58__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); + __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_defaults21), 0)) __PYX_ERR(0, 2440, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2440, __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, 2440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 2301, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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, 2440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2313 + /* "collisions.py":2452 * 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_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 2313, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_3rect, 0, __pyx_n_s_Rect_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2313, __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_10, __pyx_n_s_rect, __pyx_t_12) < 0) __PYX_ERR(0, 2313, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2452, __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, 2452, __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, 2452, __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_10, __pyx_n_s_rect, __pyx_t_11) < 0) __PYX_ERR(0, 2452, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2322 + /* "collisions.py":2461 * 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_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2322, __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, 2322, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_5area, 0, __pyx_n_s_Rect_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__246)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2322, __pyx_L1_error) - __Pyx_GOTREF(__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_10, __pyx_n_s_area, __pyx_t_7) < 0) __PYX_ERR(0, 2322, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2461, __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, 2461, __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, 2461, __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, 2461, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2331 + /* "collisions.py":2470 * 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, 2470, __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, 2470, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2470, __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, 2470, __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_10, __pyx_n_s_containsPoint, __pyx_t_11) < 0) __PYX_ERR(0, 2470, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "collisions.py":2474 + * 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, Point): + * if checkShpType(othershape, ShpTyps.Point): */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2331, __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, 2331, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2331, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_7_collides, 0, __pyx_n_s_Rect__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2331, __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_10, __pyx_n_s_collides, __pyx_t_12) < 0) __PYX_ERR(0, 2331, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2474, __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, 2474, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2474, __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, 2474, __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, 2474, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2362 + /* "collisions.py":2505 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2362, __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, 2362, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_9toLines, 0, __pyx_n_s_Rect_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2362, __pyx_L1_error) - __Pyx_GOTREF(__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_10, __pyx_n_s_toLines, __pyx_t_7) < 0) __PYX_ERR(0, 2362, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2505, __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, 2505, __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, 2505, __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_10, __pyx_n_s_toLines, __pyx_t_11) < 0) __PYX_ERR(0, 2505, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2374 + /* "collisions.py":2517 * ] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2374, __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, 2374, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_11toPoints, 0, __pyx_n_s_Rect_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2374, __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_10, __pyx_n_s_toPoints, __pyx_t_12) < 0) __PYX_ERR(0, 2374, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2517, __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, 2517, __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, 2517, __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, 2517, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2386 + /* "collisions.py":2529 * ] * * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< * """ * Clone this object using the latest cloning technology. */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Rect_3) < 0) __PYX_ERR(0, 2386, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_13copy, 0, __pyx_n_s_Rect_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2386, __pyx_L1_error) - __Pyx_GOTREF(__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_10, __pyx_n_s_copy, __pyx_t_7) < 0) __PYX_ERR(0, 2386, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2529, __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, 2529, __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, 2529, __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_10, __pyx_n_s_copy, __pyx_t_11) < 0) __PYX_ERR(0, 2529, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2392 + /* "collisions.py":2535 * 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_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2392, __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, 2392, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2392, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2392, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_15__setitem__, 0, __pyx_n_s_Rect___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2392, __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_10, __pyx_n_s_setitem, __pyx_t_12) < 0) __PYX_ERR(0, 2392, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2535, __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, 2535, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2535, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2535, __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, 2535, __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, 2535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2406 + /* "collisions.py":2549 * ) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_17__str__, 0, __pyx_n_s_Rect___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_str, __pyx_t_12) < 0) __PYX_ERR(0, 2406, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __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, 2549, __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, 2549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2299 + /* "collisions.py":2437 * return '' * * class Rect(ClosedShape): # <<<<<<<<<<<<<< * """A Rectangle. It is defined with an x, y, width and height.""" - * def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = BASEBOUNCINESS): + * TYPE = ShpTyps.Rect */ - __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_Rect, __pyx_t_2, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_8, __pyx_t_12) < 0) __PYX_ERR(0, 2299, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_12) < 0) __PYX_ERR(0, 2299, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __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, 2437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_7, __pyx_t_3) < 0) __PYX_ERR(0, 2437, __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, 2437, __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_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2409 + /* "collisions.py":2552 * 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, 2409, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 2409, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 2552, __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, 2409, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2552, __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, 2409, __pyx_L1_error) + __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = __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_12)) __PYX_ERR(0, 2409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__pyx_t_2 != __pyx_t_11) { - if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(0, 2409, __pyx_L1_error) + __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, 2552, __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, 2552, __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, 2409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); - /* "collisions.py":2413 + /* "collisions.py":2556 * 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, 2556, __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, 2556, __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, 2556, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "collisions.py":2557 + * 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_8 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2413, __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, 2413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_w, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_h, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_rotation, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2413, __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__255)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2413, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2557, __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, 2557, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2557, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_w, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2557, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_h, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2557, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_rotation, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2557, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2557, __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, 2557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_7); - PyList_Append(__pyx_t_11, __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_defaults21), 0)) __PYX_ERR(0, 2413, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2413, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_t_7)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_60__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 2413, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults22), 0)) __PYX_ERR(0, 2557, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2557, __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, 2557, __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, 2557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2428 + /* "collisions.py":2572 * 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, 2428, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2572, __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, 2428, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_3getCache, 0, __pyx_n_s_RotatedRect_getCache, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2572, __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, 2572, __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_12, __pyx_n_s_getCache, __pyx_t_8) < 0) __PYX_ERR(0, 2428, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getCache, __pyx_t_11) < 0) __PYX_ERR(0, 2572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2452 + /* "collisions.py":2596 * 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_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2452, __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, 2452, __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__259)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2452, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2596, __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, 2596, __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, 2596, __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_12, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 2452, __pyx_L1_error) + __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, 2596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2462 + /* "collisions.py":2606 * 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, 2462, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2606, __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, 2462, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_7area, 0, __pyx_n_s_RotatedRect_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2606, __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, 2606, __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_12, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 2462, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_area, __pyx_t_11) < 0) __PYX_ERR(0, 2606, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2471 + /* "collisions.py":2615 * 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, 2615, __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, 2615, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2615, __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, 2615, __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, 2615, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":2619 + * 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_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2471, __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, 2471, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2471, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_9_collides, 0, __pyx_n_s_RotatedRect__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2471, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2619, __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_12, __pyx_n_s_collides, __pyx_t_7) < 0) __PYX_ERR(0, 2471, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2619, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2619, __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, 2619, __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, 2619, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2512 + /* "collisions.py":2653 * return othershape._collides(self) * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2512, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2653, __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, 2653, __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, 2653, __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, 2512, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_11toPoints, 0, __pyx_n_s_RotatedRect_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__263)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2512, __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_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, 2653, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_toPoints, __pyx_t_8) < 0) __PYX_ERR(0, 2512, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2519 + /* "collisions.py":2660 * return self.getCache() * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2519, __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, 2519, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_13toLines, 0, __pyx_n_s_RotatedRect_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2519, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2660, __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_12, __pyx_n_s_toLines, __pyx_t_7) < 0) __PYX_ERR(0, 2519, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2660, __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, 2660, __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, 2660, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2530 + /* "collisions.py":2671 * ] + [Line(ps[len(ps)-1], ps[0])] * * def copy(self) -> 'RotatedRect': # <<<<<<<<<<<<<< * """ * Spawn in a duplicate object */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2530, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2671, __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, 2671, __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, 2671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_RotatedRect_3) < 0) __PYX_ERR(0, 2530, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_15copy, 0, __pyx_n_s_RotatedRect_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2530, __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_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, 2671, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(0, 2530, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2536 + /* "collisions.py":2677 * 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_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2536, __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, 2536, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2536, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2536, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_17__setitem__, 0, __pyx_n_s_RotatedRect___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2536, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2677, __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_12, __pyx_n_s_setitem, __pyx_t_7) < 0) __PYX_ERR(0, 2536, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2677, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2677, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2677, __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, 2677, __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, 2677, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2556 + /* "collisions.py":2697 * ) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_19__str__, 0, __pyx_n_s_RotatedRect___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__269)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2556, __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, 2556, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __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, 2697, __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, 2697, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2409 + /* "collisions.py":2552 * return f'' * * class RotatedRect(ClosedShape): # <<<<<<<<<<<<<< * """A rectangle...... That is rotated. * It is rotated around it's x and y coordinates. */ - __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_RotatedRect, __pyx_t_2, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_11, __pyx_t_7) < 0) __PYX_ERR(0, 2409, __pyx_L1_error) + __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, 2552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_8, __pyx_t_11) < 0) __PYX_ERR(0, 2552, __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, 2552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RotatedRect, __pyx_t_7) < 0) __PYX_ERR(0, 2409, __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_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2559 + /* "collisions.py":2700 * return f'' * * class Polygon(ClosedShape): # <<<<<<<<<<<<<< * """A convex or concave polygon. It is defined with a list of points.""" - * def __init__(self, *points: pointLike, errorOnLT3: bool = True, bounciness: float = BASEBOUNCINESS): + * TYPE = ShpTyps.Polygon */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2559, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2559, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2700, __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, 2559, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2)) __PYX_ERR(0, 2700, __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, 2559, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __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_7)) __PYX_ERR(0, 2559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2700, __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, 2700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_2 != __pyx_t_10) { - if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(0, 2559, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(0, 2700, __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, 2559, __pyx_L1_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - /* "collisions.py":2561 + /* "collisions.py":2702 * 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, 2702, __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, 2702, __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, 2702, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":2703 + * """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_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_errorOnLT3, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2561, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2561, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_points_2, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2561, __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__271)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2561, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2703, __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, 2703, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2703, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_points_2, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2703, __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, 2703, __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_defaults22), 0)) __PYX_ERR(0, 2561, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2561, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_t_8)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_62__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 2561, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults23), 0)) __PYX_ERR(0, 2703, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2703, __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, 2703, __pyx_L1_error) + __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); + __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, 2703, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2579 + /* "collisions.py":2721 * 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__273)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2579, __pyx_L1_error) + __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, 2721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_x, __pyx_t_11) < 0) __PYX_ERR(0, 2579, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_x, __pyx_t_7) < 0) __PYX_ERR(0, 2721, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2583 + /* "collisions.py":2725 * """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_7, __pyx_n_s_x); + __pyx_t_8 = PyObject_GetItem(__pyx_t_11, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_x); } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2583, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_setter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_setter); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2725, __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__275)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2583, __pyx_L1_error) + __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, 2725, __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_3))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); + 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_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, 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_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); + __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_11)) __PYX_ERR(0, 2583, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_x, __pyx_t_11) < 0) __PYX_ERR(0, 2583, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_x, __pyx_t_7) < 0) __PYX_ERR(0, 2725, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2587 + /* "collisions.py":2729 * 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_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_7y, 0, __pyx_n_s_Polygon_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__276)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2587, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 2729, __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, 2729, __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, 2729, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2591 + /* "collisions.py":2733 * """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_11 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_y); - if (unlikely(!__pyx_t_11)) { + __pyx_t_7 = PyObject_GetItem(__pyx_t_11, __pyx_n_s_y); + if (unlikely(!__pyx_t_7)) { PyErr_Clear(); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_y); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_y); } - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_setter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2591, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2733, __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, 2733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_9y, 0, __pyx_n_s_Polygon_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __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, 2733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = NULL; __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS @@ -110275,351 +117571,553 @@ if (!__Pyx_RefNanny) { } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_11}; - __pyx_t_3 = __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_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_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2591, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 2733, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2596 + /* "collisions.py":2738 * 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_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __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, 2596, __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__279)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2596, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2738, __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, 2738, __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, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_rect, __pyx_t_8) < 0) __PYX_ERR(0, 2596, __pyx_L1_error) + __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, 2738, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2605 + /* "collisions.py":2747 * 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, 2605, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2747, __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, 2605, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_13area, 0, __pyx_n_s_Polygon_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__280)); 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_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2747, __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, 2747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 2605, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_area, __pyx_t_12) < 0) __PYX_ERR(0, 2747, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2617 + /* "collisions.py":2759 * ) + (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_3 = __Pyx_PyDict_NewPresized(2); 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_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2617, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2617, __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__281)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2617, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2759, __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, 2759, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2759, __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, 2759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_collides, __pyx_t_8) < 0) __PYX_ERR(0, 2617, __pyx_L1_error) + __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, 2759, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2663 + /* "collisions.py":2805 * 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, 2663, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2805, __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, 2663, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_17toLines, 0, __pyx_n_s_Polygon_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__282)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2805, __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, 2805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_toLines, __pyx_t_3) < 0) __PYX_ERR(0, 2663, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_toLines, __pyx_t_12) < 0) __PYX_ERR(0, 2805, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2673 + /* "collisions.py":2815 * ] + [Line(self.points[len(self.points)-1], self.points[0])] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2673, __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, 2673, __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__283)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2673, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2815, __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, 2815, __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, 2815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_toPoints, __pyx_t_8) < 0) __PYX_ERR(0, 2673, __pyx_L1_error) + __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, 2815, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2680 + /* "collisions.py":2822 * 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, 2680, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2822, __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, 2680, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_21copy, 0, __pyx_n_s_Polygon_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__284)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Polygon_2) < 0) __PYX_ERR(0, 2822, __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, 2822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_copy, __pyx_t_3) < 0) __PYX_ERR(0, 2680, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_copy, __pyx_t_12) < 0) __PYX_ERR(0, 2822, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2686 + /* "collisions.py":2828 * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * self.points[item] = new * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2686, __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, 2686, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2686, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2686, __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__285)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2686, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2828, __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, 2828, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2828, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2828, __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, 2828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_setitem, __pyx_t_8) < 0) __PYX_ERR(0, 2686, __pyx_L1_error) + __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, 2828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2689 + /* "collisions.py":2831 * 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__286)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2689, __pyx_L1_error) + __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, 2831, __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, 2689, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_str, __pyx_t_8) < 0) __PYX_ERR(0, 2831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2559 + /* "collisions.py":2700 * return f'' * * class Polygon(ClosedShape): # <<<<<<<<<<<<<< * """A convex or concave polygon. It is defined with a list of points.""" - * def __init__(self, *points: pointLike, errorOnLT3: bool = True, bounciness: float = BASEBOUNCINESS): + * TYPE = ShpTyps.Polygon */ - __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_n_s_Polygon, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2559, __pyx_L1_error) + __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, 2700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_10, __pyx_t_8) < 0) __PYX_ERR(0, 2559, __pyx_L1_error) + if (__Pyx_CyFunction_InitClassCell(__pyx_t_10, __pyx_t_8) < 0) __PYX_ERR(0, 2700, __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, 2559, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Polygon, __pyx_t_8) < 0) __PYX_ERR(0, 2700, __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_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2692 - * return f'' + /* "collisions.py":2835 + * + * TYPE_MATCHES = { + * Shape: ShpTyps.NoShape, # <<<<<<<<<<<<<< + * ClosedShape: ShpTyps.NoShape, + * Shapes: ShpTyps.Group, + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_8) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "collisions.py":2836 + * TYPE_MATCHES = { + * Shape: ShpTyps.NoShape, + * ClosedShape: ShpTyps.NoShape, # <<<<<<<<<<<<<< + * Shapes: ShpTyps.Group, + * NoShape: ShpTyps.NoShape, + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2836, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_8, __pyx_t_11) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "collisions.py":2837 + * Shape: ShpTyps.NoShape, + * ClosedShape: ShpTyps.NoShape, + * Shapes: ShpTyps.Group, # <<<<<<<<<<<<<< + * NoShape: ShpTyps.NoShape, + * Point: ShpTyps.Point, + */ + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Group); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_11, __pyx_t_3) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":2838 + * ClosedShape: ShpTyps.NoShape, + * Shapes: ShpTyps.Group, + * NoShape: ShpTyps.NoShape, # <<<<<<<<<<<<<< + * Point: ShpTyps.Point, + * Line: ShpTyps.Line, + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_8) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "collisions.py":2839 + * Shapes: ShpTyps.Group, + * NoShape: ShpTyps.NoShape, + * Point: ShpTyps.Point, # <<<<<<<<<<<<<< + * Line: ShpTyps.Line, + * Circle: ShpTyps.Circle, + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_8, __pyx_t_11) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "collisions.py":2840 + * NoShape: ShpTyps.NoShape, + * Point: ShpTyps.Point, + * Line: ShpTyps.Line, # <<<<<<<<<<<<<< + * Circle: ShpTyps.Circle, + * Arc: ShpTyps.Arc, + */ + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Line); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_11, __pyx_t_3) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":2841 + * Point: ShpTyps.Point, + * Line: ShpTyps.Line, + * Circle: ShpTyps.Circle, # <<<<<<<<<<<<<< + * Arc: ShpTyps.Arc, + * Rect: ShpTyps.Rect, + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_8) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "collisions.py":2842 + * Line: ShpTyps.Line, + * Circle: ShpTyps.Circle, + * Arc: ShpTyps.Arc, # <<<<<<<<<<<<<< + * Rect: ShpTyps.Rect, + * RotatedRect: ShpTyps.RotRect, + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Arc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Arc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_8, __pyx_t_11) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "collisions.py":2843 + * Circle: ShpTyps.Circle, + * Arc: ShpTyps.Arc, + * Rect: ShpTyps.Rect, # <<<<<<<<<<<<<< + * RotatedRect: ShpTyps.RotRect, + * Polygon: ShpTyps.Polygon, + */ + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Rect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_11, __pyx_t_3) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":2844 + * Arc: ShpTyps.Arc, + * Rect: ShpTyps.Rect, + * RotatedRect: ShpTyps.RotRect, # <<<<<<<<<<<<<< + * Polygon: ShpTyps.Polygon, + * } + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RotatedRect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_RotRect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_8) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "collisions.py":2845 + * Rect: ShpTyps.Rect, + * RotatedRect: ShpTyps.RotRect, + * Polygon: ShpTyps.Polygon, # <<<<<<<<<<<<<< + * } + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_t_8, __pyx_t_11) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TYPE_MATCHES, __pyx_t_2) < 0) __PYX_ERR(0, 2834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":2848 + * } * * 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, 2692, __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, 2848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":2695 + /* "collisions.py":2851 * """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_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_shapes, __pyx_n_s_Rect) < 0) __PYX_ERR(0, 2695, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2695, __pyx_L1_error) - __pyx_t_7 = __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__288)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_boundingBox, __pyx_t_12) < 0) __PYX_ERR(0, 2695, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_shapes, __pyx_n_s_Rect) < 0) __PYX_ERR(0, 2851, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2851, __pyx_L1_error) + __pyx_t_8 = __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_8)) __PYX_ERR(0, 2851, __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, 2851, __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_boundingBox, __pyx_t_11) < 0) __PYX_ERR(0, 2851, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2719 + /* "collisions.py":2875 * )) * * @staticmethod # <<<<<<<<<<<<<< * def combineRects(*shapes: Rect) -> Shapes: * """ */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_shapes, __pyx_n_s_Rect) < 0) __PYX_ERR(0, 2719, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2719, __pyx_L1_error) - __pyx_t_7 = __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__290)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_combineRects, __pyx_t_12) < 0) __PYX_ERR(0, 2719, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_shapes, __pyx_n_s_Rect) < 0) __PYX_ERR(0, 2875, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2875, __pyx_L1_error) + __pyx_t_8 = __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_8)) __PYX_ERR(0, 2875, __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, 2875, __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_combineRects, __pyx_t_11) < 0) __PYX_ERR(0, 2875, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2773 + /* "collisions.py":2929 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< * def union(*shapes: Shape) -> Shapes: # FIXME * """ */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2773, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2773, __pyx_L1_error) - __pyx_t_7 = __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__292)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_union, __pyx_t_12) < 0) __PYX_ERR(0, 2773, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2929, __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, 2929, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2929, __pyx_L1_error) + __pyx_t_8 = __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_8)) __PYX_ERR(0, 2929, __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, 2929, __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_union, __pyx_t_11) < 0) __PYX_ERR(0, 2929, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2842 + /* "collisions.py":2998 * return Shapes(*outshps) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: * """ */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2842, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_points_2, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2842, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2842, __pyx_L1_error) - __pyx_t_7 = __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__294)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults23), 0)) __PYX_ERR(0, 2842, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2998, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_points_2, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2998, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2998, __pyx_L1_error) + __pyx_t_8 = __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_8)) __PYX_ERR(0, 2998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults24), 0)) __PYX_ERR(0, 2998, __pyx_L1_error) - /* "collisions.py":2843 + /* "collisions.py":2999 * * @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, 2843, __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, 2843, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_t_7)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_64__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2999, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2999, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_t_8)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_66__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2842 + /* "collisions.py":2998 * return Shapes(*outshps) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: * """ */ - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pointsToShape, __pyx_t_12) < 0) __PYX_ERR(0, 2842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2998, __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_pointsToShape, __pyx_t_11) < 0) __PYX_ERR(0, 2998, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2881 + /* "collisions.py":3037 * return Polygon(*points, bounciness=bounciness) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToPoly(*points: list[Point], ratio: Number = 0.1) -> Union[Shape, Shapes]: * """ */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_ratio, ((PyObject*)__pyx_float_0_1)) < 0) __PYX_ERR(0, 2881, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ratio, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2881, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_points_2, __pyx_kp_s_list_Point) < 0) __PYX_ERR(0, 2881, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes_3) < 0) __PYX_ERR(0, 2881, __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__296)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2881, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_ratio, ((PyObject*)__pyx_float_0_1)) < 0) __PYX_ERR(0, 3037, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_ratio, __pyx_n_s_Number) < 0) __PYX_ERR(0, 3037, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_points_2, __pyx_kp_s_list_Point) < 0) __PYX_ERR(0, 3037, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes_3) < 0) __PYX_ERR(0, 3037, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 3037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_3, __pyx_t_11); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pointsToPoly, __pyx_t_8) < 0) __PYX_ERR(0, 3037, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pointsToPoly, __pyx_t_7) < 0) __PYX_ERR(0, 2881, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2897 + /* "collisions.py":3053 * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) * * @staticmethod # <<<<<<<<<<<<<< * def shapelyUnion(*shapes: Shape) -> Shape: * """ */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2897, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2897, __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__298)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2897, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3053, __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; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 3053, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 3053, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 3053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_shapelyUnion, __pyx_t_8) < 0) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_shapelyUnion, __pyx_t_7) < 0) __PYX_ERR(0, 2897, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2692 - * return f'' + /* "collisions.py":2848 + * } * * 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_7 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_ShapeCombiner, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2692, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShapeCombiner, __pyx_t_7) < 0) __PYX_ERR(0, 2692, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_ShapeCombiner, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShapeCombiner, __pyx_t_8) < 0) __PYX_ERR(0, 2848, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "collisions.py":1 * import math # <<<<<<<<<<<<<< - * from enum import Enum - * from typing import Type, Union, Iterable, Any, Dict + * from enum import IntEnum + * from typing import Union, Iterable, Any, Dict */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -111857,6 +119355,174 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } +/* UnpackUnboundCMethod */ +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), + METH_VARARGS | METH_KEYWORDS, + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #else + if (likely(!__Pyx_CyOrPyCFunction_Check(method))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + target->method = unbound_method; + } + } + return 0; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + #endif + } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* pyfrozenset_new */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; +#if CYTHON_COMPILING_IN_PYPY + PyObject* args; + args = PyTuple_Pack(1, it); + if (unlikely(!args)) + return NULL; + result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); + Py_DECREF(args); + return result; +#else + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); +#endif + } +#if CYTHON_USE_TYPE_SLOTS + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#endif +} + +/* PySetContains */ +static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { + int result = -1; + if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { + PyObject *tmpkey; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey != NULL) { + result = PySet_Contains(set, tmpkey); + Py_DECREF(tmpkey); + } + } + return result; +} +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { + int result = PySet_Contains(set, key); + if (unlikely(result < 0)) { + result = __Pyx_PySet_ContainsUnhashable(set, key); + } + 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) { @@ -112688,181 +120354,6 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { } #endif -/* CIntToDigits */ -static const char DIGIT_PAIRS_10[2*10*10+1] = { - "00010203040506070809" - "10111213141516171819" - "20212223242526272829" - "30313233343536373839" - "40414243444546474849" - "50515253545556575859" - "60616263646566676869" - "70717273747576777879" - "80818283848586878889" - "90919293949596979899" -}; -static const char DIGIT_PAIRS_8[2*8*8+1] = { - "0001020304050607" - "1011121314151617" - "2021222324252627" - "3031323334353637" - "4041424344454647" - "5051525354555657" - "6061626364656667" - "7071727374757677" -}; -static const char DIGITS_HEX[2*16+1] = { - "0123456789abcdef" - "0123456789ABCDEF" -}; - -/* BuildPyUnicode */ -static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, - int prepend_sign, char padding_char) { - PyObject *uval; - Py_ssize_t uoffset = ulength - clength; -#if CYTHON_USE_UNICODE_INTERNALS - Py_ssize_t i; -#if CYTHON_PEP393_ENABLED - void *udata; - uval = PyUnicode_New(ulength, 127); - if (unlikely(!uval)) return NULL; - udata = PyUnicode_DATA(uval); -#else - Py_UNICODE *udata; - uval = PyUnicode_FromUnicode(NULL, ulength); - if (unlikely(!uval)) return NULL; - udata = PyUnicode_AS_UNICODE(uval); -#endif - if (uoffset > 0) { - i = 0; - if (prepend_sign) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); - i++; - } - for (; i < uoffset; i++) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); - } - } - for (i=0; i < clength; i++) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); - } -#else - { - PyObject *sign = NULL, *padding = NULL; - uval = NULL; - if (uoffset > 0) { - prepend_sign = !!prepend_sign; - if (uoffset > prepend_sign) { - padding = PyUnicode_FromOrdinal(padding_char); - if (likely(padding) && uoffset > prepend_sign + 1) { - PyObject *tmp; - PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); - if (unlikely(!repeat)) goto done_or_error; - tmp = PyNumber_Multiply(padding, repeat); - Py_DECREF(repeat); - Py_DECREF(padding); - padding = tmp; - } - if (unlikely(!padding)) goto done_or_error; - } - if (prepend_sign) { - sign = PyUnicode_FromOrdinal('-'); - if (unlikely(!sign)) goto done_or_error; - } - } - uval = PyUnicode_DecodeASCII(chars, clength, NULL); - if (likely(uval) && padding) { - PyObject *tmp = PyNumber_Add(padding, uval); - Py_DECREF(uval); - uval = tmp; - } - if (likely(uval) && sign) { - PyObject *tmp = PyNumber_Add(sign, uval); - Py_DECREF(uval); - uval = tmp; - } -done_or_error: - Py_XDECREF(padding); - Py_XDECREF(sign); - } -#endif - return uval; -} - -/* CIntToPyUnicode */ -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) { - char digits[sizeof(Py_ssize_t)*3+2]; - char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2; - const char *hex_digits = DIGITS_HEX; - Py_ssize_t length, ulength; - int prepend_sign, last_one_off; - Py_ssize_t remaining; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (format_char == 'X') { - hex_digits += 16; - format_char = 'x'; - } - remaining = value; - last_one_off = 0; - dpos = end; - do { - int digit_pos; - switch (format_char) { - case 'o': - digit_pos = abs((int)(remaining % (8*8))); - remaining = (Py_ssize_t) (remaining / (8*8)); - dpos -= 2; - memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); - last_one_off = (digit_pos < 8); - break; - case 'd': - digit_pos = abs((int)(remaining % (10*10))); - remaining = (Py_ssize_t) (remaining / (10*10)); - dpos -= 2; - memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); - last_one_off = (digit_pos < 10); - break; - case 'x': - *(--dpos) = hex_digits[abs((int)(remaining % 16))]; - remaining = (Py_ssize_t) (remaining / 16); - break; - default: - assert(0); - break; - } - } while (unlikely(remaining != 0)); - assert(!last_one_off || *dpos == '0'); - dpos += last_one_off; - length = end - dpos; - ulength = length; - prepend_sign = 0; - if (!is_unsigned && value <= neg_one) { - if (padding_char == ' ' || width <= length + 1) { - *(--dpos) = '-'; - ++length; - } else { - prepend_sign = 1; - } - ++ulength; - } - if (width > ulength) { - ulength = width; - } - if (ulength == 1) { - return PyUnicode_FromOrdinal(*dpos); - } - return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); -} - /* py_abs */ #if CYTHON_USE_PYLONG_INTERNALS static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { @@ -114833,120 +122324,6 @@ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, lo PyObject_RichCompare(op1, op2, Py_EQ)); } -/* UnpackUnboundCMethod */ -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); - return result; -} -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), - METH_VARARGS | METH_KEYWORDS, - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - target->method = method; -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else -#endif -#if CYTHON_COMPILING_IN_PYPY -#else - if (PyCFunction_Check(method)) -#endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } -#else - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); -#endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - target->method = unbound_method; - } - } - return 0; -} - -/* CallUnboundCMethod1 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { - if (likely(cfunc->func)) { - int flag = cfunc->flag; - if (flag == METH_O) { - return (*(cfunc->func))(self, arg); - } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - #endif - } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - } - } - return __Pyx__CallUnboundCMethod1(cfunc, self, arg); -} -#endif -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *args, *result = NULL; - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - if (cfunc->flag & METH_KEYWORDS) - result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); - else - result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(2, self, arg); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); -#endif -bad: - Py_XDECREF(args); - return result; -} - /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { @@ -115208,6 +122585,181 @@ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObje return result; } +/* CIntToDigits */ +static const char DIGIT_PAIRS_10[2*10*10+1] = { + "00010203040506070809" + "10111213141516171819" + "20212223242526272829" + "30313233343536373839" + "40414243444546474849" + "50515253545556575859" + "60616263646566676869" + "70717273747576777879" + "80818283848586878889" + "90919293949596979899" +}; +static const char DIGIT_PAIRS_8[2*8*8+1] = { + "0001020304050607" + "1011121314151617" + "2021222324252627" + "3031323334353637" + "4041424344454647" + "5051525354555657" + "6061626364656667" + "7071727374757677" +}; +static const char DIGITS_HEX[2*16+1] = { + "0123456789abcdef" + "0123456789ABCDEF" +}; + +/* BuildPyUnicode */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char) { + PyObject *uval; + Py_ssize_t uoffset = ulength - clength; +#if CYTHON_USE_UNICODE_INTERNALS + Py_ssize_t i; +#if CYTHON_PEP393_ENABLED + void *udata; + uval = PyUnicode_New(ulength, 127); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_DATA(uval); +#else + Py_UNICODE *udata; + uval = PyUnicode_FromUnicode(NULL, ulength); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_AS_UNICODE(uval); +#endif + if (uoffset > 0) { + i = 0; + if (prepend_sign) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); + i++; + } + for (; i < uoffset; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); + } + } + for (i=0; i < clength; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + } +#else + { + PyObject *sign = NULL, *padding = NULL; + uval = NULL; + if (uoffset > 0) { + prepend_sign = !!prepend_sign; + if (uoffset > prepend_sign) { + padding = PyUnicode_FromOrdinal(padding_char); + if (likely(padding) && uoffset > prepend_sign + 1) { + PyObject *tmp; + PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); + if (unlikely(!repeat)) goto done_or_error; + tmp = PyNumber_Multiply(padding, repeat); + Py_DECREF(repeat); + Py_DECREF(padding); + padding = tmp; + } + if (unlikely(!padding)) goto done_or_error; + } + if (prepend_sign) { + sign = PyUnicode_FromOrdinal('-'); + if (unlikely(!sign)) goto done_or_error; + } + } + uval = PyUnicode_DecodeASCII(chars, clength, NULL); + if (likely(uval) && padding) { + PyObject *tmp = PyNumber_Add(padding, uval); + Py_DECREF(uval); + uval = tmp; + } + if (likely(uval) && sign) { + PyObject *tmp = PyNumber_Add(sign, uval); + Py_DECREF(uval); + uval = tmp; + } +done_or_error: + Py_XDECREF(padding); + Py_XDECREF(sign); + } +#endif + return uval; +} + +/* CIntToPyUnicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(Py_ssize_t)*3+2]; + char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + Py_ssize_t remaining; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (Py_ssize_t) (remaining / (8*8)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (Py_ssize_t) (remaining / (10*10)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (Py_ssize_t) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + assert(!last_one_off || *dpos == '0'); + dpos += last_one_off; + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, @@ -115738,7 +123290,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__34; + PyObject *module, *from_list, *star = __pyx_n_s__36; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) @@ -115801,7 +123353,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__35); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__37); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } @@ -116691,7 +124243,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__299); + name = __Pyx_NewRef(__pyx_n_s__324); } return name; } diff --git a/BlazeSudio/collisions/lib/collisions.py b/BlazeSudio/collisions/lib/collisions.py index cd014b5..6a92f66 100644 --- a/BlazeSudio/collisions/lib/collisions.py +++ b/BlazeSudio/collisions/lib/collisions.py @@ -1,6 +1,6 @@ import math -from enum import Enum -from typing import Type, Union, Iterable, Any, Dict +from enum import IntEnum +from typing import Union, Iterable, Any, Dict # Just for utility funcs, not the actual collision library try: # This library was not made for pygame, but it can be used with it @@ -28,6 +28,7 @@ 'drawShape', 'ShpGroups', + 'ShpTyps', 'checkShpType', 'ClosedShape', @@ -119,7 +120,7 @@ def pointOnCircle(angle: Number, strength: Number=1) -> pointLike: """ return math.cos(angle)*strength, math.sin(angle)*strength -class ShpGroups(Enum): +class ShpGroups(IntEnum): """ An enum representing the different groups you can put shapes in. """ @@ -132,24 +133,36 @@ class ShpGroups(Enum): GROUP = 3 """A group of other shapes""" -def checkShpType(shape: Union['Shape', 'Shapes'], typs: Union[Type, ShpGroups, Iterable[Union[Type, ShpGroups]]]) -> bool: +class ShpTyps(IntEnum): + """ + An enum representing the different possible shapes. + """ + NoShape = -1 + Group = -2 + Point = -3 + Line = -4 + Circle = -5 + Arc = -6 + Rect = -7 + RotRect = -8 + 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. + This checks if it is of ANY of the specified types or groups. + Args: shape (Shape or Shapes]): The input shape or shapes to check the type of. - typs (ShpTypes, ShpGroups, or an Iterable[ShpTypes or ShpGroups]): The shape type(s) &/or group(s) to check for. + *typs (Iterable[ShpTypes | ShpGroups]): The shape type(s) &/or group(s) to check for. Returns: bool: Whether the shape is of the specified type(s) or group(s). """ - if not isinstance(typs, Iterable): - typs = [typs] - if not isinstance(shape, (Shape, Shapes)): - return False - for i in typs: - if i in shape.GROUPS or type(shape) is i: - return True + typ_set = set(typs) + if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: + return True return False def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: @@ -184,11 +197,11 @@ def collToShapely(collShape: 'Shape') -> shapelyGeom.base.BaseGeometry: Returns: shapely.geometry.base.BaseGeometry: The converted shape. """ - if checkShpType(collShape, Point): + if checkShpType(collShape, ShpTyps.Point): return shapelyGeom.Point(collShape.x, collShape.y) - if checkShpType(collShape, Line): + if checkShpType(collShape, ShpTyps.Line): return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) - if checkShpType(collShape, Circle): + 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()]) @@ -207,18 +220,18 @@ def drawShape(surface: Any, shape: 'Shape', colour: tuple[int, int, int], width: width (int, optional): The width of the lines to draw. Defaults to 0. """ checkForPygame() - if checkShpType(shape, Point): + if checkShpType(shape, ShpTyps.Point): pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) - elif checkShpType(shape, Line): + 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) - elif checkShpType(shape, Arc): + 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, Circle): + 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() @@ -244,7 +257,8 @@ def drawShape(surface: Any, shape: 'Shape', colour: tuple[int, int, int], width: 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?""" - GROUPS = [] + GROUPS = set() + TYPE = ShpTyps.NoShape x: Number = 0 y: Number = 0 def __init__(self, bounciness: float = BASEBOUNCINESS): @@ -485,7 +499,8 @@ def __str__(self): class Shapes: """A class which holds multiple shapes and can be used to do things with all of them at once.""" - GROUPS = [ShpGroups.GROUP] + GROUPS = {ShpGroups.GROUP} + TYPE = ShpTyps.Group def __init__(self, *shapes: Shape): """ Args: @@ -696,6 +711,7 @@ def __str__(self): # 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.""" def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): """ @@ -733,12 +749,12 @@ def toPoints(self) -> Iterable[pointLike]: return [self] def _collides(self, othershape: Shape) -> bool: - if checkShpType(othershape, Point): + 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]: - if checkShpType(othershape, Point): + 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) @@ -899,7 +915,8 @@ def __str__(self): class Line(Shape): """A line segment object defined by a start and an end point.""" - GROUPS = [ShpGroups.LINES] + GROUPS = {ShpGroups.LINES} + TYPE = ShpTyps.Line def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): """ Args: @@ -983,9 +1000,9 @@ def _contains(self, othershape: Shape) -> bool: return False def _collides(self, othershape: Shape) -> bool: - if checkShpType(othershape, Point): + if checkShpType(othershape, ShpTyps.Point): return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - if checkShpType(othershape, Line): + if checkShpType(othershape, ShpTyps.Line): if not self.check_rects(othershape): return False # Calculate the direction of the lines @@ -1010,9 +1027,9 @@ def direction(xi, yi, xj, yj, xk, yk): return othershape._collides(self) def _where(self, othershape: Shape) -> Iterable[pointLike]: - if checkShpType(othershape, Point): + if checkShpType(othershape, ShpTyps.Point): return [[othershape.x, othershape.y]] if self.collides(othershape) else [] - if checkShpType(othershape, Line): + 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 @@ -1044,7 +1061,7 @@ def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLik Returns: pointLike / Iterable[pointLike]: The closest points ON this object TO the other object """ - if checkShpType(othershape, Point): + 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: @@ -1055,7 +1072,7 @@ def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLik if returnAll: return [p] return p - elif checkShpType(othershape, Line): + elif checkShpType(othershape, ShpTyps.Line): colls = self.whereCollides(othershape) if colls != []: if returnAll: @@ -1078,9 +1095,9 @@ def calculate(ln, point, recalculate): if returnAll: return [i[0] for i in tries] return tries[0][0] - elif checkShpType(othershape, Circle): + elif checkShpType(othershape, ShpTyps.Circle): return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - elif checkShpType(othershape, Arc): + elif checkShpType(othershape, ShpTyps.Arc): return self.closestPointTo(Point(*othershape.closestPointTo(self))) else: # Rects, Rotated rects and polygons colls = self.whereCollides(othershape) @@ -1215,13 +1232,13 @@ def handleCollisionsPos(self, paralell = not thisIsOnP if not paralell: cLine = None - if checkShpType(closestObj, Line): + 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 != []: cLine = colllidingLns[0] - elif checkShpType(closestObj, Circle) and (not thisIsOnP): + elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): paralell = True if cLine is not None: sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) @@ -1352,7 +1369,8 @@ 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 \ `.toLines()` or `.toPoints()` it will return an empty list; so please check for it *before* closed shapes.""" - GROUPS = [ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT] + GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} + TYPE = ShpTyps.Circle def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): """ Args: @@ -1383,22 +1401,22 @@ def area(self) -> Number: return math.pi * self.r**2 def _contains(self, othershape: Shape) -> bool: - if checkShpType(othershape, Point): + if checkShpType(othershape, ShpTyps.Point): return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 - if checkShpType(othershape, Line): + if checkShpType(othershape, ShpTyps.Line): return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) - if checkShpType(othershape, Circle): + 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, Arc): + if checkShpType(othershape, ShpTyps.Arc): ps = othershape.toPoints() return self._contains(ps[0]) and self._contains(ps[1]) - if checkShpType(othershape, ClosedShape): - return all(self._contains(p) for p in othershape.toPoints()) + if checkShpType(othershape, ShpGroups.CLOSED): + return all(self._contains(Point(*p)) for p in othershape.toPoints()) def _collides(self, othershape: Shape) -> bool: - if checkShpType(othershape, Point): + if checkShpType(othershape, ShpTyps.Point): return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 - if checkShpType(othershape, Line): + if checkShpType(othershape, ShpTyps.Line): if not self.check_rects(othershape): return False # Calculate the distance from point to the line segment @@ -1411,14 +1429,14 @@ def _collides(self, othershape: Shape) -> bool: 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, Circle): + 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) def _where(self, othershape: Shape) -> Iterable[pointLike]: - if checkShpType(othershape, Point): + 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, Line): + if checkShpType(othershape, ShpTyps.Line): if not self.check_rects(othershape): return [] def sign(x): @@ -1454,7 +1472,7 @@ def sign(x): 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, Circle): + if checkShpType(othershape, ShpTyps.Circle): if not self.check_rects(othershape): return [] # circle 1: (x0, y0), radius r0 @@ -1497,7 +1515,7 @@ def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[po Returns: pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape """ - if checkShpType(othershape, Point): + 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 @@ -1509,7 +1527,7 @@ def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[po if returnAll: return [[qx, qy]] return qx, qy - elif checkShpType(othershape, Line): + elif checkShpType(othershape, ShpTyps.Line): if self._collides(othershape): wheres = self._where(othershape) if wheres != []: @@ -1522,9 +1540,9 @@ def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[po return sort return sort[0] return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) - elif checkShpType(othershape, Circle): + elif checkShpType(othershape, ShpTyps.Circle): return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - elif checkShpType(othershape, Arc): + elif checkShpType(othershape, ShpTyps.Arc): return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) else: ps = [] @@ -1730,7 +1748,8 @@ class Arc(Circle): 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. **ANGLES ARE MEASURED IN DEGREES.**""" - GROUPS = [ShpGroups.LINES, ShpGroups.NOTSTRAIGHT] + GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} + TYPE = ShpTyps.Arc def __init__(self, x: Number, y: Number, @@ -1771,13 +1790,13 @@ def area(self) -> Number: return (diff/360) * 2*math.pi * self.r def _collides(self, othershape: Shape) -> bool: - if checkShpType(othershape, Point): + 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)) return self.angleInRange(angle) - if checkShpType(othershape, (Line, Circle)): - if checkShpType(othershape, Circle): + 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) @@ -1785,7 +1804,7 @@ def _collides(self, othershape: Shape) -> bool: if self._collides(Point(*pt)): return True return False - if checkShpType(othershape, Arc): + if checkShpType(othershape, ShpTyps.Arc): intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) for pt in intersections: p = Point(*pt) @@ -1804,14 +1823,14 @@ def _contains(self, othershape: Shape) -> bool: return False def _where(self, othershape: Shape) -> Iterable[pointLike]: - if checkShpType(othershape, Point): + if checkShpType(othershape, ShpTyps.Point): if self._collides(othershape): return [(othershape.x, othershape.y)] return [] - if checkShpType(othershape, (Line, Circle)): + 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, Arc): + 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) @@ -1827,7 +1846,7 @@ def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLik Returns: 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, Point): + 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 @@ -1840,7 +1859,7 @@ def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLik if returnAll: return [[qx, qy]] return qx, qy - elif checkShpType(othershape, Line): + elif checkShpType(othershape, ShpTyps.Line): cirO = Circle(self.x, self.y, self.r) if cirO.collides(othershape): def checkP(p, this): @@ -1860,9 +1879,9 @@ def checkP(p, this): return [i[0] for i in alls] return alls[0][0] return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) - elif checkShpType(othershape, Circle): + elif checkShpType(othershape, ShpTyps.Circle): return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - elif checkShpType(othershape, Arc): + elif checkShpType(othershape, ShpTyps.Arc): wheres = self.whereCollides(othershape) if wheres != []: if returnAll: @@ -2047,11 +2066,11 @@ def __str__(self): 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.""" - GROUPS = [ShpGroups.CLOSED] + GROUPS = {ShpGroups.CLOSED} def _where(self, othershape: Shape) -> Iterable[pointLike]: if not self.check_rects(othershape): return [] - if checkShpType(othershape, Point): + if checkShpType(othershape, ShpTyps.Point): for i in self.toLines(): if i.collides(othershape): return [[othershape.x, othershape.y]] @@ -2107,13 +2126,13 @@ def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[po Returns: pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape """ - if checkShpType(othershape, Point): + 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 return ps[0] - elif checkShpType(othershape, Line): + elif checkShpType(othershape, ShpTyps.Line): colls = self.whereCollides(othershape) if colls != []: if returnAll: @@ -2136,9 +2155,9 @@ def calculate(ln, oln, recalculate): if returnAll: return [i[0] for i in tries] return tries[0][0] - elif checkShpType(othershape, Circle): + elif checkShpType(othershape, ShpTyps.Circle): return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - elif checkShpType(othershape, Arc): + elif checkShpType(othershape, ShpTyps.Arc): closests = [] for ln in self.toLines(): cp = othershape.closestPointTo(ln) @@ -2260,11 +2279,11 @@ def handleCollisionsPos(self, paralell = not thisIsOnP else: cLines = [] - if checkShpType(closestObj, Line): + 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, Circle) and (not thisIsOnP): + elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): paralell = True if cLines != []: for cLine in cLines: @@ -2367,14 +2386,14 @@ def _containsPoint(self, point: Point) -> bool: return self._collides(point) and self.whereCollides(point) == [] def _contains(self, othershape: Shape) -> bool: - if checkShpType(othershape, Point): + if checkShpType(othershape, ShpTyps.Point): return self._containsPoint(othershape) - if checkShpType(othershape, Line): + if checkShpType(othershape, ShpTyps.Line): return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) - if checkShpType(othershape, Circle) or checkShpType(othershape, Arc): + if checkShpType(othershape, ShpTyps.Circle) or checkShpType(othershape, ShpTyps.Arc): return self._collides(othershape) and self.whereCollides(othershape) == [] - if checkShpType(othershape, ClosedShape): - return all(self._contains(p) for p in othershape.toPoints()) + 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: """ @@ -2417,6 +2436,7 @@ def __str__(self): 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): """ Args: @@ -2453,15 +2473,15 @@ def _containsPoint(self, point: Point) -> bool: def _collides(self, othershape: Shape) -> bool: x, y, mx, my = self.rect() - if checkShpType(othershape, Point): + if checkShpType(othershape, ShpTyps.Point): return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y - if checkShpType(othershape, Line): + 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()]) ) - if checkShpType(othershape, Circle): + 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 \ @@ -2470,14 +2490,14 @@ def _collides(self, othershape: Shape) -> bool: ((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, Arc): + if checkShpType(othershape, ShpTyps.Arc): if any(self._collides(Point(*i)) for i in othershape.endPoints()): return True for i in self.toLines(): if othershape.collides(i): return True return False - if checkShpType(othershape, Rect): + 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) @@ -2533,6 +2553,7 @@ class RotatedRect(ClosedShape): """A rectangle...... That is rotated. 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): """ Args: @@ -2598,31 +2619,31 @@ def _containsPoint(self, point: Point) -> bool: def _collides(self, othershape: Shape) -> bool: if not self.check_rects(othershape): return False - if checkShpType(othershape, Point): + 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, Line): + 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)): return True return False - if checkShpType(othershape, Circle): + if checkShpType(othershape, ShpTyps.Circle): if self._collides(Point(othershape.x, othershape.y)): return True for li in self.toLines(): if li.collides(othershape): return True return False - if checkShpType(othershape, Arc): + if checkShpType(othershape, ShpTyps.Arc): if any(self._collides(Point(*i)) for i in othershape.endPoints()): return True for i in self.toLines(): if othershape.collides(i): return True return False - if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): for li in self.toLines(): if li.collides(othershape): return True @@ -2678,6 +2699,7 @@ def __str__(self): 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): """ Args: @@ -2737,7 +2759,7 @@ def area(self) -> Number: def _collides(self, othershape: Shape) -> bool: if not self.check_rects(othershape): return False - if checkShpType(othershape, Point): + if checkShpType(othershape, ShpTyps.Point): ps = self.points c = False j = len(ps) - 1 @@ -2747,33 +2769,33 @@ def _collides(self, othershape: Shape) -> bool: c = not c j = i return c - if checkShpType(othershape, Line): + 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)): return True return False - if checkShpType(othershape, Circle): + if checkShpType(othershape, ShpTyps.Circle): if self._collides(Point(othershape.x, othershape.y)): return True for li in self.toLines(): if li.collides(othershape): return True return False - if checkShpType(othershape, Arc): + if checkShpType(othershape, ShpTyps.Arc): if any(self._collides(Point(*i)) for i in othershape.endPoints()): return True for i in self.toLines(): if othershape.collides(i): return True return False - if checkShpType(othershape, Rect) or checkShpType(othershape, RotatedRect): + 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)) - if checkShpType(othershape, Polygon): + if checkShpType(othershape, ShpTyps.Polygon): for li in self.toLines(): if li.collides(othershape): return True @@ -2854,7 +2876,7 @@ def combineRects(*shapes: Rect) -> Shapes: """ if not shapes: return Shapes() - shapes, others = [i for i in shapes if checkShpType(i, Rect)], [i for i in shapes if not checkShpType(i, Rect)] + 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: merged = False @@ -2903,7 +2925,7 @@ def union(*shapes: Shape) -> Shapes: # FIXME def reformat(obj): if checkShpType(obj, ShpGroups.CLOSED): return obj - elif checkShpType(s, Line): + elif checkShpType(s, ShpTyps.Line): return Polygon(obj.p1, obj.p2, obj.p2, obj.p1) # TODO: More reform = [reformat(s) for s in shapes]