mirror of
https://github.com/atomic14/kicad-coil-plugins.git
synced 2024-10-18 09:06:57 +00:00
Updated to fix DRC errors
Now changes the nets for each LED pad on LED ring
This commit is contained in:
parent
a622f96e6b
commit
533f50ec83
11 changed files with 55985 additions and 120949 deletions
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -162,3 +162,13 @@ cython_debug/
|
|||
*.json
|
||||
*.png
|
||||
*.vol
|
||||
|
||||
# KiCad
|
||||
*.kicad_mod
|
||||
*.kicad_wks
|
||||
*.kicad_dcm
|
||||
*.kicad_sym
|
||||
fp-info-cache
|
||||
ExamplePCB/*/*/*.zip
|
||||
knobby_8_layer_12_coils_60_leds_70x20_complete-backups
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"board": {
|
||||
"active_layer": 0,
|
||||
"active_layer_preset": "",
|
||||
"auto_track_width": true,
|
||||
"hidden_nets": [],
|
||||
"high_contrast_mode": 0,
|
||||
"net_color_mode": 1,
|
||||
"opacity": {
|
||||
"pads": 1.0,
|
||||
"tracks": 1.0,
|
||||
"vias": 1.0,
|
||||
"zones": 0.6
|
||||
},
|
||||
"ratsnest_display_mode": 0,
|
||||
"selection_filter": {
|
||||
"dimensions": true,
|
||||
"footprints": true,
|
||||
"graphics": true,
|
||||
"keepouts": true,
|
||||
"lockedItems": true,
|
||||
"otherItems": true,
|
||||
"pads": true,
|
||||
"text": true,
|
||||
"tracks": true,
|
||||
"vias": true,
|
||||
"zones": true
|
||||
},
|
||||
"visible_items": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
36
|
||||
],
|
||||
"visible_layers": "fffffff_ffffffff",
|
||||
"zone_display_mode": 0
|
||||
},
|
||||
"meta": {
|
||||
"filename": "knobby_8_layer_12_coils_60_leds_70x20_complete.kicad_prl",
|
||||
"version": 3
|
||||
},
|
||||
"project": {
|
||||
"files": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1,189 @@
|
|||
{
|
||||
"board": {
|
||||
"design_settings": {
|
||||
"defaults": {
|
||||
"board_outline_line_width": 0.09999999999999999,
|
||||
"copper_line_width": 0.19999999999999998,
|
||||
"copper_text_italic": false,
|
||||
"copper_text_size_h": 1.5,
|
||||
"copper_text_size_v": 1.5,
|
||||
"copper_text_thickness": 0.3,
|
||||
"copper_text_upright": false,
|
||||
"courtyard_line_width": 0.049999999999999996,
|
||||
"dimension_precision": 4,
|
||||
"dimension_units": 3,
|
||||
"dimensions": {
|
||||
"arrow_length": 1270000,
|
||||
"extension_offset": 500000,
|
||||
"keep_text_aligned": true,
|
||||
"suppress_zeroes": false,
|
||||
"text_position": 0,
|
||||
"units_format": 1
|
||||
},
|
||||
"fab_line_width": 0.09999999999999999,
|
||||
"fab_text_italic": false,
|
||||
"fab_text_size_h": 1.0,
|
||||
"fab_text_size_v": 1.0,
|
||||
"fab_text_thickness": 0.15,
|
||||
"fab_text_upright": false,
|
||||
"other_line_width": 0.15,
|
||||
"other_text_italic": false,
|
||||
"other_text_size_h": 1.0,
|
||||
"other_text_size_v": 1.0,
|
||||
"other_text_thickness": 0.15,
|
||||
"other_text_upright": false,
|
||||
"pads": {
|
||||
"drill": 0.0,
|
||||
"height": 0.7,
|
||||
"width": 0.7
|
||||
},
|
||||
"silk_line_width": 0.15,
|
||||
"silk_text_italic": false,
|
||||
"silk_text_size_h": 1.0,
|
||||
"silk_text_size_v": 1.0,
|
||||
"silk_text_thickness": 0.15,
|
||||
"silk_text_upright": false,
|
||||
"zones": {
|
||||
"45_degree_only": false,
|
||||
"min_clearance": 0.508
|
||||
}
|
||||
},
|
||||
"diff_pair_dimensions": [
|
||||
{
|
||||
"gap": 0.0,
|
||||
"via_gap": 0.0,
|
||||
"width": 0.0
|
||||
}
|
||||
],
|
||||
"drc_exclusions": [],
|
||||
"meta": {
|
||||
"version": 2
|
||||
},
|
||||
"rule_severities": {
|
||||
"annular_width": "error",
|
||||
"clearance": "error",
|
||||
"copper_edge_clearance": "error",
|
||||
"courtyards_overlap": "error",
|
||||
"diff_pair_gap_out_of_range": "error",
|
||||
"diff_pair_uncoupled_length_too_long": "error",
|
||||
"drill_out_of_range": "error",
|
||||
"duplicate_footprints": "warning",
|
||||
"extra_footprint": "warning",
|
||||
"footprint_type_mismatch": "error",
|
||||
"hole_clearance": "error",
|
||||
"hole_near_hole": "error",
|
||||
"invalid_outline": "error",
|
||||
"item_on_disabled_layer": "error",
|
||||
"items_not_allowed": "error",
|
||||
"length_out_of_range": "error",
|
||||
"malformed_courtyard": "error",
|
||||
"microvia_drill_out_of_range": "error",
|
||||
"missing_courtyard": "ignore",
|
||||
"missing_footprint": "warning",
|
||||
"net_conflict": "warning",
|
||||
"npth_inside_courtyard": "ignore",
|
||||
"padstack": "error",
|
||||
"pth_inside_courtyard": "ignore",
|
||||
"shorting_items": "error",
|
||||
"silk_over_copper": "warning",
|
||||
"silk_overlap": "warning",
|
||||
"skew_out_of_range": "error",
|
||||
"through_hole_pad_without_hole": "error",
|
||||
"too_many_vias": "error",
|
||||
"track_dangling": "warning",
|
||||
"track_width": "error",
|
||||
"tracks_crossing": "error",
|
||||
"unconnected_items": "error",
|
||||
"unresolved_variable": "error",
|
||||
"via_dangling": "warning",
|
||||
"zone_has_empty_net": "error",
|
||||
"zones_intersect": "error"
|
||||
},
|
||||
"rules": {
|
||||
"allow_blind_buried_vias": false,
|
||||
"allow_microvias": false,
|
||||
"max_error": 0.005,
|
||||
"min_clearance": 0.0,
|
||||
"min_copper_edge_clearance": 0.0,
|
||||
"min_hole_clearance": 0.25,
|
||||
"min_hole_to_hole": 0.25,
|
||||
"min_microvia_diameter": 0.19999999999999998,
|
||||
"min_microvia_drill": 0.09999999999999999,
|
||||
"min_silk_clearance": 0.0,
|
||||
"min_through_hole_diameter": 0.3,
|
||||
"min_track_width": 0.127,
|
||||
"min_via_annular_width": 0.049999999999999996,
|
||||
"min_via_diameter": 0.39999999999999997,
|
||||
"solder_mask_clearance": 0.0,
|
||||
"solder_mask_min_width": 0.0,
|
||||
"use_height_for_length_calcs": true
|
||||
},
|
||||
"track_widths": [
|
||||
0.0
|
||||
],
|
||||
"via_dimensions": [
|
||||
{
|
||||
"diameter": 0.0,
|
||||
"drill": 0.0
|
||||
}
|
||||
],
|
||||
"zones_allow_external_fillets": false,
|
||||
"zones_use_no_outline": true
|
||||
},
|
||||
"layer_presets": []
|
||||
},
|
||||
"boards": [],
|
||||
"cvpcb": {
|
||||
"equivalence_files": []
|
||||
},
|
||||
"libraries": {
|
||||
"pinned_footprint_libs": [],
|
||||
"pinned_symbol_libs": []
|
||||
},
|
||||
"meta": {
|
||||
"filename": "knobby_8_layer_12_coils_60_leds_70x20_complete.kicad_pro",
|
||||
"version": 1
|
||||
},
|
||||
"net_settings": {
|
||||
"classes": [
|
||||
{
|
||||
"bus_width": 12.0,
|
||||
"clearance": 0.2,
|
||||
"diff_pair_gap": 0.25,
|
||||
"diff_pair_via_gap": 0.25,
|
||||
"diff_pair_width": 0.2,
|
||||
"line_style": 0,
|
||||
"microvia_diameter": 0.3,
|
||||
"microvia_drill": 0.1,
|
||||
"name": "Default",
|
||||
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.25,
|
||||
"via_diameter": 0.8,
|
||||
"via_drill": 0.4,
|
||||
"wire_width": 6.0
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"version": 2
|
||||
},
|
||||
"net_colors": null
|
||||
},
|
||||
"pcbnew": {
|
||||
"last_paths": {
|
||||
"gencad": "",
|
||||
"idf": "",
|
||||
"netlist": "",
|
||||
"specctra_dsn": "",
|
||||
"step": "",
|
||||
"vrml": ""
|
||||
},
|
||||
"page_layout_descr_file": ""
|
||||
},
|
||||
"schematic": {
|
||||
"legacy_lib_dir": "",
|
||||
"legacy_lib_list": []
|
||||
},
|
||||
"sheets": [],
|
||||
"text_variables": {}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
(kicad_sch (version 20211123) (generator eeschema)
|
||||
(paper "A4")
|
||||
(lib_symbols)
|
||||
(symbol_instances)
|
||||
)
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -2,7 +2,7 @@
|
|||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": 141,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -43,7 +43,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": 142,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -80,7 +80,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": 143,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -105,7 +105,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": 144,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -132,7 +132,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": 145,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -149,14 +149,19 @@
|
|||
"LED_VPLUS_NET_NAME = \"V+\"\n",
|
||||
"LED_GND_NET_NAME = \"GND\"\n",
|
||||
"LED_IO_NET_NAME_BASE = \"LED_IO_\"\n",
|
||||
"LED_IO_NET_NC = \"\"\n",
|
||||
"LED_IO_NET_INPUT = \"LED_RING_INPUT\"\n",
|
||||
"LED_POWER_TRACK_WIDTH = 1.5\n",
|
||||
"LED_POWER_INTERCONN_TRACK_WIDTH = 0.5\n",
|
||||
"LED_INTERCONN_TO_SUPPRESS = 58"
|
||||
"LED_INTERCONN_TO_SUPPRESS = 58\n",
|
||||
"LED_REF_BASE = \"LED\"\n",
|
||||
"LED_RING_START_LED_REF = 38\n",
|
||||
"LED_RING_END_LED_REF = 39"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"execution_count": 146,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
@ -193,7 +198,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": 147,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -211,7 +216,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": 148,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
@ -220,7 +225,7 @@
|
|||
"(-3.77, 2.17, -1.595, 1.595)"
|
||||
]
|
||||
},
|
||||
"execution_count": 8,
|
||||
"execution_count": 148,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
},
|
||||
|
@ -244,7 +249,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": 149,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -314,7 +319,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"execution_count": 150,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -336,7 +341,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": 151,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
@ -381,7 +386,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": 152,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
@ -417,7 +422,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"execution_count": 153,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -458,7 +463,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"execution_count": 154,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -502,7 +507,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": 155,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
@ -533,7 +538,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"execution_count": 156,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
@ -552,7 +557,7 @@
|
|||
"pins = []\n",
|
||||
"mounting_holes = []\n",
|
||||
"silk = []\n",
|
||||
"\n",
|
||||
"components = []\n",
|
||||
"\n",
|
||||
"# shift the coils around to make connections a bit easier\n",
|
||||
"COIL_ROTATION = -360 / 12\n",
|
||||
|
@ -740,7 +745,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"execution_count": 157,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -767,7 +772,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"execution_count": 158,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -827,6 +832,32 @@
|
|||
" get_arc_point(next_angle - LED_PAD_ANGLE_OFFSET, LED_RING_RADIUS - LED_CHIP_PAD_RADIAL_FROM_CENTRE)\n",
|
||||
" ]\n",
|
||||
" })\n",
|
||||
"\n",
|
||||
" # LED chip components\n",
|
||||
" components.append(\n",
|
||||
" {\n",
|
||||
" \"ref\":LED_REF_BASE+str(i+1),\n",
|
||||
" \"pads\": [\n",
|
||||
" {\n",
|
||||
" \"num\": 1,\n",
|
||||
" \"net\": LED_IO_NET_NC if i+1 == LED_RING_END_LED_REF else LED_IO_NET_NAME_BASE+str(i+1),\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"num\": 2,\n",
|
||||
" \"net\":LED_GND_NET_NAME,\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"num\": 3,\n",
|
||||
" \"net\":LED_IO_NET_INPUT if i+1 == LED_RING_START_LED_REF else LED_IO_NET_NAME_BASE+str((i+1) % LED_RING_NUM_LEDS + 1),\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"num\": 4,\n",
|
||||
" \"net\":LED_VPLUS_NET_NAME,\n",
|
||||
" },\n",
|
||||
" ]\n",
|
||||
" }\n",
|
||||
" )\n",
|
||||
" \n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
|
@ -840,7 +871,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 19,
|
||||
"execution_count": 159,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -915,12 +946,13 @@
|
|||
" tracks_b=tracks_b,\n",
|
||||
" mounting_holes=mounting_holes,\n",
|
||||
" edge_cuts=edge_cuts,\n",
|
||||
" components=components,\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"execution_count": 160,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
|
|
@ -219,11 +219,38 @@ class CoilPlugin(pcbnew.ActionPlugin):
|
|||
ec.SetPolyPoints(v)
|
||||
board.Add(ec)
|
||||
|
||||
# Add components
|
||||
# coil_data["components"] = [
|
||||
# {
|
||||
# "ref": "LED1",
|
||||
# "pads": [
|
||||
# {"num": "1", "net": "LED_IO_36"},
|
||||
# {"num": "2", "net": "GND"},
|
||||
# {"num": "3", "net": "LED_IO_35"},
|
||||
# {"num": "4", "net": "V+"},
|
||||
# ],
|
||||
# }
|
||||
# ]
|
||||
for i, component in enumerate(coil_data["components"]):
|
||||
component_ref = component["ref"]
|
||||
module = board.FindFootprintByReference(component_ref)
|
||||
for pad in component["pads"]:
|
||||
pad_num = str(pad["num"])
|
||||
pcb_pad = module.FindPadByNumber(pad_num)
|
||||
net = self.findNet(board, pad)
|
||||
# wx.MessageBox("ref: " + component_ref + " Pad: " + pad_num + " Net: " + pad["net"] + " NetCode: " + str(net.GetNetCode()))
|
||||
if net is not None:
|
||||
pcb_pad.SetNetCode(net.GetNetCode())
|
||||
module.Add(pcb_pad)
|
||||
pcb_group.AddItem(pcb_pad)
|
||||
|
||||
def findNet(self, board, element):
|
||||
# find the matching net for the track
|
||||
net_name = "coils"
|
||||
net_name = ""
|
||||
if "net" in element:
|
||||
net_name = element["net"]
|
||||
if net_name == "":
|
||||
return None
|
||||
net = board.FindNet(net_name)
|
||||
if net is None:
|
||||
net = pcbnew.NETINFO_ITEM(board, net_name)
|
||||
|
|
|
@ -73,7 +73,8 @@ def dump_json(
|
|||
tracks_in,
|
||||
tracks_b,
|
||||
mounting_holes,
|
||||
edge_cuts
|
||||
edge_cuts,
|
||||
components
|
||||
):
|
||||
tracks_inner = [[
|
||||
{
|
||||
|
@ -117,6 +118,7 @@ def dump_json(
|
|||
"tracks": tracks,
|
||||
"mountingHoles": mounting_holes,
|
||||
"edgeCuts": [create_track_json(points) for points in edge_cuts],
|
||||
"components": components,
|
||||
}
|
||||
json.dump(json_result, open(filename, "w"))
|
||||
return json_result
|
||||
|
|
Loading…
Reference in a new issue