Fixed alignment issues of round elements (e.g. solder pads and holes) in exported Gerber files

This commit is contained in:
Bane Stojkovic
2025-03-08 22:20:14 +01:00
parent 53019ac600
commit 8f8c096dfb
8 changed files with 5233 additions and 4553 deletions
@@ -223,11 +223,12 @@ public class GerberG2DWrapper extends Graphics2D
if (Math.abs(c.getWidth() - c.getHeight()) < 0.1 && finalTx.getShearX() == 0
&& finalTx.getShearY() == 0
&& Math.abs(Math.abs(finalTx.getScaleX()) - Math.abs(finalTx.getScaleY())) < 0.0001) {
final double d = Math.abs(c.getWidth() * finalTx.getScaleX()) * SizeUnit.px.getFactor();
Circle circle = new Circle(d, entry.getValue().function, entry.getValue().negative);
dataLayer.addPad(circle, new Point(
(c.getX() * finalTx.getScaleX() + finalTx.getTranslateX()) * SizeUnit.px.getFactor()
- d / 2,
+ (entry.getKey().isMirrored() ? -1 : 1) * d / 2,
(c.getY() * finalTx.getScaleY() + finalTx.getTranslateY()) * SizeUnit.px.getFactor()
- d / 2));
} else {
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff