mirror of
https://github.com/atomic14/kicad-coil-plugins.git
synced 2024-10-18 09:06:57 +00:00
More tweaks
This commit is contained in:
parent
a914baefd9
commit
e200c08fa2
3 changed files with 62 additions and 47 deletions
|
@ -64,8 +64,8 @@
|
||||||
"STATOR_RADIUS = 23\n",
|
"STATOR_RADIUS = 23\n",
|
||||||
"STATOR_HOLE_RADIUS = 5\n",
|
"STATOR_HOLE_RADIUS = 5\n",
|
||||||
"SCREW_HOLE_RADIUS = 20\n",
|
"SCREW_HOLE_RADIUS = 20\n",
|
||||||
"SCREW_HOLE_DRILL_DIAM = 3.2 # 3.2mm drill for a 3mm screw\n",
|
"SCREW_HOLE_DRILL_DIAM = 2.3 # 2.3mm drill for a 2mm screw\n",
|
||||||
"STATOR_HOLE_RADIUS = 5\n",
|
"STATOR_HOLE_RADIUS = 5.5\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# Track width and spacing\n",
|
"# Track width and spacing\n",
|
||||||
"TRACK_WIDTH = 0.127\n",
|
"TRACK_WIDTH = 0.127\n",
|
||||||
|
@ -73,11 +73,11 @@
|
||||||
"\n",
|
"\n",
|
||||||
"# Coil params\n",
|
"# Coil params\n",
|
||||||
"TURNS = 9\n",
|
"TURNS = 9\n",
|
||||||
"COIL_CENTER_RADIUS = 11.5\n",
|
"COIL_CENTER_RADIUS = 11.8\n",
|
||||||
"COIL_VIA_RADIUS = 12.5\n",
|
"COIL_VIA_RADIUS = 12.8\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# where to place the pins\n",
|
"# where to place the pins\n",
|
||||||
"CONNECTION_PINS_RADIUS = 16.5\n",
|
"# CONNECTION_PINS_RADIUS = 16.5\n",
|
||||||
"\n",
|
"\n",
|
||||||
"USE_SPIRAL = False"
|
"USE_SPIRAL = False"
|
||||||
]
|
]
|
||||||
|
@ -305,10 +305,10 @@
|
||||||
" )\n",
|
" )\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# raidus for connecting the bottoms of the coils together\n",
|
"# raidus for connecting the bottoms of the coils together\n",
|
||||||
"connection_radius1 = STATOR_HOLE_RADIUS + 0.5\n",
|
"connection_radius1 = STATOR_HOLE_RADIUS + 3 * TRACK_SPACING\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# create tracks to link the A coils around the center\n",
|
"# create tracks to link the A coils around the center\n",
|
||||||
"connection_via_radius_A = connection_radius1 + TRACK_SPACING + VIA_DIAM / 2\n",
|
"connection_via_radius_A = connection_radius1 + 3 * TRACK_SPACING + VIA_DIAM / 2\n",
|
||||||
"coil_A1_A2_inner = (\n",
|
"coil_A1_A2_inner = (\n",
|
||||||
" [get_arc_point(0, connection_via_radius_A)]\n",
|
" [get_arc_point(0, connection_via_radius_A)]\n",
|
||||||
" + draw_arc(0, 3 * 360 / 12, connection_radius1)\n",
|
" + draw_arc(0, 3 * 360 / 12, connection_radius1)\n",
|
||||||
|
@ -344,7 +344,7 @@
|
||||||
"coils_b[10].append(coil_B3_B4_inner[-1])\n",
|
"coils_b[10].append(coil_B3_B4_inner[-1])\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# create tracks to link the C coils around the center\n",
|
"# create tracks to link the C coils around the center\n",
|
||||||
"connection_via_radius_C = connection_via_radius_A + TRACK_SPACING + VIA_DIAM / 2\n",
|
"connection_via_radius_C = connection_via_radius_A + 3 * TRACK_SPACING + VIA_DIAM / 2\n",
|
||||||
"coil_C1_C2_inner = draw_arc(2 * 360 / 12, 5 * 360 / 12, connection_via_radius_C)\n",
|
"coil_C1_C2_inner = draw_arc(2 * 360 / 12, 5 * 360 / 12, connection_via_radius_C)\n",
|
||||||
"tracks_f.append(coil_C1_C2_inner)\n",
|
"tracks_f.append(coil_C1_C2_inner)\n",
|
||||||
"coil_C3_C4_inner = draw_arc(8 * 360 / 12, 11 * 360 / 12, connection_via_radius_C)\n",
|
"coil_C3_C4_inner = draw_arc(8 * 360 / 12, 11 * 360 / 12, connection_via_radius_C)\n",
|
||||||
|
@ -426,19 +426,20 @@
|
||||||
"pads.append(create_pad((INPUT_PAD_RADIUS, PAD_PITCH), PAD_WIDTH, PAD_HEIGHT, \"b\"))\n",
|
"pads.append(create_pad((INPUT_PAD_RADIUS, PAD_PITCH), PAD_WIDTH, PAD_HEIGHT, \"b\"))\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# connect coil A to the top pad\n",
|
"# connect coil A to the top pad\n",
|
||||||
"coils_f[0].append((INPUT_PAD_RADIUS, -PAD_PITCH))\n",
|
"pad_connection_point_x = INPUT_PAD_RADIUS + PAD_WIDTH / 2 - VIA_DIAM\n",
|
||||||
"vias.append(create_via(((INPUT_PAD_RADIUS, -PAD_PITCH))))\n",
|
"coils_f[0].append((pad_connection_point_x, -PAD_PITCH))\n",
|
||||||
|
"vias.append(create_via(((pad_connection_point_x, -PAD_PITCH))))\n",
|
||||||
"# connect coil B to the middle pad\n",
|
"# connect coil B to the middle pad\n",
|
||||||
"coils_f[1].append((INPUT_PAD_RADIUS, 0))\n",
|
"coils_f[1].append((pad_connection_point_x, 0))\n",
|
||||||
"vias.append(create_via(((INPUT_PAD_RADIUS, 0))))\n",
|
"vias.append(create_via(((pad_connection_point_x, 0))))\n",
|
||||||
"# connect coil C to the bottom pad\n",
|
"# connect coil C to the bottom pad\n",
|
||||||
"coils_f[2].append(\n",
|
"coils_f[2].append(\n",
|
||||||
" get_arc_point(\n",
|
" get_arc_point(\n",
|
||||||
" 2 * 360 / 12, SCREW_HOLE_RADIUS - (SCREW_HOLE_DRILL_DIAM / 2 + TRACK_SPACING)\n",
|
" 2 * 360 / 12, SCREW_HOLE_RADIUS - (SCREW_HOLE_DRILL_DIAM / 2 + TRACK_SPACING)\n",
|
||||||
" )\n",
|
" )\n",
|
||||||
")\n",
|
")\n",
|
||||||
"coils_f[2].append((INPUT_PAD_RADIUS, PAD_PITCH))\n",
|
"coils_f[2].append((pad_connection_point_x, PAD_PITCH))\n",
|
||||||
"vias.append(create_via(((INPUT_PAD_RADIUS, PAD_PITCH))))"
|
"vias.append(create_via(((pad_connection_point_x, PAD_PITCH))))"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,8 +59,8 @@
|
||||||
"# PCB Edge size\n",
|
"# PCB Edge size\n",
|
||||||
"STATOR_RADIUS = 23\n",
|
"STATOR_RADIUS = 23\n",
|
||||||
"SCREW_HOLE_RADIUS = 20\n",
|
"SCREW_HOLE_RADIUS = 20\n",
|
||||||
"SCREW_HOLE_DRILL_DIAM = 3.2 # 3.2mm drill for a 3mm screw\n",
|
"SCREW_HOLE_DRILL_DIAM = 2.3 # 2.3mm drill for a 2mm screw\n",
|
||||||
"STATOR_HOLE_RADIUS = 5\n",
|
"STATOR_HOLE_RADIUS = 5.5\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# where to put the input pads\n",
|
"# where to put the input pads\n",
|
||||||
"INPUT_PAD_RADIUS = 19.5\n",
|
"INPUT_PAD_RADIUS = 19.5\n",
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
"\n",
|
"\n",
|
||||||
"# Coil params\n",
|
"# Coil params\n",
|
||||||
"TURNS = 18\n",
|
"TURNS = 18\n",
|
||||||
"COIL_CENTER_RADIUS = 11.5\n",
|
"COIL_CENTER_RADIUS = 12.2\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# where do we want to stop routing any tracks?\n",
|
"# where do we want to stop routing any tracks?\n",
|
||||||
"MAX_TRACK_RADIUS = SCREW_HOLE_RADIUS - (SCREW_HOLE_DRILL_DIAM / 2 + TRACK_SPACING * 2)\n",
|
"MAX_TRACK_RADIUS = SCREW_HOLE_RADIUS - (SCREW_HOLE_DRILL_DIAM / 2 + TRACK_SPACING * 2)\n",
|
||||||
|
@ -378,7 +378,7 @@
|
||||||
"vias.append(create_via(get_arc_point(angle_C_opp, COIL_CENTER_RADIUS)))\n",
|
"vias.append(create_via(get_arc_point(angle_C_opp, COIL_CENTER_RADIUS)))\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# connect the front copper opposite coils together\n",
|
"# connect the front copper opposite coils together\n",
|
||||||
"common_connection_radius = MAX_TRACK_RADIUS - (VIA_DIAM / 2 + TRACK_SPACING)\n",
|
"common_connection_radius = MAX_TRACK_RADIUS\n",
|
||||||
"common_coil_connections_b = draw_arc(angle_A_opp, angle_C_opp, common_connection_radius)\n",
|
"common_coil_connections_b = draw_arc(angle_A_opp, angle_C_opp, common_connection_radius)\n",
|
||||||
"coil_A_opp_f.append(get_arc_point(angle_A_opp, common_connection_radius))\n",
|
"coil_A_opp_f.append(get_arc_point(angle_A_opp, common_connection_radius))\n",
|
||||||
"coil_B_opp_f.append(get_arc_point(angle_B_opp, common_connection_radius))\n",
|
"coil_B_opp_f.append(get_arc_point(angle_B_opp, common_connection_radius))\n",
|
||||||
|
@ -392,7 +392,7 @@
|
||||||
"\n",
|
"\n",
|
||||||
"# wires for connecting to opposite coils\n",
|
"# wires for connecting to opposite coils\n",
|
||||||
"connection_radius1 = STATOR_HOLE_RADIUS + (2 * TRACK_SPACING)\n",
|
"connection_radius1 = STATOR_HOLE_RADIUS + (2 * TRACK_SPACING)\n",
|
||||||
"connection_radius2 = connection_radius1 + (TRACK_SPACING + VIA_DIAM / 2)\n",
|
"connection_radius2 = connection_radius1 + (2 * TRACK_SPACING + VIA_DIAM / 2)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# draw a 45 degree line from each coil at connection radius 1\n",
|
"# draw a 45 degree line from each coil at connection radius 1\n",
|
||||||
"# then connect up to connection radius 2\n",
|
"# then connect up to connection radius 2\n",
|
||||||
|
@ -462,25 +462,29 @@
|
||||||
")\n",
|
")\n",
|
||||||
"pads.append(create_pad((PAD_PITCH, INPUT_PAD_RADIUS), PAD_HEIGHT, PAD_WIDTH, \"b\"))\n",
|
"pads.append(create_pad((PAD_PITCH, INPUT_PAD_RADIUS), PAD_HEIGHT, PAD_WIDTH, \"b\"))\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# connect coil A to the middle pad\n",
|
"# connect coil A to the top pad\n",
|
||||||
|
"pad_connection_point_y = INPUT_PAD_RADIUS + PAD_WIDTH / 2 - VIA_DIAM\n",
|
||||||
"input_pad_connection_radius = SCREW_HOLE_RADIUS + SCREW_HOLE_DRILL_DIAM / 2 + 0.5\n",
|
"input_pad_connection_radius = SCREW_HOLE_RADIUS + SCREW_HOLE_DRILL_DIAM / 2 + 0.5\n",
|
||||||
"tracks_f.append(\n",
|
"tracks_f.append(\n",
|
||||||
" draw_arc(angle_A, 80, input_pad_connection_radius, 5)\n",
|
" draw_arc(angle_A, 80, input_pad_connection_radius, 5)\n",
|
||||||
" + [(PAD_PITCH, INPUT_PAD_RADIUS + VIA_DIAM)]\n",
|
" + [(PAD_PITCH, pad_connection_point_y)]\n",
|
||||||
")\n",
|
")\n",
|
||||||
"# connect coil B to the middle pad\n",
|
"# connect coil B to the middle pad\n",
|
||||||
"tracks_f.append(draw_arc(90, angle_B, INPUT_PAD_RADIUS, 5))\n",
|
"tracks_f.append(\n",
|
||||||
|
" [(0, pad_connection_point_y)] + draw_arc(90, angle_B, INPUT_PAD_RADIUS, 5)\n",
|
||||||
|
")\n",
|
||||||
"# connect coil C to the bottom pad\n",
|
"# connect coil C to the bottom pad\n",
|
||||||
"tracks_f.append(\n",
|
"tracks_f.append(\n",
|
||||||
" [(-PAD_PITCH, INPUT_PAD_RADIUS + VIA_DIAM)]\n",
|
" [(-PAD_PITCH, pad_connection_point_y)]\n",
|
||||||
" + draw_arc(100, angle_C, input_pad_connection_radius, 5)\n",
|
" + draw_arc(100, angle_C, input_pad_connection_radius, 5)\n",
|
||||||
")\n",
|
")\n",
|
||||||
"coil_A_f.append(get_arc_point(angle_A, input_pad_connection_radius))\n",
|
"coil_A_f.append(get_arc_point(angle_A, input_pad_connection_radius))\n",
|
||||||
"coil_B_f.append(get_arc_point(angle_B, INPUT_PAD_RADIUS))\n",
|
"coil_B_f.append(get_arc_point(angle_B, INPUT_PAD_RADIUS))\n",
|
||||||
"coil_C_f.append(get_arc_point(angle_C, input_pad_connection_radius))\n",
|
"coil_C_f.append(get_arc_point(angle_C, input_pad_connection_radius))\n",
|
||||||
"vias.append(create_via((-PAD_PITCH, INPUT_PAD_RADIUS + VIA_DIAM)))\n",
|
"\n",
|
||||||
"vias.append(create_via((0, INPUT_PAD_RADIUS)))\n",
|
"vias.append(create_via((-PAD_PITCH, pad_connection_point_y)))\n",
|
||||||
"vias.append(create_via((PAD_PITCH, INPUT_PAD_RADIUS + VIA_DIAM)))"
|
"vias.append(create_via((0, pad_connection_point_y)))\n",
|
||||||
|
"vias.append(create_via((PAD_PITCH, pad_connection_point_y)))"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,12 +4,16 @@ import wx
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
|
||||||
|
CENTER_X = 150
|
||||||
|
CENTER_Y = 100
|
||||||
|
|
||||||
|
|
||||||
def create_tracks(board, group, net, layer, thickness, coords):
|
def create_tracks(board, group, net, layer, thickness, coords):
|
||||||
last_x = None
|
last_x = None
|
||||||
last_y = None
|
last_y = None
|
||||||
for coord in coords:
|
for coord in coords:
|
||||||
x = coord["x"]
|
x = coord["x"] + CENTER_X
|
||||||
y = coord["y"]
|
y = coord["y"] + CENTER_Y
|
||||||
track = pcbnew.PCB_TRACK(board)
|
track = pcbnew.PCB_TRACK(board)
|
||||||
if last_x is not None:
|
if last_x is not None:
|
||||||
track.SetStart(pcbnew.wxPointMM(float(last_x), float(last_y)))
|
track.SetStart(pcbnew.wxPointMM(float(last_x), float(last_y)))
|
||||||
|
@ -75,7 +79,7 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
||||||
for via in coil_data["vias"]:
|
for via in coil_data["vias"]:
|
||||||
pcb_via = pcbnew.PCB_VIA(board)
|
pcb_via = pcbnew.PCB_VIA(board)
|
||||||
pcb_via.SetPosition(
|
pcb_via.SetPosition(
|
||||||
pcbnew.wxPointMM(float(via["x"]), float(via["y"]))
|
pcbnew.wxPointMM(via["x"] + CENTER_X, via["y"] + CENTER_Y)
|
||||||
)
|
)
|
||||||
pcb_via.SetWidth(int(via_diameter * 1e6))
|
pcb_via.SetWidth(int(via_diameter * 1e6))
|
||||||
pcb_via.SetDrill(int(via_drill_diameter * 1e6))
|
pcb_via.SetDrill(int(via_drill_diameter * 1e6))
|
||||||
|
@ -85,8 +89,10 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
||||||
|
|
||||||
# create the pins
|
# create the pins
|
||||||
for pin in coil_data["pins"]:
|
for pin in coil_data["pins"]:
|
||||||
|
x = pin["x"] + CENTER_X
|
||||||
|
y = pin["y"] + CENTER_Y
|
||||||
module = pcbnew.FOOTPRINT(board)
|
module = pcbnew.FOOTPRINT(board)
|
||||||
module.SetPosition(pcbnew.wxPointMM(pin["x"], pin["y"]))
|
module.SetPosition(pcbnew.wxPointMM(x, y))
|
||||||
board.Add(module)
|
board.Add(module)
|
||||||
pcb_pad = pcbnew.PAD(module)
|
pcb_pad = pcbnew.PAD(module)
|
||||||
pcb_pad.SetSize(pcbnew.wxSizeMM(pin_diameter, pin_diameter))
|
pcb_pad.SetSize(pcbnew.wxSizeMM(pin_diameter, pin_diameter))
|
||||||
|
@ -94,7 +100,7 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
||||||
pcb_pad.SetAttribute(pcbnew.PAD_ATTRIB_PTH)
|
pcb_pad.SetAttribute(pcbnew.PAD_ATTRIB_PTH)
|
||||||
pcb_pad.SetLayerSet(pcb_pad.PTHMask())
|
pcb_pad.SetLayerSet(pcb_pad.PTHMask())
|
||||||
pcb_pad.SetDrillSize(pcbnew.wxSizeMM(pin_drill, pin_drill))
|
pcb_pad.SetDrillSize(pcbnew.wxSizeMM(pin_drill, pin_drill))
|
||||||
pcb_pad.SetPosition(pcbnew.wxPointMM(pin["x"], pin["y"]))
|
pcb_pad.SetPosition(pcbnew.wxPointMM(x, y))
|
||||||
pcb_pad.SetNetCode(net.GetNetCode())
|
pcb_pad.SetNetCode(net.GetNetCode())
|
||||||
module.Add(pcb_pad)
|
module.Add(pcb_pad)
|
||||||
|
|
||||||
|
@ -102,8 +108,10 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
||||||
lset = pcbnew.LSET()
|
lset = pcbnew.LSET()
|
||||||
lset.AddLayer(pcbnew.B_Cu)
|
lset.AddLayer(pcbnew.B_Cu)
|
||||||
for pin in coil_data["pads"]:
|
for pin in coil_data["pads"]:
|
||||||
|
x = pin["x"] + CENTER_X
|
||||||
|
y = pin["y"] + CENTER_Y
|
||||||
module = pcbnew.FOOTPRINT(board)
|
module = pcbnew.FOOTPRINT(board)
|
||||||
module.SetPosition(pcbnew.wxPointMM(pin["x"], pin["y"]))
|
module.SetPosition(pcbnew.wxPointMM(x, y))
|
||||||
board.Add(module)
|
board.Add(module)
|
||||||
pcb_pad = pcbnew.PAD(module)
|
pcb_pad = pcbnew.PAD(module)
|
||||||
pcb_pad.SetSize(pcbnew.wxSizeMM(pin["width"], pin["height"]))
|
pcb_pad.SetSize(pcbnew.wxSizeMM(pin["width"], pin["height"]))
|
||||||
|
@ -111,20 +119,20 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
||||||
pcb_pad.SetAttribute(pcbnew.PAD_ATTRIB_SMD)
|
pcb_pad.SetAttribute(pcbnew.PAD_ATTRIB_SMD)
|
||||||
pcb_pad.SetLayerSet(pcb_pad.SMDMask())
|
pcb_pad.SetLayerSet(pcb_pad.SMDMask())
|
||||||
# pcb_pad.SetLayerSet(lset)
|
# pcb_pad.SetLayerSet(lset)
|
||||||
pcb_pad.SetPosition(pcbnew.wxPointMM(pin["x"], pin["y"]))
|
pcb_pad.SetPosition(pcbnew.wxPointMM(x, y))
|
||||||
pcb_pad.SetNetCode(net.GetNetCode())
|
pcb_pad.SetNetCode(net.GetNetCode())
|
||||||
pcb_pad.Flip(pcbnew.wxPointMM(pin["x"], pin["y"]), False)
|
pcb_pad.Flip(pcbnew.wxPointMM(x, y), False)
|
||||||
module.Add(pcb_pad)
|
module.Add(pcb_pad)
|
||||||
|
|
||||||
# create any silk screen
|
# create any silk screen
|
||||||
for text in coil_data["silk"]:
|
for text in coil_data["silk"]:
|
||||||
|
x = text["x"] + CENTER_X
|
||||||
|
y = text["y"] + CENTER_Y
|
||||||
pcb_txt = pcbnew.PCB_TEXT(board)
|
pcb_txt = pcbnew.PCB_TEXT(board)
|
||||||
pcb_txt.SetText(text["text"])
|
pcb_txt.SetText(text["text"])
|
||||||
pcb_txt.SetPosition(pcbnew.wxPointMM(text["x"], text["y"]))
|
pcb_txt.SetPosition(pcbnew.wxPointMM(x, y))
|
||||||
pcb_txt.SetHorizJustify(pcbnew.GR_TEXT_HJUSTIFY_CENTER)
|
pcb_txt.SetHorizJustify(pcbnew.GR_TEXT_HJUSTIFY_CENTER)
|
||||||
pcb_txt.Rotate(
|
pcb_txt.Rotate(pcbnew.wxPointMM(x, y), text["angle"])
|
||||||
pcbnew.wxPointMM(text["x"], text["y"]), text["angle"]
|
|
||||||
)
|
|
||||||
pcb_txt.SetTextSize(
|
pcb_txt.SetTextSize(
|
||||||
pcbnew.wxSize(
|
pcbnew.wxSize(
|
||||||
text["size"] * pcbnew.IU_PER_MM,
|
text["size"] * pcbnew.IU_PER_MM,
|
||||||
|
@ -133,14 +141,16 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
||||||
)
|
)
|
||||||
pcb_txt.SetLayer(pcbnew.F_SilkS)
|
pcb_txt.SetLayer(pcbnew.F_SilkS)
|
||||||
if text["layer"] == "b":
|
if text["layer"] == "b":
|
||||||
pcb_txt.Flip(pcbnew.wxPointMM(text["x"], text["y"]), True)
|
pcb_txt.Flip(pcbnew.wxPointMM(x, y), True)
|
||||||
board.Add(pcb_txt)
|
board.Add(pcb_txt)
|
||||||
# pcb_group.AddItem(pcb_txt)
|
# pcb_group.AddItem(pcb_txt)
|
||||||
|
|
||||||
# create the mounting holes
|
# create the mounting holes
|
||||||
for hole in coil_data["mountingHoles"]:
|
for hole in coil_data["mountingHoles"]:
|
||||||
|
x = hole["x"] + CENTER_X
|
||||||
|
y = hole["y"] + CENTER_Y
|
||||||
module = pcbnew.FOOTPRINT(board)
|
module = pcbnew.FOOTPRINT(board)
|
||||||
module.SetPosition(pcbnew.wxPointMM(hole["x"], hole["y"]))
|
module.SetPosition(pcbnew.wxPointMM(x, y))
|
||||||
board.Add(module)
|
board.Add(module)
|
||||||
pcb_pad = pcbnew.PAD(module)
|
pcb_pad = pcbnew.PAD(module)
|
||||||
pcb_pad.SetSize(pcbnew.wxSizeMM(hole["diameter"], hole["diameter"]))
|
pcb_pad.SetSize(pcbnew.wxSizeMM(hole["diameter"], hole["diameter"]))
|
||||||
|
@ -150,7 +160,7 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
||||||
pcb_pad.SetDrillSize(
|
pcb_pad.SetDrillSize(
|
||||||
pcbnew.wxSizeMM(hole["diameter"], hole["diameter"])
|
pcbnew.wxSizeMM(hole["diameter"], hole["diameter"])
|
||||||
)
|
)
|
||||||
pcb_pad.SetPosition(pcbnew.wxPointMM(hole["x"], hole["y"]))
|
pcb_pad.SetPosition(pcbnew.wxPointMM(x, y))
|
||||||
module.Add(pcb_pad)
|
module.Add(pcb_pad)
|
||||||
# pcb_group.AddItem(pcb_hole)
|
# pcb_group.AddItem(pcb_hole)
|
||||||
|
|
||||||
|
@ -158,9 +168,9 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
||||||
arc = pcbnew.PCB_SHAPE(board)
|
arc = pcbnew.PCB_SHAPE(board)
|
||||||
arc.SetShape(pcbnew.SHAPE_T_CIRCLE)
|
arc.SetShape(pcbnew.SHAPE_T_CIRCLE)
|
||||||
arc.SetFilled(False)
|
arc.SetFilled(False)
|
||||||
arc.SetStart(pcbnew.wxPointMM(0, 0))
|
arc.SetStart(pcbnew.wxPointMM(CENTER_X, CENTER_Y))
|
||||||
arc.SetEnd(pcbnew.wxPointMM(stator_radius, 0))
|
arc.SetEnd(pcbnew.wxPointMM(CENTER_X + stator_radius, CENTER_Y))
|
||||||
arc.SetCenter(pcbnew.wxPointMM(0, 0))
|
arc.SetCenter(pcbnew.wxPointMM(CENTER_X, CENTER_Y))
|
||||||
arc.SetLayer(pcbnew.Edge_Cuts)
|
arc.SetLayer(pcbnew.Edge_Cuts)
|
||||||
arc.SetWidth(int(0.1 * pcbnew.IU_PER_MM))
|
arc.SetWidth(int(0.1 * pcbnew.IU_PER_MM))
|
||||||
board.Add(arc)
|
board.Add(arc)
|
||||||
|
@ -170,9 +180,9 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
||||||
arc = pcbnew.PCB_SHAPE(board)
|
arc = pcbnew.PCB_SHAPE(board)
|
||||||
arc.SetShape(pcbnew.SHAPE_T_CIRCLE)
|
arc.SetShape(pcbnew.SHAPE_T_CIRCLE)
|
||||||
arc.SetFilled(False)
|
arc.SetFilled(False)
|
||||||
arc.SetStart(pcbnew.wxPointMM(0, 0))
|
arc.SetStart(pcbnew.wxPointMM(CENTER_X, CENTER_Y))
|
||||||
arc.SetEnd(pcbnew.wxPointMM(stator_hole_radius, 0))
|
arc.SetEnd(pcbnew.wxPointMM(CENTER_X + stator_hole_radius, CENTER_Y))
|
||||||
arc.SetCenter(pcbnew.wxPointMM(0, 0))
|
arc.SetCenter(pcbnew.wxPointMM(CENTER_X, CENTER_Y))
|
||||||
arc.SetLayer(pcbnew.Edge_Cuts)
|
arc.SetLayer(pcbnew.Edge_Cuts)
|
||||||
arc.SetWidth(int(0.1 * pcbnew.IU_PER_MM))
|
arc.SetWidth(int(0.1 * pcbnew.IU_PER_MM))
|
||||||
board.Add(arc)
|
board.Add(arc)
|
||||||
|
|
Loading…
Reference in a new issue