MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / get_shapepoly

Method get_shapepoly

Python/Turtle.py:2863–2878  ·  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, 20), (

(self)

Source from the content-addressed store, hash-verified

2861 for (x, y) in poly]
2862
2863 def get_shapepoly(self):
2864 """Return the current shape polygon as tuple of coordinate pairs.
2865
2866 No argument.
2867
2868 Examples (for a Turtle instance named turtle):
2869 >>> turtle.shape("square")
2870 >>> turtle.shapetransform(4, -1, 0, 2)
2871 >>> turtle.get_shapepoly()
2872 ((50, -20), (30, 20), (-50, 20), (-30, -20))
2873
2874 """
2875 shape = self.screen._shapes[self.turtle.shapeIndex]
2876 if shape._type == "polygon":
2877 return self._getshapepoly(shape._data, shape._type == "compound")
2878 # else return None
2879
2880 def _getshapepoly(self, polygon, compound=False):
2881 """Calculate transformed shape polygon according to resizemode

Callers

nothing calls this directly

Calls 1

_getshapepolyMethod · 0.95

Tested by

no test coverage detected