From ea5d87721a388f84f614b92c07af3d5762681bee Mon Sep 17 00:00:00 2001 From: Neil Gershenfeld <gersh@cba.mit.edu> Date: Fri, 4 Oct 2024 20:48:38 -0400 Subject: [PATCH] labels out --- python/pcb.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python/pcb.py b/python/pcb.py index 946d703..6e129f4 100755 --- a/python/pcb.py +++ b/python/pcb.py @@ -34,6 +34,8 @@ output = "top, bottom, labels, holes, and exterior" #output = "exterior" #output = "top solder mask" #output = "bottom solder mask" +#output = "labels" +#output = "labels minus top mask" ############################################################ # import @@ -969,6 +971,8 @@ class PCB: self.mask = add(self.mask,move(part,mask,mask)) self.mask = add(self.mask,move(part,mask,-mask)) return self + 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) class point: def __init__(self,x,y,z=0): @@ -10218,6 +10222,8 @@ pcb = wire(pcb,w, point(V7.x,V6.y,zb), V7.pad[2]) +pcb.text('pcb.py',x,V3.y,line=0.01,color=White) + ############################################################ # select output ############################################################ @@ -10276,6 +10282,12 @@ elif (output == "top solder mask"): elif (output == "bottom solder mask"): outputs["function"] = color(White,pcb.mask) outputs["layers"] = [zb] +elif (output == "labels"): + outputs["function"] = color(White,pcb.labels) + outputs["layers"] = [zt] +elif (output == "labels minus top mask"): + outputs["function"] = subtract(color(White,pcb.labels),color(White,pcb.mask)) + outputs["layers"] = [zt] else: print("oops -- don't recognize output") -- GitLab