devbisme / KiPart

Python package for generating multi-unit schematic symbols for KiCad from a CSV file.
MIT License
170 stars 46 forks source link

Scale pin length with pin number length #71

Closed dnschneid closed 1 year ago

dnschneid commented 1 year ago

The currently-hardcoded length is only readable for pins with 4-character numbers and no encroaching styles (such as the invert bubble), 3-character numbers with plain styles but minimal padding, or 2-character pin numbers with a nice amount of padding.

This patch makes the pin length dynamic. Feel free to tune the constants, but as it's written right now, it guarantees legibility but no whitespace (PIN_LENGTH_BASE could be set to 100 to force more whitespace). It should behave the same as kipart does today in the cases listed above.

Note that I've only tested the output by importing it into KiCad 6; not sure if the rendering is any different with KiCad 5 such that this is overly-conservative.

devbisme commented 1 year ago

Released in KiPart version 1.4.0 on PyPi. Thanks!