Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv8 knowing issues #66

Open
easyw opened this issue Apr 7, 2024 · 1 comment
Open

kv8 knowing issues #66

easyw opened this issue Apr 7, 2024 · 1 comment

Comments

@easyw
Copy link
Owner

easyw commented Apr 7, 2024

kv8 knowing issues:

  1. uWArc footprint wizard
  2. via fencingtool
@DanielO
Copy link

DanielO commented Jul 2, 2024

I fixed these like so:

diff --git a/via_fence_generator/viafence_action.py b/via_fence_generator/viafence_action.py
index 82e4bcc..6587956 100755
--- a/via_fence_generator/viafence_action.py
+++ b/via_fence_generator/viafence_action.py
@@ -181,9 +181,11 @@ class ViaFenceAction(pcbnew.ActionPlugin):
                     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(start_rect, size_rect)
+                        #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)
@@ -268,6 +270,8 @@ class ViaFenceAction(pcbnew.ActionPlugin):
                         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):
@@ -277,7 +281,8 @@ class ViaFenceAction(pcbnew.ActionPlugin):
                     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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants