[PyGerber]: Some arcs cause render_with_shapely to fail
PyGerber Bug Report
Mandatory checks
Before opening this issue:
- [x] I have reviewed the README for guidelines and haven't found a solution there.
- [x] I have reviewed the PyGerber documentation and haven't found a solution there.
- [x] I have reviewed the existing open issues and verified that this is not a duplicate.
- [x] I have reviewed the existing closed issues and verified that this was already resolved or marked as won't fix.
- [x] I have reviewed the existing pull requests and verified that this is not a already known issue.
- [x] I have reviewed the existing discussions and verified that this is not a already known issue.
To Reproduce
Load the attached file arctest2-F_Adhesive.txt and call GerberFile.from_file(file path).render_with_shapely() (Wouldn't let me upload a .gbr, so i changed it to .txt)
Expected behavior
Render succeeds
Additional context
This seems to happen with any file generated by KiCad which contains a filled circle. Non-filled circles work fine. Disabling the offending assert (or changing it from > to >=) doesn't seem to break things but does fix the issue.
Environment:
- Operating system: [Windows 10]
- Python version: [3.11]
- PyGerber version: [latest dev]
Optional checks
- [ ] I want to contribute example source files attached to this issue in the test suite of PyGerber for regression testing purposes.
- [ ] I want to include separate LICENSE file for resource files attached as a result of an agreement described in first checkbox in this section.
- [ ] I want to include separate README file for resource files attached as a result of an agreement described in first checkbox in this section.
Thanks for reporting this issue.
I am not sure what KiCad is trying to achieve with 0 degree arc, but fine by me if it works without that assert. To bypass it for now you can ignore assertions by passing-O flag to Python interpreter, I will change that on main soon.