-
-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gerber: Always use multi-quadrant mode #504
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👍
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.
Yes of course.
I guess we can ignore cases where the two points are closer together than 0.01mm with a lage angle, right?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! 👍
87c8c63
to
cd44610
Compare
@ubruhin ok, rebased & squashed! |
cd44610
to
2b79c7d
Compare
2b79c7d
to
16a80e7
Compare
Gerber: Always use multi-quadrant mode (cherry picked from commit 9150f41)
@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?
Fixes #247.