Feature request: Improve teardrops
Description
First of all, I would like to state that I appreciate your hard work on the project. Please, don't perceive this as a complaint, rather than a suggestion to improve.
Today, I tested the teardrops support in 6.99. It does what it is probably supposed to do, but I am disappointed in the feature. From my point of view, it is only a reimplementation of the existing 3rd party plugin in the KiCAD's codebase and it offers no advantages over it other than the button being available to the users without any installation. As such I see it as a waste of your precious developer's time. However, I think the feature could be vastly improved with just a few changes I propose at the end of the feature request.
There are several problems I see with the current approach of just generating and deleting zones with magic names:
- There is no live update, which is not only inconvenient but also confusing for the user when they change tracks. It is much easier to understand the layout when there are live updates to the teardrops.
- It is extremely hard to fine-tune the teardrops or make local exceptions/adjustments.
- What I see as the biggest problem of all is that there is no automated way of finding if the teardrops are out-of-date. This is crucial for any automated processing of the manufacturing data and opens a new way of ordering defective boards.
- If I understand correctly, teardrops values are not saved and therefore, on board editor close, lost.
- I find it inconvenient that teardrops just use an arbitrary priority (when they should behave like trace) so users can by mistake create a zone that will override the teardrops (or worse, the same priority).
- I find it weird that the teardrops can be manually changed, however, any change in the parameters discards user changes without warning.
I would like to change this and I offer to implement an improvement in the behavior. However, before I start to do so, I would to know if you would be willing to accept a merge request with the improvements.
Implementation proposal
All problems could be solved if teardrops were the property of a track and they were first-class citizens with native implementation. That would, however, require changing all rendering functions, including exporting, DRC, and copper fill. This is where I understand why you chose to reuse zones for teardrops – it doesn't introduce new concepts and leverages most of the existing codebase.
What I propose:
- make teardrops parameters an attribute of all: board, net, and pad. These parameter override (i.e., if there are no attributes in a pad, net attributes will be used; if there are no net attributes, board attributes will be used and they are always present).
- allow a trace to contain zones:
- either by adding a special attribute,
- or turning trace into a
BOARD_CONTAINER
- place the corresponding zones inside the track container. Therefore, when we modify the track, we can easily adjust the zones that form the teardrop.
- since the teardrops are relatively small and simple zones, I think it could be even possible to refill them after trace editing ends. If not, we could just erase the current fill and show only the outline to the user.
- the zones inside a trace shouldn't be user selectable nor editable.
- [optional] Internally turn zone priority into a tuple
(KICAD_INTERNAL_PRIORITY, USER_PRIORTY)
where user-defined zones would haveKICAD_INTERNAL_PRIORITY
smaller than teardrops. No UI changes here, the user can only changeUSER_PRIORITY
.
The changes above allow for easy control of teardrop shape globally and locally, allow for live preview, and most importantly, prevent an inconsistent state (i.e., out-of-date teardrops).
Would such a change be welcomed? In my opinion, they are pretty straightforward, reuse the current implementation and greatly improve the usability of teardrops.
Steps to reproduce
This is a feature request, there are no steps to reproduce.
KiCad Version
Application: KiCad PCB Editor
Version: 6.99.0-unknown-45ab15dc95~148~ubuntu20.04.1, release build
Libraries:
wxWidgets 3.0.4
FreeType 2.10.1
HarfBuzz 2.6.4
FontConfig 2.13.1
libcurl/7.68.0 OpenSSL/1.1.1f 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.13.0-44-generic x86_64, 64 bit, Little endian, wxGTK, regolith, x11
Build Info:
Date: Jun 19 2022 17:19:37
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.71.0
OCC: 7.5.2
Curl: 7.68.0
ngspice: 36
Compiler: GCC 9.4.0 with C++ ABI 1013
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON