Merge remote-tracking branch 'origin/v7.0'

This commit is contained in:
Jean-Samuel REYNAUD
2024-01-18 10:08:03 +01:00
2 changed files with 17 additions and 16 deletions

View File

@ -272,9 +272,14 @@ STEP = '-'
def RefillBoardAreas(self):
for i in range(self.pcb.GetAreaCount()):
area = self.pcb.GetArea(i)
area.UnFill()
filler = ZONE_FILLER(self.pcb)
filler.Fill(self.pcb.Zones())
# No more making a real refill since it's crashing KiCad
if Version() < '7':
None
else:
area.SetNeedRefill(True)
# area.UnFill()
# filler = ZONE_FILLER(self.pcb)
# filler.Fill(self.pcb.Zones())
def CheckViaInAllAreas(self, via, all_areas):
'''
@ -316,7 +321,7 @@ STEP = '-'
hit_test_zone = area.HitTestInsideZone(VECTOR2I(point_to_test)) # Is inside a zone (e.g. KeepOut/Rules)
except:
hit_test_zone = False
wxPrint('exception: missing HitTestInsideZone: To Be Fixed')
# wxPrint('exception: missing HitTestInsideZone: To Be Fixed (not available in kicad 7.0)')
# hit_test_zone = area.HitTest(point_to_test)
# Is inside a zone (e.g. KeepOut/Rules with via exlusion) kicad
@ -417,14 +422,11 @@ STEP = '-'
return via_placed
def ConcentricFillVias(self):
wxPrint("Refill all zones")
self.RefillBoardAreas()
wxPrint("Calculate placement areas")
zones = [zone for zone in self.pcb.Zones() if zone.GetNetname() == self.netname]
self.parent_area = zones[0]
# Create set of polygons where fill zones overlap on all layers
poly_set = None
for layer_id in self.pcb.GetEnabledLayers().CuStack():
@ -476,11 +478,10 @@ STEP = '-'
else:
poly_set = SHAPE_POLY_SET()
wxPrint("Refill all zones")
self.RefillBoardAreas()
msg = "{:d} vias placed\n".format(via_placed)
wxPrint(msg+"Done!")
msg = "Done. {:d} vias placed. You have to refill all your pcb's areas/zones !!!".format(via_placed)
wxPrint(msg)
return via_placed
@ -809,8 +810,8 @@ STEP = '-'
if self.filename:
self.pcb.Save(self.filename)
msg = "{:d} vias placed\n".format(via_placed)
wxPrint(msg+"Done!")
msg = "Done. {:d} vias placed. You have to refill all your pcb's areas/zones !!!".format(via_placed)
wxPrint(msg)
if __name__ == '__main__':

View File

@ -68,7 +68,7 @@ class FillAreaAction(pcbnew.ActionPlugin):
PopulateNets("GND", a)
modal_result = a.ShowModal()
if modal_result == wx.ID_OK:
wx.LogMessage('Via Stitching: Version 1.5')
wx.LogMessage('Via Stitching')
if 1: # try:
fill = FillArea.FillArea()
fill.SetStepMM(float(a.m_StepMM.GetValue().replace(',', '.')))