#NEWLINE# def _parse_pad( self , pad ) : #NEWLINE# #INDENT# layers = sexp . find ( pad , 'layers' ) [ 1 ] #NEWLINE# if ( ( 'F.Cu' not in layers ) and ( '*.Cu' not in layers ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# pad_type = pad [ 2 ] #NEWLINE# if ( pad_type not in ( 'smd' , 'thru_hole' ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# at = [ float ( x ) for x in sexp . find ( pad , 'at' ) [ 1 : ] ] #NEWLINE# size = [ float ( x ) for x in sexp . find ( pad , 'size' ) [ 1 : ] ] #NEWLINE# drill = sexp . find ( pad , 'drill' ) #NEWLINE# if drill : #NEWLINE# #INDENT# offset = sexp . find ( drill , 'offset' ) #NEWLINE# if offset : #NEWLINE# #INDENT# at [ 0 ] += float ( offset [ 1 ] ) #NEWLINE# at [ 1 ] += float ( offset [ 2 ] ) #NEWLINE# #UNINDENT# #UNINDENT# topleft = ( ( at [ 0 ] - ( size [ 0 ] / 2 ) ) , ( at [ 1 ] - ( size [ 1 ] / 2 ) ) ) #NEWLINE# shape = pad [ 3 ] #NEWLINE# if ( shape in ( 'rect' , 'oval' ) ) : #NEWLINE# #INDENT# self . rect_pads . append ( ( topleft , size ) ) #NEWLINE# self . _update_bounds ( at , dx = ( size [ 0 ] / 2 ) , dy = ( size [ 1 ] / 2 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( shape == 'circle' ) : #NEWLINE# #INDENT# self . circ_pads . append ( ( at , ( size [ 0 ] / 2 ) ) ) #NEWLINE# self . _update_bounds ( at , dx = ( size [ 0 ] / 2 ) , dy = ( size [ 0 ] / 2 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _update_bounds ( size )