<s> import pygame <EOL> from pygame . locals import * <EOL> from py2d . Math import * <EOL> from py2d . SVG import convert_svg <EOL> from examples import Example <EOL> class SVGConverter ( Example ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , runner ) : <EOL> self . runner = runner <EOL> self . title = "<STR_LIT>" <EOL> self . polys = [ ] <EOL> for id , polys in convert_svg ( "<STR_LIT>" , bezier_max_divisions = None ) . iteritems ( ) : <EOL> self . polys . append ( polys ) <EOL> self . decomp = [ ] <EOL> self . poly_colors = [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] <EOL> def render ( self ) : <EOL> t = Transform . unit ( ) <EOL> for j , p in enumerate ( self . polys ) : <EOL> for i , h in enumerate ( p ) : <EOL> self . draw_poly ( t * h , self . poly_colors [ j % len ( self . poly_colors ) ] , False ) <EOL> def draw_poly ( self , poly , color , fill ) : <EOL> if len ( poly ) > <NUM_LIT:1> : <EOL> if fill and len ( poly ) > <NUM_LIT:2> : <EOL> pygame . draw . polygon ( self . runner . screen , color , poly . as_tuple_list ( ) ) <EOL> pygame . draw . lines ( self . runner . screen , color , True , poly . as_tuple_list ( ) ) <EOL> elif poly . points : <EOL> pygame . draw . circle ( self . runner . screen , color , poly . points [ <NUM_LIT:0> ] . as_tuple ( ) , <NUM_LIT:2> ) </s>
