#NEWLINE# @ classmethod #NEWLINE# def _make_specification( cls ) : #NEWLINE# #INDENT# 'Return a dict that describes this supershape.' #NEWLINE# side = 1.0 #NEWLINE# hex_w = ( ( 0.5 * side ) * ( 3 ** 0.5 ) ) #NEWLINE# hex_v_cap = ( side * math . sin ( ( math . pi / 6.0 ) ) ) #NEWLINE# s_partial_long = ( float ( side ) / math . tan ( ( math . pi / 3.0 ) ) ) #NEWLINE# s_partial_short = ( side - s_partial_long ) #NEWLINE# dmd_h_offset = ( s_partial_short * math . cos ( ( math . pi / 6.0 ) ) ) #NEWLINE# dmd_v_offset = ( s_partial_short * math . sin ( ( math . pi / 6.0 ) ) ) #NEWLINE# dmd_v_partial = ( float ( side ) / math . cos ( ( math . pi / 6.0 ) ) ) #NEWLINE# hex_top_rail = ( - hex_v_cap ) #NEWLINE# hex_midtop_rail = 0.0 #NEWLINE# hex_midbottom_rail = side #NEWLINE# hex_bottom_rail = ( side + hex_v_cap ) #NEWLINE# dmd_outer_v_mid = ( ( - side ) * math . sin ( ( math . pi / 3.0 ) ) ) #NEWLINE# top_rail = ( ( - dmd_v_partial ) - dmd_v_offset ) #NEWLINE# hex_left_rail = 0.0 #NEWLINE# hex_h_mid_rail = hex_w #NEWLINE# hex_right_rail = ( 2 * hex_w ) #NEWLINE# left_rail = ( - side ) #NEWLINE# dmd_left_rail = ( ( - side ) * math . cos ( ( math . pi / 3.0 ) ) ) #NEWLINE# dmd_right_rail = ( hex_right_rail + ( side * math . cos ( ( math . pi / 3.0 ) ) ) ) #NEWLINE# hex_bottom_pt = ( hex_bottom_rail , hex_h_mid_rail ) #NEWLINE# hex_btm_left_pt = ( hex_midbottom_rail , hex_left_rail ) #NEWLINE# hex_top_left_pt = ( hex_midtop_rail , hex_left_rail ) #NEWLINE# hex_top_pt = ( hex_top_rail , hex_h_mid_rail ) #NEWLINE# hex_top_right_pt = ( hex_midtop_rail , hex_right_rail ) #NEWLINE# hex_btm_right_pt = ( dmd_left_rail , hex_right_rail ) #NEWLINE# sqr_btm_left_pt = ( hex_midbottom_rail , left_rail ) #NEWLINE# sqr_top_left_pt = ( hex_midtop_rail , left_rail ) #NEWLINE# ldmd_left_pt = ( dmd_outer_v_mid , dmd_left_rail ) #NEWLINE# ldmd_top_pt = ( top_rail , ( hex_left_rail + dmd_h_offset ) ) #NEWLINE# rdmd_top_pt = ( top_rail , ( hex_right_rail - dmd_h_offset ) ) #NEWLINE# rdmd_right_pt = ( dmd_outer_v_mid , dmd_right_rail ) #NEWLINE# c = { #NEWLINE# #INDENT# ( 0 , 0 ) : { #NEWLINE# #INDENT# 'name' : 'left_triangle' , #NEWLINE# 'clockwise_edge_names' : ( 'left' , 'right' , 'bottom' ) , #NEWLINE# 'edges' : { #NEWLINE# #INDENT# ( 1 , ( - 1 ) ) : { #NEWLINE# #INDENT# 'name' : 'left' , #NEWLINE# 'counter_vertex' : sqr_top_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 0 , 1 ) : { #NEWLINE# #INDENT# 'name' : 'right' , #NEWLINE# 'counter_vertex' : ldmd_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 0 ) : { #NEWLINE# #INDENT# 'name' : 'bottom' , #NEWLINE# 'counter_vertex' : hex_top_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 0 , 1 ) : { #NEWLINE# #INDENT# 'name' : 'left_diamond' , #NEWLINE# 'clockwise_edge_names' : ( 'top_left' , 'top_right' , 'bottom_right' , 'bottom_left' ) , #NEWLINE# 'edges' : { #NEWLINE# #INDENT# ( ( - 1 ) , 1 ) : { #NEWLINE# #INDENT# 'name' : 'top_left' , #NEWLINE# 'counter_vertex' : ldmd_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 0 , 2 ) : { #NEWLINE# #INDENT# 'name' : 'top_right' , #NEWLINE# 'counter_vertex' : ldmd_top_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 1 ) : { #NEWLINE# #INDENT# 'name' : 'bottom_right' , #NEWLINE# 'counter_vertex' : hex_top_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 0 , 0 ) : { #NEWLINE# #INDENT# 'name' : 'bottom_left' , #NEWLINE# 'counter_vertex' : hex_top_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 0 , 2 ) : { #NEWLINE# #INDENT# 'name' : 'top_triangle' , #NEWLINE# 'clockwise_edge_names' : ( 'left' , 'top' , 'right' ) , #NEWLINE# 'edges' : { #NEWLINE# #INDENT# ( 0 , 1 ) : { #NEWLINE# #INDENT# 'name' : 'left' , #NEWLINE# 'counter_vertex' : hex_top_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( ( - 1 ) , 3 ) : { #NEWLINE# #INDENT# 'name' : 'top' , #NEWLINE# 'counter_vertex' : ldmd_top_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 2 ) : { #NEWLINE# #INDENT# 'name' : 'right' , #NEWLINE# 'counter_vertex' : rdmd_top_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 0 ) : { #NEWLINE# #INDENT# 'name' : 'square' , #NEWLINE# 'clockwise_edge_names' : ( 'left' , 'top' , 'right' , 'bottom' ) , #NEWLINE# 'edges' : { #NEWLINE# #INDENT# ( 1 , ( - 2 ) ) : { #NEWLINE# #INDENT# 'name' : 'left' , #NEWLINE# 'counter_vertex' : sqr_btm_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 0 , 0 ) : { #NEWLINE# #INDENT# 'name' : 'top' , #NEWLINE# 'counter_vertex' : sqr_top_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 1 ) : { #NEWLINE# #INDENT# 'name' : 'right' , #NEWLINE# 'counter_vertex' : hex_top_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 2 , ( - 1 ) ) : { #NEWLINE# #INDENT# 'name' : 'bottom' , #NEWLINE# 'counter_vertex' : hex_btm_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 1 ) : { #NEWLINE# #INDENT# 'name' : 'hexagon' , #NEWLINE# 'clockwise_edge_names' : ( 'left' , 'top_left' , 'top_right' , 'right' , 'bottom_right' , 'bottom_left' ) , #NEWLINE# 'edges' : { #NEWLINE# #INDENT# ( 1 , 0 ) : { #NEWLINE# #INDENT# 'name' : 'left' , #NEWLINE# 'counter_vertex' : hex_btm_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 0 , 1 ) : { #NEWLINE# #INDENT# 'name' : 'top_left' , #NEWLINE# 'counter_vertex' : hex_top_left_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 2 ) : { #NEWLINE# #INDENT# 'name' : 'top_right' , #NEWLINE# 'counter_vertex' : hex_top_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 3 ) : { #NEWLINE# #INDENT# 'name' : 'right' , #NEWLINE# 'counter_vertex' : hex_top_right_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 2 , 1 ) : { #NEWLINE# #INDENT# 'name' : 'bottom_right' , #NEWLINE# 'counter_vertex' : hex_btm_right_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 3 , ( - 1 ) ) : { #NEWLINE# #INDENT# 'name' : 'bottom_left' , #NEWLINE# 'counter_vertex' : hex_bottom_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 2 ) : { #NEWLINE# #INDENT# 'name' : 'right_diamond' , #NEWLINE# 'clockwise_edge_names' : ( 'top_left' , 'top_right' , 'bottom_right' , 'bottom_left' ) , #NEWLINE# 'edges' : { #NEWLINE# #INDENT# ( 0 , 2 ) : { #NEWLINE# #INDENT# 'name' : 'top_left' , #NEWLINE# 'counter_vertex' : hex_top_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( ( - 1 ) , 4 ) : { #NEWLINE# #INDENT# 'name' : 'top_right' , #NEWLINE# 'counter_vertex' : rdmd_top_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 0 , 3 ) : { #NEWLINE# #INDENT# 'name' : 'bottom_right' , #NEWLINE# 'counter_vertex' : rdmd_right_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# ( 1 , 1 ) : { #NEWLINE# #INDENT# 'name' : 'bottom_left' , #NEWLINE# 'counter_vertex' : hex_top_right_pt , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# d = { #NEWLINE# #INDENT# 'name' : 'HexaFlower' , #NEWLINE# 'reference_length' : side , #NEWLINE# 'graph_offset_per_row' : ( ( float ( ( hex_bottom_rail + abs ( dmd_outer_v_mid ) ) ) / 2 ) , ( float ( ( ( 2 * hex_w ) - dmd_h_offset ) ) / 2 ) ) , #NEWLINE# 'graph_offset_per_col' : ( 0.0 , ( float ( ( ( 2 * hex_w ) + side ) ) / 3 ) ) , #NEWLINE# 'components' : c , #NEWLINE# #UNINDENT# } #NEWLINE# return d