Closed cpresser closed 5 years ago
Hi @cpresser
I for the fun of it fiddled around with your PR here. Your solution seems to be working well with square courtyards: Take for instance: DFN-10-1EP_2x3mm_P0.5mm_EP0.64x2.4mm With a corresponding check_kicad_mod.py output: When we open the courtyard:
But, if we give it a round courtyard: The check_kicad_mod output becomes:
If arcs with a 360 degree turn-around is used, the corresponding output is still "Courtyard should be closed".
An additional feature could maybe be, if it returns the coordinates at/around which the error is generated?
Hi @JacobEFO
If arcs with a 360 degree turn-around is used, the corresponding output is still "Courtyard should be closed".
The previous commit should fix that. For arc, the start-point was not extracted correctly. Now it does calculate the actual start point. I have tested it with:
An additional feature could maybe be, if it returns the coordinates at/around which the error is generated?
Actually, that's already implemented. Use "-vv" to show the extraErrors. They contain the line/arc that failed the check
Hi @cpresser
Btw I am not a librarian, I just randomly checked out your implementation and found the error.
Seems like you did test it thoroughly though.
Ah, apparently -v does not catch all the errors. Lol. Good call.
For testcases regarding courtyards with arc sections look in the battary holder library.
Something to keep in mind for arcs: The kicad file format is a bit limited. It is nearly impossible to create precisely closed outlines when arcs get involved (unless you have them only with n*90 degrees) This is the reason why kicad allows for some tolerance to count an outline as closed (I think the tolerance is 0.01mm.) Meaning we might want to have this tolerance allowance also for this check. (But i would only allow it for arcs.)
Hi @poeschlr Thanks for the hint. I made a new commit that explicitly has the 0.01mm tolerance for arcs. The value of 0.01 seems to be okay, since that's the grid requirement. However, I could not find it in KLC directly.
Indeed, the footprint "BatteryHolder_Keystone_103_1x20mm" will fail this check. It has some points that are about 0.12mm apart. Most likely its the same for similar parts. Currently I don't see a way to make those footprints pass this new test.
IMHO, it is possible to make them fit with that 0.01mm tolerance or less. With a calculator, pen and paper. But the editor is indeed limited.
For 90° or 45° arcs I did some tests. Also for arc-line and arc/arc combos that are not exactly on the same endpoint.
0.05mm Distance Example
Force push, I did test with 0.1mm and left that value in. Fixed with the force push.
0.1mm is a bit large if kicad uses 0.01 ;)
it is set to 0.01mm with the last commit. See line 121 in the changed file. The comment was not that clear, sorry.
@cpresser @poeschlr Any remarks on this? from my testing it seems to work fine
right now I consider this done. I am not aware of any issues.
Fixed the wording and also found another typo.
Thanks. Lets see how this goes down if we let it loose to the wild. (I suspect we will find issues as this is a quite complex addition but i assume it to work for the most part.)
Related #277