#NEWLINE# def fab( conf ) : #NEWLINE# #INDENT# '\n    Generate a drawing of the chip on the Fab layer, including its outline,\n    the outline of the pins, and a pin 1 indicator.\n    ' #NEWLINE# ( chip_w , chip_h ) = conf [ 'chip_shape' ] #NEWLINE# ( pin_w , pin_h ) = conf [ 'pin_shape' ] #NEWLINE# out = [ ] #NEWLINE# ( nw , _ , _ , _ , sq ) = draw_square ( chip_w , chip_h , ( 0 , 0 ) , 'F.Fab' , fab_width ) #NEWLINE# out += sq #NEWLINE# centre = ( ( nw [ 0 ] + fab_pin1_offset ) , ( nw [ 1 ] + fab_pin1_offset ) ) #NEWLINE# end = ( centre [ 0 ] , ( centre [ 1 ] + fab_pin1_r ) ) #NEWLINE# out . append ( fp_circle ( centre , end , 'F.Fab' , fab_width ) ) #NEWLINE# ( leftr , bottomr , rightr , topr ) = pin_centres ( conf ) #NEWLINE# idx = 1 #NEWLINE# for pin in leftr : #NEWLINE# #INDENT# idx += 1 #NEWLINE# if ( ( idx - 1 ) in conf . get ( 'skip_pins' , [ ] ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# xy = ( ( ( - ( chip_w + pin_w ) ) / 2.0 ) , pin [ 1 ] ) #NEWLINE# ( _ , _ , _ , _ , sq ) = draw_square ( pin_w , pin_h , xy , 'F.Fab' , fab_width ) #NEWLINE# out += [ sq [ 0 ] , sq [ 2 ] , sq [ 3 ] ] #NEWLINE# #UNINDENT# for pin in rightr : #NEWLINE# #INDENT# idx += 1 #NEWLINE# if ( ( idx - 1 ) in conf . get ( 'skip_pins' , [ ] ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# xy = ( ( ( chip_w + pin_w ) / 2.0 ) , pin [ 1 ] ) #NEWLINE# ( _ , _ , _ , _ , sq ) = draw_square ( pin_w , pin_h , xy , 'F.Fab' , fab_width ) #NEWLINE# out += [ sq [ 0 ] , sq [ 1 ] , sq [ 2 ] ] #NEWLINE# #UNINDENT# if ( conf [ 'rows' ] == 4 ) : #NEWLINE# #INDENT# for pin in topr : #NEWLINE# #INDENT# idx += 1 #NEWLINE# if ( ( idx - 1 ) in conf . get ( 'skip_pins' , [ ] ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# xy = ( pin [ 0 ] , ( ( - ( chip_h + pin_w ) ) / 2.0 ) ) #NEWLINE# ( _ , _ , _ , _ , sq ) = draw_square ( pin_h , pin_w , xy , 'F.Fab' , fab_width ) #NEWLINE# out += [ sq [ 0 ] , sq [ 1 ] , sq [ 3 ] ] #NEWLINE# #UNINDENT# for pin in bottomr : #NEWLINE# #INDENT# idx += 1 #NEWLINE# if ( ( idx - 1 ) in conf . get ( 'skip_pins' , [ ] ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# xy = ( pin [ 0 ] , ( ( chip_h + pin_w ) / 2.0 ) ) #NEWLINE# ( _ , _ , _ , _ , sq ) = draw_square ( pin_h , pin_w , xy , 'F.Fab' , fab_width ) #NEWLINE# out += [ sq [ 1 ] , sq [ 2 ] , sq [ 3 ] ] #NEWLINE# #UNINDENT# #UNINDENT# return out