Merge pull request #52 from CGrassin/feature/add-checkbox-to-ignore-rule-areas

Added checkbox to ignore areas on other layers (implement #40)
This commit is contained in:
Jean-Samuel Reynaud
2023-02-22 10:03:50 +01:00
committed by GitHub
4 changed files with 143 additions and 3 deletions

View File

@ -64,6 +64,7 @@ FillArea.FillArea().SetDebug().SetNetname("GND").SetStepMM(1.27).SetSizeMM(0.6).
# with
# SetDebug: Activate debug mode (print evolution of the board in ascii art)
# SetViaThroughAreas: Ignores areas on other layers
# SetNetname: Change the netname to consider for the filling
# (default is /GND or fallback to GND)
# SetStepMM: Change step between Via (in mm)
@ -130,6 +131,7 @@ class FillArea:
self.SetClearanceMM(0.2)
self.only_selected_area = False
self.delete_vias = False
self.via_through_areas = False
if self.pcb is not None:
for lnet in ["GND", "/GND"]:
if self.pcb.FindNet(lnet) is not None:
@ -162,6 +164,10 @@ class FillArea:
self.random = r
return self
def SetViaThroughAreas(self, r):
self.via_through_areas = r
return self
def SetType(self, type):
self.fill_type = type
return self
@ -308,11 +314,11 @@ STEP = '-'
if is_rule_exclude_via_area and (hit_test_area or hit_test_edge or hit_test_zone):
return self.REASON_KEEPOUT # Collides with keepout/rules
elif (hit_test_area or hit_test_edge) and not is_rules_area:
elif (not self.via_through_areas) and (hit_test_area or hit_test_edge) and not is_rules_area:
# Collides with another signal (e.g. on another layer) but not a rule zone
return self.REASON_OTHER_SIGNAL
elif hit_test_zone and not is_rules_area:
elif (not self.via_through_areas) and hit_test_zone and not is_rules_area:
# Check if the zone is higher priority than other zones of the target net in the same point
# target_areas_on_same_layer = filter(lambda x: ((x.GetPriority() > area_priority) and (x.GetLayer() == area_layer) and (x.GetNetname().upper() == self.netname)), all_areas)
target_areas_on_same_layer = filter(lambda x: ((x.GetPriority() > area_priority) and (