diff --git a/coil_generator.ipynb b/coil_generator.ipynb index 16fc0a2..2f8aedd 100644 --- a/coil_generator.ipynb +++ b/coil_generator.ipynb @@ -478,8 +478,8 @@ ")\n", "\n", "# wires for connecting to opposite coils\n", - "connection_radius1 = STATOR_HOLE_RADIUS + (TRACK_SPACING)\n", - "connection_radius2 = connection_radius1 + (TRACK_SPACING + VIA_DIAM / 2)\n", + "connection_radius1 = STATOR_HOLE_RADIUS + (2 * TRACK_SPACING)\n", + "connection_radius2 = connection_radius1 + (2 * TRACK_SPACING + VIA_DIAM / 2)\n", "\n", "# draw a 45 degree line from each coil at connection radius 1\n", "# then connect up to connection radius 2\n", diff --git a/coil_plugin.py b/coil_plugin.py index cc5a124..41c998f 100644 --- a/coil_plugin.py +++ b/coil_plugin.py @@ -51,28 +51,6 @@ class CoilPlugin(pcbnew.ActionPlugin): pcb_group = pcbnew.PCB_GROUP(board) # board.Add(pcb_group) - # create the center hole - arc = pcbnew.PCB_SHAPE(board) - arc.SetShape(pcbnew.SHAPE_T_ARC) - arc.SetStart(pcbnew.wxPointMM(stator_hole_radius, 0)) - arc.SetCenter(pcbnew.wxPointMM(0, 0)) - arc.SetArcAngleAndEnd(0, False) - arc.SetLayer(pcbnew.Edge_Cuts) - arc.SetWidth(int(0.1 * pcbnew.IU_PER_MM)) - board.Add(arc) - # pcb_group.AddItem(arc) - - # create the stator outline - arc = pcbnew.PCB_SHAPE(board) - arc.SetShape(pcbnew.SHAPE_T_ARC) - arc.SetStart(pcbnew.wxPointMM(stator_radius, 0)) - arc.SetCenter(pcbnew.wxPointMM(0, 0)) - arc.SetArcAngleAndEnd(0, False) - arc.SetLayer(pcbnew.Edge_Cuts) - arc.SetWidth(int(0.1 * pcbnew.IU_PER_MM)) - board.Add(arc) - # pcb_group.AddItem(arc) - # create tracks for track in coil_data["tracks"]["f"]: # find the matching net for the track @@ -128,5 +106,28 @@ class CoilPlugin(pcbnew.ActionPlugin): # pcb_group.AddItem(pcb_txt) + # create the stator outline + arc = pcbnew.PCB_SHAPE(board) + arc.SetShape(pcbnew.SHAPE_T_CIRCLE) + arc.SetFilled(False) + arc.SetStart(pcbnew.wxPointMM(0, 0)) + arc.SetEnd(pcbnew.wxPointMM(stator_radius, 0)) + arc.SetCenter(pcbnew.wxPointMM(0, 0)) + arc.SetLayer(pcbnew.Edge_Cuts) + arc.SetWidth(int(0.1 * pcbnew.IU_PER_MM)) + board.Add(arc) + # pcb_group.AddItem(arc) + + # create the center hole + arc = pcbnew.PCB_SHAPE(board) + arc.SetShape(pcbnew.SHAPE_T_CIRCLE) + arc.SetFilled(False) + arc.SetStart(pcbnew.wxPointMM(0, 0)) + arc.SetEnd(pcbnew.wxPointMM(stator_hole_radius, 0)) + arc.SetCenter(pcbnew.wxPointMM(0, 0)) + arc.SetLayer(pcbnew.Edge_Cuts) + arc.SetWidth(int(0.1 * pcbnew.IU_PER_MM)) + board.Add(arc) + # pcb_group.AddItem(arc) CoilPlugin().register() # Instantiate and register to Pcbnew])