Return the current shape polygon as tuple of coordinate pairs. No argument. Examples (for a Turtle instance named turtle): >>> turtle.shape("square") >>> turtle.shapetransform(4, -1, 0, 2) >>> turtle.get_shapepoly() ((50, -20), (30, 20), (-50
(self)
| 2979 | for (x, y) in poly] |
| 2980 | |
| 2981 | def get_shapepoly(self): |
| 2982 | """Return the current shape polygon as tuple of coordinate pairs. |
| 2983 | |
| 2984 | No argument. |
| 2985 | |
| 2986 | Examples (for a Turtle instance named turtle): |
| 2987 | >>> turtle.shape("square") |
| 2988 | >>> turtle.shapetransform(4, -1, 0, 2) |
| 2989 | >>> turtle.get_shapepoly() |
| 2990 | ((50, -20), (30, 20), (-50, 20), (-30, -20)) |
| 2991 | |
| 2992 | """ |
| 2993 | shape = self.screen._shapes[self.turtle.shapeIndex] |
| 2994 | if shape._type == "polygon": |
| 2995 | return self._getshapepoly(shape._data, shape._type == "compound") |
| 2996 | # else return None |
| 2997 | |
| 2998 | def _getshapepoly(self, polygon, compound=False): |
| 2999 | """Calculate transformed shape polygon according to resizemode |
nothing calls this directly
no test coverage detected