Giter Site home page Giter Site logo

kicad_scripts's Introduction

kicad_scripts

Some kicad scripts

Teardrops

This action plugin adds and deletes teardrops to a PCB.
See the README file in the teardrops directory to get details about it.

Kicad now includes native teardrop support (with great additions). I srongly recommend to use it.

Thus, I won't update this repo anymore. Feel free to fork if you need it.

This plugin now support Kicad V6 in the master branch. For V5/V5.99 Kicad version, please use the V5branch.

kicad_scripts's People

Contributors

bouni avatar cantudo avatar davidjrobertson avatar easyw avatar edi-systems avatar mitxela avatar nilujeperchut avatar ottojo avatar telec16 avatar weirdgyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kicad_scripts's Issues

Teardrops on vias work but not on pads

This is probably because I exported a diptrace pcb as an eagle board format so I could import it into kicad. I know that's a weird edge case, but I could try to provide a file that exhibits this behavior with only one part and one trace on it if that's helpful.

Kicad exception

Hi @NilujePerchut I am receiving the following exception when opening the PcbNew on Kicad.

Screenshot-20190506213025-723x294_action_script_kicad_issue

I've created a bug report for Kicad devs.

But it is possible that teardrop plugin is causing this exception because I have only one plugin.

I am using Kicad Version: 5.1.2-f72e74a~84~ubuntu19.04.1, release build

https://bugs.launchpad.net/kicad/+bug/1826493

Do you know what should I do to investigate this better?

Teardrops in zones (ground planes)

There is an issue with via with tracks on planes with copper pour.

Sample with copper pour and vias without teardrops: expected copper pour fill:
via_on_gnd_plane_without_teardrops

Sample with copper pour and vias with teardrops applied: prevents copper pour
via_on_gnd_plane_with_teardrop

Note: ground stitching has to be attached with tracks, not just vias otherwise it just create via "island" on the next zone refill.
Suggested solution: do not place teardrops if via are inside area/copper pour.

Application: Pcbnew
Version: 5.1.5-52549c586ubuntu19.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.64.0 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.6/openssl/zlib nghttp2/1.36.0 librtmp/2.3
Platform: Linux 5.0.0-38-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.67.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.64.0
Compiler: GCC 8.3.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

Teardrops suppressed by high priority zones

Currently the script doesn't seem to add a zone priority to the created teardrop zones. This causes the teardrops of tracks running through higher than zero priority zones to be suppressed.

Adding z.SetPriority(127) to line 86 of the script fixes the issue. Note that I picked a randomly high number (the highest signed int value), I haven't looked what the actual limit is.

Teardrops not added to all pads

Just installed this PI (0.6.0). Most pads did have teardrops added, but some didn't:

image

BTW can you explain what "Do not insert teardrops inside same net zones" means?

Thanks
D.

Type object 'BOARD' has no attribute 'GetModules' on KiCad 6

I want to install plugin wich worked on KiCad 5 version. Now I am trying it on KiCad 6 version and it is showing this error.
Link to plugin code

Does anyone know to what was comand "GetModules" changed and how to implement it into this code?
Code where error shows up:

def move_modules(components, board, xsize, ysize):
    for module in board.GetModules():
        old_pos = module.GetPosition()
        ref = module.GetReference()
        if ref in components:
            pos, sheet, idx = components[ref]
            new_pos = pcbnew.wxPoint(pos[0] * POS_SCALE, (pos[1] + idx * ysize) * POS_SCALE)
            module.SetPosition(new_pos)

Error:
image

Include SMD and single via mode don't do anything

Plugin version: V0.4.9 installed from github
OS: W10 64bit
KiCad Version Pcbnew
Version: (5.1.6)-1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.39.2
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.71.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.66.0
Compiler: GCC 9.2.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

Installed: ~\AppData\Roaming\kicad\scripting\plugins\teardrops

Behaviour 1:
Select a via or smd pad,
Open plugin using UI button,
Will add teardrops to everything, ignoring initial selection

Behaviour 2:
Open plugin using ui shortcut, nothing pre-selected
Check "include smd pads"
Select "ok"
Nothing happens

All the other options seem to work as expected. Unsure If I've installed wrong or an issue with my vesion od KiCad. I've seen the other issue for KiCad V5.99 but I'm pretty sure I am running the stable version.

v5.99: wxPython error

@NilujePerchut not sure if you want issues to be opened for v5.99 since I believe you are just focusing on v5.1 for now.
Screenshot from 2020-08-12 10-36-19
But I thought I would log this just in case.

I am getting a WxPython error for Teardrops v.0.4.9 when I click "OK". I can't seem to copy the text of the full error so I have made a screenshot.

KiCad version:

Application: Pcbnew

Version: (5.99.0-2643-g1bb6d4e22), debug build

Libraries:
	wxWidgets 3.0.4
	libcurl/7.68.0 GnuTLS/3.6.13 zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3

