diff --git a/python/pcb.py b/python/pcb.py index 61dbc732e979899888535e66ff1a63e0dc73b900..0137778c05440c75beb5978d25f21c0086885f0a 100755 --- a/python/pcb.py +++ b/python/pcb.py @@ -20,6 +20,7 @@ ############################################################ #output = "top, labels, and exterior" +#output = "top, labels, and holes" #output = "top, labels, holes, and exterior" #output = "top, bottom, labels, and exterior" output = "top, bottom, labels, holes, and exterior" @@ -957,6 +958,8 @@ class text: class PCB: def __init__(self,x0,y0,width,height,mask): + self.width = width + self.height = height self.board = false self.labels = false self.interior = rectangle(x0,x0+width,y0,y0+height) @@ -971,6 +974,14 @@ class PCB: self.mask = add(self.mask,move(part,mask,mask)) self.mask = add(self.mask,move(part,mask,-mask)) return self + def panel(self,pcb,dx,dy,dz=0): + self.board = add(self.board,translate(pcb.board,dx,dy,dz)) + self.interior = add(self.interior,translate(pcb.interior,dx,dy,dz)) + self.exterior = intersect(self.exterior,translate(pcb.exterior,dx,dy,dz)) + self.mask = add(self.mask,translate(pcb.mask,dx,dy,dz)) + self.holes = add(self.holes,translate(pcb.holes,dx,dy,dz)) + self.width = self.width+dx + self.height = self.height+dy def text(self,str,x,y,line=0.01,color=White): self.labels = add(self.labels,text('pcb.py',x+.17,V3.y,line=line,color=color).shape) @@ -10300,6 +10311,10 @@ if (output == "top, labels, and exterior"): outputs["function"] = add(add(color(Tan,pcb.board),pcb.labels), color(White,pcb.exterior)) outputs["layers"] = [zt] +elif (output == "top, labels, and holes"): + outputs["function"] = add(add(color(Tan,pcb.board),pcb.labels), + color(Blue,pcb.holes)) + outputs["layers"] = [zt] elif (output == "top, labels, holes, and exterior"): outputs["function"] = add(add(color(Tan,pcb.board),pcb.labels), add(color(White,pcb.exterior),color(Blue,pcb.holes))) @@ -10364,9 +10379,9 @@ else: border = 0.05 outputs["xmin"] = x-border # min x to render -outputs["xmax"] = x+width+border # max x to render +outputs["xmax"] = x+pcb.width+border # max x to render outputs["ymin"] = y-border # min y to render -outputs["ymax"] = y+height+border # max y to render +outputs["ymax"] = y+pcb.height+border # max y to render outputs["mm_per_unit"] = 25.4 # use inch units outputs["type"] = "RGB" # use RGB color