MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / get_shapepoly

Method get_shapepoly

tools/python-3.11.9-amd64/Lib/turtle.py:2981–2996  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

_getshapepolyMethod · 0.95

Tested by

no test coverage detected