Fix THT flower proto area
This commit is contained in:
parent
ef3b5d5e1c
commit
4c3815b25a
3 changed files with 30 additions and 8 deletions
|
|
@ -127,7 +127,6 @@ class Board:
|
|||
layer_stack['mechanical', 'outline'].objects.extend(self.outline)
|
||||
layer_stack['top', 'silk'].objects.extend(self.extra_silk_top)
|
||||
layer_stack['bottom', 'silk'].objects.extend(self.extra_silk_bottom)
|
||||
print('layer stack is', repr(layer_stack['top', 'copper'].objects)[:1000])
|
||||
|
||||
return layer_stack
|
||||
|
||||
|
|
|
|||
|
|
@ -271,10 +271,12 @@ class PatternProtoArea:
|
|||
|
||||
for i in range(n_x):
|
||||
for j in range(n_y):
|
||||
if isinstance(self.obj, PadStack):
|
||||
obj = self.obj.grid_variant(i, j, i == n_x-1, j == n_y-1)
|
||||
if obj is None:
|
||||
continue
|
||||
obj = self.obj
|
||||
if isinstance(obj, PadStack):
|
||||
if hasattr(obj, 'grid_variant'):
|
||||
obj = obj.grid_variant(i, j, i == n_x-1, j == n_y-1)
|
||||
if obj is None:
|
||||
continue
|
||||
|
||||
px = self.unit(off_x + x, unit) + (i + 0.5) * self.pitch_x
|
||||
py = self.unit(off_y + y, unit) + (j + 0.5) * self.pitch_y
|
||||
|
|
@ -323,6 +325,10 @@ class ManhattanPads(PadStack):
|
|||
h: float = None
|
||||
gap: float = 0.2
|
||||
|
||||
@property
|
||||
def single_sided(self):
|
||||
return True
|
||||
|
||||
@property
|
||||
def apertures(self):
|
||||
w = self.w
|
||||
|
|
@ -360,6 +366,10 @@ class RFGroundProto(PadStack):
|
|||
_: KW_ONLY = None
|
||||
suppress_via: bool = False
|
||||
|
||||
@property
|
||||
def single_sided(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def apertures(self):
|
||||
unit = self.unit
|
||||
|
|
@ -406,12 +416,20 @@ class THTFlowerProto(PadStack):
|
|||
pitch: float = 2.54
|
||||
drill: float = 0.9
|
||||
diameter: float = 2.0
|
||||
clearance: float = 0.5
|
||||
|
||||
@property
|
||||
def single_sided(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def apertures(self):
|
||||
p = self.pitch / 2
|
||||
p = self.diameter / 2
|
||||
pad_dist_diag = math.sqrt(2) * (self.pitch - p) - self.drill
|
||||
pad_dist_ortho = 2*self.pitch - self.diameter - self.drill
|
||||
pad_dia = self.drill + max(0, min(pad_dist_diag, pad_dist_ortho) - self.clearance)
|
||||
|
||||
pad = THTPad.circle(self.drill, self.diameter, paste=False, unit=self.unit)
|
||||
pad = THTPad.circle(self.drill, pad_dia, paste=False, unit=self.unit)
|
||||
|
||||
for ox, oy in ((-p, 0), (p, 0), (0, -p), (0, p)):
|
||||
for stack_ap in pad.apertures:
|
||||
|
|
@ -452,6 +470,10 @@ class PoweredProto(Graphics):
|
|||
Yajima Manufacturing Corporation website: http://www.yajima-works.co.jp/index.html
|
||||
"""
|
||||
|
||||
@property
|
||||
def single_sided(self):
|
||||
return False
|
||||
|
||||
def __init__(self, pitch=None, drill=None, clearance=None, power_pad_dia=None, via_size=None, trace_width=None, unit=MM):
|
||||
super().__init__(0, 0)
|
||||
self.unit = unit
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@ def deserialize(obj, unit):
|
|||
pitch = mil(float(obj.get('pitch', 2.54)))
|
||||
hole_dia = mil(float(obj['hole_dia']))
|
||||
pattern_dia = mil(float(obj['pattern_dia']))
|
||||
return pb.PatternProtoArea(2*pitch, 2*pitch, pb.THTFlowerProto(pitch, hole_dia, pattern_dia, unit=unit), unit=unit)
|
||||
clearance = mil(float(obj['clearance']))
|
||||
return pb.PatternProtoArea(pitch, pitch, pb.THTFlowerProto(pitch, hole_dia, pattern_dia, clearance, unit=unit), unit=unit)
|
||||
|
||||
case 'spiky':
|
||||
return pb.PatternProtoArea(2.54, 2.54, pb.SpikyProto(), unit=unit)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue