#NEWLINE# def external_silk( conf ) : #NEWLINE# #INDENT# '\n    Generate an external silkscreen.\n    For two row devices: Horizontal lines top and bottom, semicircle pin 1\n    For four row devices: Three sharp corners and a cut corner for pin 1\n    ' #NEWLINE# out = [ ] #NEWLINE# rows = conf [ 'rows' ] #NEWLINE# chip_shape = conf [ 'chip_shape' ] #NEWLINE# w = silk_width #NEWLINE# l = 'F.SilkS' #NEWLINE# x = ( chip_shape [ 0 ] / 2.0 ) #NEWLINE# y = ( chip_shape [ 1 ] / 2.0 ) #NEWLINE# if ( rows == 2 ) : #NEWLINE# #INDENT# r = silk_pin1_er #NEWLINE# out . append ( fp_line ( ( ( ( - x ) + ( 2 * r ) ) , ( - y ) ) , ( x , ( - y ) ) , l , w ) ) #NEWLINE# out . append ( fp_line ( ( ( - x ) , y ) , ( x , y ) , l , w ) ) #NEWLINE# out . append ( fp_arc ( ( ( ( - x ) + r ) , ( - y ) ) , ( ( - x ) , ( - y ) ) , 180 , l , w ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( rows == 4 ) : #NEWLINE# #INDENT# pins = ( conf [ 'pins' ] / rows ) #NEWLINE# pin_y = ( ( ( pins - 1 ) * conf [ 'pin_pitch' ] ) / 2.0 ) #NEWLINE# chip_y = ( chip_shape [ 1 ] / 2.0 ) #NEWLINE# delta_y = ( chip_y - pin_y ) #NEWLINE# r = ( delta_y - silk_pad_egap ) #NEWLINE# out . append ( fp_line ( ( ( - x ) , ( ( - y ) + r ) ) , ( ( ( - x ) + r ) , ( - y ) ) , l , w ) ) #NEWLINE# out . append ( fp_line ( ( ( x - r ) , ( - y ) ) , ( x , ( - y ) ) , l , w ) ) #NEWLINE# out . append ( fp_line ( ( x , ( - y ) ) , ( x , ( ( - y ) + r ) ) , l , w ) ) #NEWLINE# out . append ( fp_line ( ( ( x - r ) , y ) , ( x , y ) , l , w ) ) #NEWLINE# out . append ( fp_line ( ( x , y ) , ( x , ( y - r ) ) , l , w ) ) #NEWLINE# out . append ( fp_line ( ( ( ( - x ) + r ) , y ) , ( ( - x ) , y ) , l , w ) ) #NEWLINE# out . append ( fp_line ( ( ( - x ) , y ) , ( ( - x ) , ( y - r ) ) , l , w ) ) #NEWLINE# #UNINDENT# #UNINDENT# return out