Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Gerber: Always use multi-quadrant mode #504
@ubruhin here's a first attempt at fixing this issue.
The spec says:
Right now I'm replacing arcs shorter than 0.01mm (point-to-point) with straight lines.
We probably need to handle some special cases, right? A full circle has start==end with angle=360, right? We should probably still draw arcs if start and end are identical.
I guess we can ignore cases where the two points are closer together than 0.01mm with a lage angle, right?
ubruhin left a comment •
Yes of course.
Hmm I'm not sure about that. It seems to be quite difficult to find good criteria when to replace arcs by straight lines :( I just took a quick look at KiCad and I couldn't find code which avoids the numerical instability, it looks like they simply always use multiquadrant mode without handling special cases.
Maybe it would indeed be reasonable to simply ignore the numerical instability. The risk of doing something wrong when handling special cases might be higher than the risk of really getting wrong arcs in the Gerber output (with a resolution of 1nm it's extremely unlikely to ever draw some arcs in LibrePCB which really lead to issues due to numerical instability). Or what do you think @dbrgn?
I agree and removed the special case handling. We're already using FSLAX66 format.
Other issues should be handled now.