Platform: Linux 5.8.0 x86_64, 64 bit, Little endian, wxGTK

Build Info:
	Date: Aug 10 2020 00:05:57
	wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.71.0
	OCE: 6.9.1
	Curl: 7.68.0
	ngspice: 31
	Compiler: GCC 9.3.0 with C++ ABI 1013

Build settings:
	KICAD_SCRIPTING=ON
	KICAD_SCRIPTING_MODULES=ON
	KICAD_SCRIPTING_PYTHON3=OFF
	KICAD_SCRIPTING_WXPYTHON=ON
	KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
	KICAD_SCRIPTING_ACTION_MENU=ON
	BUILD_GITHUB_PLUGIN=ON
	KICAD_USE_OCE=ON
	KICAD_SPICE=ON
	KICAD_STDLIB_DEBUG=OFF
	KICAD_STDLIB_LIGHT_DEBUG=OFF
	KICAD_SANITIZE=OFF

Directory structure not clone friendly

Hi !
Is it possible to put the content of the teardrop directory at the root of the repository ? It makes it easier to just clone it into the KiCad plugin folder (or add it as a submodule). If you do that may want to rename your repo.
Having the files at the root enables easier update by a pull and easy installation.

I could make a pull request if you want.

Thanks for your work,
Antoine

Repo name

Hello, saw this repo is called generically kicad_scripts. There are also other generic repos with the same name.
What about renaming it to kicad-teardrops?

The renaming process is pretty easy and Github will continue referring the old name NilujePerchut/kicad_scripts to the new name NilujePerchut/kicad-teardrops, for instance.

What do you think?

KiCad Windows Locked after Closing Teardrops Window (macOS)

When I close the Teardrops window or when it automatically closes after adding the teardrops, all of my KiCad windows become locked and I need to force quit KiCad to close it. Has anyone else encountered this kind of issue?

I am using the latest stable version of Pcbnew with macOS Mojave Version 10.14.6:

Application: Pcbnew
Version: (5.1.6-0-10_14), release build
Libraries:
wxWidgets 3.0.4
libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: macOS Mojave Version 10.14.6 (Build 18G6020), 64 bit, Little endian, wxMac
Build Info:
wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
Boost: 1.72.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.54.0
Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
USE_WX_GRAPHICS_CONTEXT=ON
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

Thanks.

Bump to kicad 7 and implement some features from the fork

Hi! Sorry to bother you and thanks for such a great tool.

Native implementation of teardrops in kicad 7 leaves a lot to be desires and for round pads this plugin with "prevent eccentric teardrops from bulging outwards" unchecked produces the best results.

There's also a fork. A lot of the times it produces impressive results with rectangular pads, but all logic has been re-written and "prevent eccentric teardrops from bulging outwards" box does nothing. Also, sometimes it produces weird results where a teardrop is thinner than the track.

So, a near perfect plugin would apply current logic to round pads, logic from the fork to every other kind, fix some edge cases and it would run in kicad 7.0 which as I understand is harder to do than bumping from 5.0 to 6.0.

I understand that it hasn't been touched in quite some time, but I'd like to ask you to please continue development.

Teardrop on track

Hello,

Is it also possible to use teardrops on tracks?
For example in this situation:
image
It would be nice if the tracks are more fluid.
Thank you!

Teardrop issue in inner layers : Extra teardrops being added in inner layers

Hello There,
Thanks for making this wonderful plugin available for everyone. It helps a lot. I have observed one issue as described below.

When tracks are routed in inner layer which are beneath the SMD pads of Top/Bottom layers, The plugin generates teardrops in inner layer. Here are the screenshots and KiCAD project file attached.

tear_1

tear_2

teardrop_kicad_files.zip

KiCAD Version : Stable 5.1.5_3, Windows, 64bit
Plugin Version : 0.4.8

version

Segfault on Kicad 5 (nightly build)

Hi! I am trying to use your script with Kicad 5.

I installed it as you said but I just received a segfault starting the PCBNew. Running it with gdb I got this output:

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007fffcd20fbb7 in wxStatusBarBase::CalculateAbsWidths(int) const () from /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0

Do you know if it is something related with the teardrop script or just a random issue related to the plugin system? I am asking to deside if I can report it on launchpad for Kicad developers.

This is the version I am using if you would like to know.

Application: kicad
Version: 5.0.1-dev-unknown-1f19903~66~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-34-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Teardrops fail when three traces go to via

When I have three traces going to a via but the teardrops only not created for all of the traces. In the below image, only one of the front traces (going to the right) has a teardrop.
image
Here is another via with only one teardrop.
image
Note that the teardrops are visible in the gerber view.

Kicad version 5.1.4
wxWidgets 3.0.3

Teardrop zones not being filled

I am using the Teardrop Action plugin. Thanks for creating it! :)

I noticed that it creates the outline of the teardrop but does not fill the zone. I feel like this is related to some DRC functionality preventing it from filling to close to the via?

Any ideas would be appreciated!

I have put screenshots and the kicad files in this Google Drive link:
https://drive.google.com/open?id=1kE0ucjvTMrhH44pIXmg25o2AC69Ko7wu

Please let me know if issue with accessing it.

Thanks,
Drew

[bug] plugin keeps KiCad running in the background

I recently found this script and its really useful and works quite well but I found one issue:

If I execute the script as action plugin in KiCad and close KiCad afterwards it still keeps running as a background process and never closes on its own.

It does not use any resources in this time and you only notice it if you want to start KiCad again and get the warning "KiCad is already running".

It makes no difference if you actually do something in the plugin or just start it and close it right away, KiCad will continue to run in the background.

my Kicad version:

Application: KiCad
Version: 5.1.10-88a1d61d5888ubuntu18.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 5.4.0-81-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.5.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

Error

When I run the Teardrop Plugin on Kicad v5.1 (Windows 10) an error occurred:

Exception on python action plugin code


Traceback (most recent call last):

File "C:\Users\ePub\AppData\Roaming\kicad\scripting\plugins/teardrops/teardrop_plugin.py", line 22, in Run
InitTeardropDialog(GetBoard())

File "C:\Users\ePub\AppData\Roaming\kicad\scripting\plugins/teardrops/teardrop_dialog.py", line 55, in InitTeardropDialog
tg = TeardropDialog(board)

File "C:\Users\ePub\AppData\Roaming\kicad\scripting\plugins/teardrops/teardrop_dialog.py", line 18, in init
super(TeardropDialog, self).init(None)

File "C:\Users\ePub\AppData\Roaming\kicad\scripting\plugins/teardrops/teardrop_gui.py", line 22, in init
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )

File "C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw/wx/_core.py", line 9718, in SetSizeHints
return core.Window_SetSizeHints(*args, **kwargs)

TypeError: in method 'Window_SetSizeHints', expected argument 2 of type 'int'


OK

Script not working with kicad rev 2018-02-10 revision a04965c36

I try to use your teardrop script. Using the plugin (Tools-External Plugins), the "OK" button seems to do nothing.

So I started the script using the Python Shell:

td.SetTeardrops(30,70,10,None);
+Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files\KiCad\share\kicad\scripting\plugins/td.py", line 227, in SetTeardrops
    pcb.Add(__Zone(pcb, coor, track))
  File "C:\Program Files\KiCad\share\kicad\scripting\plugins/td.py", line 95, in __Zone
    z.BuildFilledSolidAreasPolygons(board)
  File "C:\Program Files\KiCad\lib\python2.7\site-packages/pcbnew.py", line 12661, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, ZONE_CONTAINER, name)
  File "C:\Program Files\KiCad\lib\python2.7\site-packages/pcbnew.py", line 80, in _swig_getattr
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'ZONE_CONTAINER' object has no attribute 'BuildFilledSolidAreasPolygons'

td.SetTeardrops()
+Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files\KiCad\share\kicad\scripting\plugins/td.py", line 227, in SetTeardrops
    pcb.Add(__Zone(pcb, coor, track))
  File "C:\Program Files\KiCad\share\kicad\scripting\plugins/td.py", line 95, in __Zone
    z.BuildFilledSolidAreasPolygons(board)
  File "C:\Program Files\KiCad\lib\python2.7\site-packages/pcbnew.py", line 12661, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, ZONE_CONTAINER, name)
  File "C:\Program Files\KiCad\lib\python2.7\site-packages/pcbnew.py", line 80, in _swig_getattr
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'ZONE_CONTAINER' object has no attribute 'BuildFilledSolidAreasPolygons'

Kicad version:
Application: kicad
Version: (2018-02-10 revision a04965c36)-makepkg, release build
Libraries:
wxWidgets 3.0.3
libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.60.0
Curl: 7.54.1
Compiler: GCC 7.1.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_SPICE=ON

Teardrop misaligned with SMD pad

This is a minor issue but I noticed that the teardrop does not seem to be aligned as good as possible with SMD pad in my flexible business card design.

Here is what the plugin creates:
https://drive.google.com/file/d/1lRFflo2ZKCVdB1BJzMa1ozuS1OzSonR4/view?usp=sharing

I tweaked the the teardrop zone by moving it to flow better into the SMD pad:
https://drive.google.com/file/d/1imy8g4_UDSdoS6f8n0J__WEpn0eMUByY/view?usp=sharing

Here are the default plugin settings that I am using:
https://drive.google.com/file/d/1nGocxgLwbLY6CU8cGp8Qq-fnyXvXXEJm/view?usp=sharing

Here are the Kicad files:
https://drive.google.com/open?id=1hz9ONDfelWEIUYXDV2plO-qj53FYXv-R

Thanks!

Licensing on your scripts?

Hello,
I want to use your teardrop script for a personal project, but you do not seem to have any licensing on your work from what I can see.
Could you please specify what kind of license this file has? Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.