From 732c58f70b18c5d77451328deab0e472e4d295a0 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 7 May 2023 12:58:57 +0200 Subject: Extend breakout generator --- gerbonara/cad/breakout.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gerbonara/cad/breakout.py b/gerbonara/cad/breakout.py index fae06c9..16d59ff 100644 --- a/gerbonara/cad/breakout.py +++ b/gerbonara/cad/breakout.py @@ -32,6 +32,44 @@ class PadRing(Positioned): yield (x+self.pitch/2 + i*self.pitch, y+offset) yield (x+self.pitch/2 + i*self.pitch, y+(self.h+1)*self.pitch-offset) + for i in range(0, self.w): + yield (x + (i+1)*self.pitch, y+offset) + yield (x + (i+1)*self.pitch, y+(self.h+1)*self.pitch-offset) + + for i in range(1, self.h): + yield (x+offset, y+self.pitch/2 + i*self.pitch) + yield (x+(self.w+1)*self.pitch-offset, y+self.pitch/2 + i*self.pitch) + + for i in range(0, self.h): + yield (x+offset, y + (i+1)*self.pitch) + yield (x+(self.w+1)*self.pitch-offset, y + (i+1)*self.pitch) + + + def generate(self, bbox, border_text, unit=MM): + x, y, rotation = self.abs_pos + + x += self.pitch/2 + y += self.pitch/2 + + x += self.pitch * self.rows + y += self.pitch * self.rows + + pad_dia = self.pitch - 2*self.clearance - self.trace_width + + for i in range(self.w + 2 + 2*(self.rows-1)): + for j in range(self.rows): + yield THTPad.circle(x + (i - (self.rows - 1))*self.pitch, y - j*self.pitch, self.drill_dia, pad_dia, paste=False) + yield THTPad.circle(x + (i - (self.rows - 1))*self.pitch, y + (self.h + 1 + j)*self.pitch, self.drill_dia, pad_dia, paste=False) + + if self.rows >= 2 and 1 <= i < self.w: + yield Trace(self.trace_width, start=(x+i*self.pitch, y-self.pitch), end=(x+(i + 0.5)*self.pitch, y+pad_dia/2 - self.trace_width/2)) + yield Trace(self.trace_width, start=(x+i*self.pitch, y+(self.h+2)*self.pitch), end=(x+(i + 0.5)*self.pitch, y+(self.h+1)*self.pitch -pad_dia/2 + self.trace_width/2), orientation=('cw',)) + + for i in range(1, self.h+1): + for j in range(self.rows): + yield THTPad.circle(x - j*self.pitch, y + i*self.pitch, self.drill_dia, pad_dia, paste=False) + yield THTPad.circle(x + (self.w + 1 + j)*self.pitch, y + i*self.pitch, self.drill_dia, pad_dia, paste=False) + for i in range(1, self.h): yield (x+offset, y+self.pitch/2 + i*self.pitch) yield (x+(self.w+1)*self.pitch-offset, y+self.pitch/2 + i*self.pitch) -- cgit