Open iysheng opened 1 year ago
After I made change as below, it can fanout as, but Spacing button can't be changed, is this right?
diff --git a/onekiwi/model/bga.py b/onekiwi/model/bga.py
index b9f7f64..fce80c4 100644
--- a/onekiwi/model/bga.py
+++ b/onekiwi/model/bga.py
@@ -1,6 +1,8 @@
import pcbnew
import math
+M_PI = 3.1415926535897932384626433832795
+
class BGA:
def __init__(self, board, reference, track, via, alignment, direction, logger):
self.logger = logger
@@ -17,7 +19,7 @@ class BGA:
self.logger.info(reference)
self.radian_pad = 0.0
self.footprint = self.board.FindFootprintByReference(reference)
- self.radian = self.footprint.GetOrientationRadians()
+ self.radian = self.footprint.GetOrientation()
self.degrees = self.footprint.GetOrientationDegrees()
self.pads = self.footprint.Pads()
self.x0 = self.footprint.GetPosition().x
@@ -118,8 +120,8 @@ class BGA:
ytrack.SetLayer(pcbnew.F_Cu)
self.board.Add(ytrack)
else:
- anphalx = (-1)*math.tan(self.radian)
- anphaly = 1/math.tan(self.radian)
+ anphalx = (-1)*self.radian.Tan()
+ anphaly = 1/(self.radian.Tan())
bx = self.y0 - anphalx*self.x0
by = self.y0 - anphaly*self.x0
@@ -269,8 +271,8 @@ class BGA:
self.add_via(net, end)
def quadrant_other_angle(self):
- anphalx = (-1)*math.tan(self.radian)
- anphaly = 1/math.tan(self.radian)
+ anphalx = (-1)*self.radian.Tan()
+ anphaly = 1/(self.radian.Tan())
bx0 = self.y0 - anphalx*self.x0
by0 = self.y0 - anphaly*self.x0
@@ -568,7 +570,7 @@ class BGA:
def add_track(self, net, start, end):
track = pcbnew.PCB_TRACK(self.board)
track.SetStart(start)
- track.SetEnd(end)
+ track.SetEnd(pcbnew.VECTOR2I(end))
track.SetWidth(self.track)
track.SetLayer(pcbnew.F_Cu)
track.SetNetCode(net)
@@ -578,7 +580,7 @@ class BGA:
def add_via(self, net, pos):
via = pcbnew.PCB_VIA(self.board)
via.SetViaType(pcbnew.VIATYPE_THROUGH)
- via.SetPosition(pos)
+ via.SetPosition(pcbnew.VECTOR2I(pos))
via.SetWidth(int(self.via.m_Diameter))
via.SetDrill(self.via.m_Drill)
via.SetNetCode(net)
@@ -589,4 +591,4 @@ class BGA:
for item in self.tracks:
self.board.Remove(item)
self.tracks.clear()
- pcbnew.Refresh()
\ No newline at end of file
+ pcbnew.Refresh()
@iysheng That's cool. I verified that your changes can work on kicad7.0
thanks @iysheng, i just update. Please update to version 1.1.0
I failed do fantout on kicad v6.99 version as: is there some way to debug this ?