Skip to content

Commit

Permalink
kicad 8 compat (v1.3.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
easyw committed Nov 11, 2024
1 parent 5d21e18 commit c93bcce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Binary file added resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions rf_tools_wizards/uwArcPrimitive_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def smdCustomArcPad(self, module, size, pos, rad, name, angle_D, layer, ln, sold
if not ln:
pad.AddPrimitive(pcbnew.VECTOR2I(int(0),int(rad)), pcbnew.VECTOR2I(int(0),int(0)), pcbnew.EDA_ANGLE(int(angle_D*10),pcbnew.DEGREES_T), (size[0]))
#pad.AddPrimitive(int(0),int(rad), int(0),int(0), pcbnew.EDA_ANGLE(int(angle_D*10),pcbnew.DEGREES_T), (size[0]))
#pad.AddPrimitive((int(0),int(rad)), (int(0),int(0)), pcbnew.EDA_ANGLE(int(angle_D*10),pcbnew.DEGREES_T), (size[0]))
else:
pad.AddPrimitive(pcbnew.VECTOR2I(int(0),int(0)), pcbnew.VECTOR2I(int(rad),int(0)), (size[0]))
return pad
Expand Down
13 changes: 9 additions & 4 deletions via_fence_generator/viafence_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def distance (p1,p2):
class ViaFenceAction(pcbnew.ActionPlugin):
# ActionPlugin descriptive information
def defaults(self):
self.name = "Via Fence Generator\nversion 3.1"
self.name = "Via Fence Generator\nversion 3.2"
self.category = "Modify PCB"
self.description = "Add a via fence to nets or tracks on the board"
self.icon_file_name = os.path.join(os.path.dirname(__file__), "resources/fencing-vias.png")
Expand Down Expand Up @@ -181,9 +181,11 @@ def checkPads(self):
if hasattr(pcbnew, 'EDA_RECT'): # kv5,kv6
hTest = pcbnew.EDA_RECT(start_rect, size_rect)
elif hasattr(pcbnew, 'wxPoint()'): # kv7
hTest = pcbnew.BOX2I(pcbnew.VECTOR2I(start_rect), pcbnew.VECTOR2I(size_rect))
hTest = pcbnew.BOX2I(pcbnew.VECTOR2I(int(start_rect.x), int(start_rect.y)),
pcbnew.VECTOR2I(int(size_rect.x), int(size_rect.y)))
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)))
hTest = pcbnew.BOX2I(pcbnew.VECTOR2I(int(viaPos[0] - local_offset*expansion),int(viaPos[1] - local_offset*expansion)), pcbnew.VECTOR2I(int(2 * expansion * local_offset),int(2 * expansion * local_offset)))
#hTest = pcbnew.BOX2I(start_rect, size_rect)
if pad.HitTest(hTest, False):
#rectangle[x][y] = self.REASON_PAD
wxLogDebug('Hit on Pad: viaPos:'+str(viaPos),debug)
Expand Down Expand Up @@ -268,6 +270,8 @@ def checkTracks(self):
trk_type = pcbnew.TRACK
else:
trk_type = pcbnew.PCB_TRACK
aContained = True
aAccuracy = 0
if track.GetNetCode() != self.viaNetId or type(track) != trk_type: #PCB_VIA_T:
#wxLogDebug('here',True)
#if track.HitTest(pcbnew.EDA_RECT(start_rect, size_rect), False):
Expand All @@ -277,7 +281,8 @@ def checkTracks(self):
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))
hTest = pcbnew.BOX2I(pcbnew.VECTOR2I(int(start_rect.x), int(start_rect.y)),
pcbnew.VECTOR2I(int(size_rect.x), int(size_rect.y)))
if track.HitTest(hTest, aContained, aAccuracy):
#rectangle[x][y] = self.REASON_PAD
wxLogDebug('Hit on Track: viaPos:'+str(viaPos),debug)
Expand Down

0 comments on commit c93bcce

Please sign in to comment.