def __init__(self, name, rect, layer_name_num): self.name = name # repack the rect as a vector, just in case if type(rect[0]) == vector: self.rect = rect else: self.rect = [vector(rect[0]), vector(rect[1])] # snap the rect to the grid self.rect = [x.snap_to_grid() for x in self.rect] # if it's a layer number look up the layer name. this assumes a unique layer number. if type(layer_name_num) == int: self.layer = layer.keys()[layer.values().index(layer_name_num)] else: self.layer = layer_name_num
def __init__(self, name, rect, layer_name_num): self.name = name # repack the rect as a vector, just in case if type(rect[0])==vector: self.rect = rect else: self.rect = [vector(rect[0]),vector(rect[1])] # snap the rect to the grid self.rect = [x.snap_to_grid() for x in self.rect] debug.check(self.width()>0,"Zero width pin.") debug.check(self.height()>0,"Zero height pin.") # if it's a layer number look up the layer name. this assumes a unique layer number. if type(layer_name_num)==int: self.layer = list(layer.keys())[list(layer.values()).index(layer_name_num)] else: self.layer=layer_name_num self.layer_num = layer[self.layer]