yaqwsx / KiKit

Automation tools for KiCAD
https://yaqwsx.github.io/KiKit
MIT License
1.55k stars 201 forks source link

mousebites like OshPark, with holes touching sides. #730

Open bootchk opened 2 months ago

bootchk commented 2 months ago

Prerequisites

Description

The request is to generate a number of drills in a mousebite that will fit in a tab.

This might put a drill very near the side of a tab. But when you consider the round corners for milling on an inside corner, this still produces a good tab: with a high proportion of material drilled out of the mousebite.

Here is the Oshpark drawing of a mousebite.

OshparkMousebite

Note the tab is 2.5mm wide and holes are 0.5mm diameter, with 1mm spacing. So three holes fit in 2.5mm, if the holes touch the edge. (From their website, width actually given as 0.1 inch, 0.02 inch drill, 0.04 inch spacing.)

Here is one fascimile I could generate with KiKit. Here is KiKit tab width: 2.5mm, mousebite hole spacing: 1mm, mousebite prolong:0.5 . I assume the KiKit algorithm generates two drills because that is all that would fit

KiKitmousebite

Here is KiKit tab width: 2.5mm, mousebite hole spacing: 1mm, mousebite prolong:0.

KiKitMousebite2_5-1-0

It seems like the hole spacing is actually 1.25.

Note my boards are very small, say 5 mm wide.

This issue is low priority. Note that OshPark will generate mousebites for a panel made by KiKit. So one actually doesn't need to generate mousebites in KiKit to order from OshPark. But you optionally can, to ensure that the mousebites are where you want them.

I could be wrong. I tried other combinations, such as hole spacing 0.99 and 0.8, with no luck. I haven't looked at the KiKit Python code. Possibly its a floating point comparison issue.

Thanks, KiKit is great. I am a FOSS contributor to GIMP, especially plugin infrastructure. The KiKit and KiCad plugin architecture is very nice.

yaqwsx commented 2 months ago

The code for generating mouse bites is relatively short and, I hope, self-explanatory: https://github.com/yaqwsx/KiKit/blob/a8d1c051bd7ab15e3a4033cd72c912d3023ef2ba/kikit/panelize.py#L1531-L1557.

The idea is: