Skip to content

Instantly share code, notes, and snippets.

@adusak
Created June 2, 2015 10:49
Show Gist options
  • Save adusak/256dbd56c0555ce877ff to your computer and use it in GitHub Desktop.
Save adusak/256dbd56c0555ce877ff to your computer and use it in GitHub Desktop.
Polygon Group Class
class PolygonGroup:
def __init__(self, polygons=None):
self.polygons = []
if polygons is not None:
self.polygons.extend(polygons)
def apply_transformation(self, transformation):
list(map(lambda x: x.apply_transformation(transformation), self.polygons))
def draw_to_svg(self, svg):
list(map(lambda x: x.draw_to_svg(svg), self.polygons))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment