File tree Expand file tree Collapse file tree
examples/shapes_and_collections Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7575parts = dolphin .split ()
7676i = 0
7777code_map = {
78- 'M' : (Path .MOVETO , 1 ),
79- 'C' : (Path .CURVE4 , 3 ),
80- 'L' : (Path .LINETO , 1 )}
78+ 'M' : Path .MOVETO ,
79+ 'C' : Path .CURVE4 ,
80+ 'L' : Path .LINETO ,
81+ }
8182
8283while i < len (parts ):
83- code = parts [i ]
84- path_code , npoints = code_map [ code ]
84+ path_code = code_map [ parts [i ] ]
85+ npoints = Path . NUM_VERTICES_FOR_CODE [ path_code ]
8586 codes .extend ([path_code ] * npoints )
86- vertices .extend ([[float ( x ) for x in y .split (',' )] for y in
87- parts [i + 1 :i + npoints + 1 ]])
87+ vertices .extend ([[* map ( float , y .split (',' ))]
88+ for y in parts [i + 1 :][: npoints ]])
8889 i += npoints + 1
89- vertices = np .array (vertices , float )
90+ vertices = np .array (vertices )
9091vertices [:, 1 ] -= 160
9192
9293dolphin_path = Path (vertices , codes )
You can’t perform that action at this time.
0 commit comments