summaryrefslogtreecommitdiff
path: root/gerbonara/cad/breakout.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-05-07 12:58:57 +0200
committerjaseg <git@jaseg.de>2023-05-07 12:59:10 +0200
commit732c58f70b18c5d77451328deab0e472e4d295a0 (patch)
treebb0a894122aa08e8c5354f9e990ba274a0b6d594 /gerbonara/cad/breakout.py
parent4bac77d0b444137befaf70f93c3cc4d402c4275e (diff)
downloadgerbonara-732c58f70b18c5d77451328deab0e472e4d295a0.tar.gz
gerbonara-732c58f70b18c5d77451328deab0e472e4d295a0.tar.bz2
gerbonara-732c58f70b18c5d77451328deab0e472e4d295a0.zip
Extend breakout generator
Diffstat (limited to 'gerbonara/cad/breakout.py')
-rw-r--r--gerbonara/cad/breakout.py38
1 files changed, 38 insertions, 0 deletions
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)