Skip to content

Commit

Permalink
adding kv8 if test
Browse files Browse the repository at this point in the history
  • Loading branch information
easyw committed Apr 7, 2024
1 parent 643bc96 commit 5d21e18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions via_fence_generator/viafence_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ def checkPads(self):
wxLogDebug(str(pcbnew.ToMM(start_rect))+'::'+str(pcbnew.ToMM(size_rect)),debug)
if hasattr(pcbnew, 'EDA_RECT'): # kv5,kv6
hTest = pcbnew.EDA_RECT(start_rect, size_rect)
else: #kv7
elif hasattr(pcbnew, 'wxPoint()'): # kv7
hTest = pcbnew.BOX2I(pcbnew.VECTOR2I(start_rect), pcbnew.VECTOR2I(size_rect))
else: #kv8
hTest = pcbnew.BOX2I(int(viaPos[0] - local_offset*expansion),int(viaPos[1] - local_offset*expansion), pcbnew.VECTOR2I(int(2 * expansion * local_offset),int(2 * expansion * local_offset)))
if pad.HitTest(hTest, False):
#rectangle[x][y] = self.REASON_PAD
wxLogDebug('Hit on Pad: viaPos:'+str(viaPos),debug)
Expand Down Expand Up @@ -272,7 +274,9 @@ def checkTracks(self):
aContained=False;aAccuracy=0
if hasattr(pcbnew, 'EDA_RECT'): # kv5,kv6
hTest = pcbnew.EDA_RECT(start_rect, size_rect)
else: #kv7
elif hasattr(pcbnew, 'wxPoint()'): # kv7
hTest = pcbnew.BOX2I(pcbnew.VECTOR2I(start_rect), pcbnew.VECTOR2I(size_rect))
else: #kv8
hTest = pcbnew.BOX2I(pcbnew.VECTOR2I(start_rect), pcbnew.VECTOR2I(size_rect))
if track.HitTest(hTest, aContained, aAccuracy):
#rectangle[x][y] = self.REASON_PAD
Expand Down

0 comments on commit 5d21e18

Please sign in to comment.