Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MitjaNemec committed Mar 21, 2018
1 parent 40125d5 commit 4418d1d
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 12 deletions.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ Basic requirement for replication is that the section for replication is complet
![Top sheet schematics](https://raw.githubusercontent.com/MitjaNemec/Kicad_action_plugins/master/screenshots/Replicate_layout_0.png)
![Hierarchical sheet to replicate](https://raw.githubusercontent.com/MitjaNemec/Kicad_action_plugins/master/screenshots/Replicate_layout_1.png)

Once the section for replication (pivot section) has been laid out (modules, tracks and zones placed) you need to select anyone of the modules within this section and run the plugin.
Once the section for replication (pivot section) has been laid out (modules, tracks and zones placed) you need to:
1. select anyone of the modules within the pivot section
2. run the plugin
3. choose between linear and circular replication
4. Enter replication step size (x,y in linear replication and radius, angle (in degrees) for circular replication
5. select wheather you want to replicate also tracks and/or zones
6. select wheather you want to replicate tracks/zones which are intersectin the pivot bounding box
7. select wheather you want to delete already layed out tracks/zones (this is useful when updating already replicated layout)
8. hit OK

The replication can be linear or circular. For linear replication the plugin will ask for x and y offset (in mm) with respect to pivot section where replicated sections will be placed. For circular replication the plugin will ask for radius (in mm) and angle (in °) with respect to pivot section where replicated sections will be placed.

Expand Down Expand Up @@ -51,7 +59,32 @@ Within the plugin folder only *.py files are required for operation.

This plugin deletes selected items. Items can be: zones and/or tracks and/or modules. The main intention is to delete selected tracks to redo part of the layout.

To run the plugin:
1. select items you want to delete (note that in kicad it is different if you start your selection box from left or right)
2. run the plugin
3. select what you want to delete
4. hit OK

![Delete selected tracks and zones](https://raw.githubusercontent.com/MitjaNemec/Kicad_action_plugins/master/screenshots/Delete_selected_anim.gif)

## pad2pad track distance

This plugin has been tested on Windows 7 Kicad nightly 2018-03-03 revision aeae32b1a.

This plugin has been developed as a complex plugin according the [Python Plugin Development for Pcbnew](https://github.com/KiCad/kicad-source-mirror/blob/master/Documentation/development/pcbnew-plugins.md).

Within the plugin folder only *.py files are required for operation.

This plugin calculates shortest distance between two pads. The result is not always correct as the algorithm folows the track layout. Also the Via distance is not accounted for.

For complex tracks (GND, Supply rails) the calculation can take quite some time.

![Track layout which confuses the algorithm](https://raw.githubusercontent.com/MitjaNemec/Kicad_action_plugins/master/screenshots/Distance_example.gif)

To run the plugin:
1. select two pads to measure the distance between
2. run the plugin
3. select what you want to delete
4. hit OK

![Measure pad to pad distance](https://raw.githubusercontent.com/MitjaNemec/Kicad_action_plugins/master/screenshots/pad2pad_animation.gif)
2 changes: 1 addition & 1 deletion delete_selected/action_delete_selected.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def Run(self):
for mod in selected_modules:
board.RemoveNative(mod)

# if more or less than one show only a messagebox
# if nothing is selected a messagebox
else:
caption = 'Delete selected'
message = "Nothing is selected !"
Expand Down
4 changes: 2 additions & 2 deletions pad2pad_track_distance/En_mostic_test.kicad_pcb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(kicad_pcb (version 20171130) (host pcbnew "(5.0.0-rc2-dev-62-gaeae32b1a)")
(kicad_pcb (version 20171130) (host pcbnew "(5.0.0-rc2-dev-206-ge4d512a29)")

(general
(thickness 1.6)
Expand Down Expand Up @@ -42,7 +42,7 @@
)

(setup
(last_trace_width 0.5)
(last_trace_width 0.25)
(user_trace_width 0.2)
(user_trace_width 0.25)
(user_trace_width 0.4)
Expand Down
43 changes: 35 additions & 8 deletions pad2pad_track_distance/action_pad2pad_track_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class Pad2PadTrackDistance(pcbnew.ActionPlugin):
"""

def defaults(self):
self.name = "Delete selected"
self.category = "Modify Drawing PCB"
self.description = "Delete selected elements"
self.name = "Pad2Pad distance"
self.category = "Measure distance"
self.description = "Measure distance between two selected pads"

def Run(self):
_pcbnew_frame = \
Expand Down Expand Up @@ -81,16 +81,43 @@ def Run(self):
# deselect pads
selected_pads[0].ClearSelected()
selected_pads[1].ClearSelected()
# select tracks
for track in measure_distance.track_list[1:-1]:
track.SetSelected()

# deselect all tracks except used ones
all_tracks = board.GetTracks()

for track in all_tracks:
if track not in measure_distance.track_list:
track.ClearSelected()
else:
track.SetSelected()
track.SetBrightened()
track.SetHighlighted()

pad1_pos = selected_pads[0].GetPosition()
pad2_pos = selected_pads[1].GetPosition()
if pad1_pos[0] > pad2_pos[0]:
x = pad2_pos[0]
width = pad1_pos[0] - pad2_pos[0]
else:
x = pad1_pos[0]
width = pad2_pos[0] - pad1_pos[0]

if pad1_pos[1] > pad2_pos[1]:
y = pad2_pos[1]
height = pad1_pos[1] - pad2_pos[1]
else:
y = pad1_pos[1]
height = pad2_pos[1] - pad1_pos[1]

pcbnew.WindowZoom(x, y, width, height)

# pcbnew.Refresh()

caption = 'Pad2Pad Track Distance'
message = "Distance between pads is " + str(distance) + " mm"
dlg = wx.MessageDialog(_pcbnew_frame, message, caption, wx.OK | wx.ICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()

dlg.Destroy()
else:
caption = 'Pad2Pad Track Distance'
message = "The selected pads are not on the same net"
Expand Down
Binary file added pad2pad_track_distance/easy1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pad2pad_track_distance/easy2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pad2pad_track_distance/hard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pad2pad_track_distance/medium1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pad2pad_track_distance/medium2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pad2pad_track_distance/trivial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/Distance_example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/pad2pad_animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4418d1d

Please sign in to comment.