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 if (Math.abs(c.getWidth() - c.getHeight()) < 0.1 && finalTx.getShearX() == 0
&& finalTx.getShearY() == 0 && finalTx.getShearY() == 0
&& Math.abs(Math.abs(finalTx.getScaleX()) - Math.abs(finalTx.getScaleY())) < 0.0001) { && Math.abs(Math.abs(finalTx.getScaleX()) - Math.abs(finalTx.getScaleY())) < 0.0001) {
final double d = Math.abs(c.getWidth() * finalTx.getScaleX()) * SizeUnit.px.getFactor(); final double d = Math.abs(c.getWidth() * finalTx.getScaleX()) * SizeUnit.px.getFactor();
Circle circle = new Circle(d, entry.getValue().function, entry.getValue().negative); Circle circle = new Circle(d, entry.getValue().function, entry.getValue().negative);
dataLayer.addPad(circle, new Point( dataLayer.addPad(circle, new Point(
(c.getX() * finalTx.getScaleX() + finalTx.getTranslateX()) * SizeUnit.px.getFactor() (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() (c.getY() * finalTx.getScaleY() + finalTx.getTranslateY()) * SizeUnit.px.getFactor()
- d / 2)); - d / 2));
} else { } else {
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
+2 -1
View File
@@ -13,8 +13,9 @@
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/> <booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/> <booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/> <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="diylc-swing"/> <stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="diylc-swing"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="diylc-swing"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="diylc-swing"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m -Xmx4096m -javaagent:lib/jar-loader.jar -Dorg.diylc.storeDict=true -Dorg.diylc.enableTests=true -Dorg.diylc.scriptRun=true -Ddorg.diylc.debugContinuityAreas=true -Ddorg.diylc.debugComponentAreas=true -Ddorg.diylc.WriteStaticVariants=true -Ddorg.diylc.WriteStaticBlocks=true &#13;&#10;--add-opens java.base/java.util=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.lang=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.text=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt.font=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt.geom=ALL-UNNAMED"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m -Xmx2048m -javaagent:lib/jar-loader.jar -Dorg.diylc.storeDict=true -Dorg.diylc.enableTests=true -Dorg.diylc.scriptRun=true -Ddorg.diylc.debugContinuityAreas=true -Ddorg.diylc.debugComponentAreas=true -Ddorg.diylc.WriteStaticVariants=true -Ddorg.diylc.WriteStaticBlocks=true &#13;&#10;--add-opens java.base/java.util=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.lang=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.text=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt.font=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt.geom=ALL-UNNAMED --add-exports java.desktop/com.apple.eawt=ALL-UNNAMED --add-exports java.desktop/com.apple.eawt.event=ALL-UNNAMED --add-exports java.desktop/com.apple.eio=ALL-UNNAMED"/>
</launchConfiguration> </launchConfiguration>
+620 -182
View File
@@ -1,182 +1,620 @@
#10 / 2.59mm #10 / 2.59mm
#12 / 2.05mm #12 / 2.05mm
#14 / 1.63mm #14 / 1.63mm
#16 / 1.29mm #16 / 1.29mm
#18 / 1.02mm #18 / 1.02mm
#20 / 0.81mm #20 / 0.81mm
#22 / 0.64mm #22 / 0.64mm
#24 / 0.51mm #24 / 0.51mm
#26 / 0.40mm #26 / 0.40mm
#28 / 0.32mm #28 / 0.32mm
#30 / 0.25mm #30 / 0.25mm
#32 / 0.20mm #32 / 0.20mm
#34 / 0.16mm #34 / 0.16mm
#36 / 0.13mm #36 / 0.13mm
#8 / 3.26mm #8 / 3.26mm
1 throws / 2 positions (Building Blocks)
10 throws / 10 positions (Favorites)
11 throws / 11 positions (Recently Used)
12 throws / 12 positions 1 throws / 2 positions
1P12T 10 throws / 10 positions
2 throws / 2 positions 11 throws / 11 positions
2 throws / 3 positions / OFF even positions 12 throws / 12 positions
2P5T 180 degrees clockwise
2P6T 1P12T
3 throws / 3 positions 2 throws / 2 positions
3 throws / 5 positions / SHORT even positions 2 throws / 3 positions / OFF even positions
3P4T 270 degrees clockwise
3PDT 2P5T
3PDT (On/Off/On) 2P6T
4 band 3 throws / 3 positions
4 throws / 4 positions 3 throws / 5 positions / SHORT even positions
4P3T 3P4T
4P5T 3PDT
4P5T (Super/Mega) 3PDT (On/Off/On)
4P6T 4 band
4PDT 4 throws / 4 positions
4PDT (On/Off/On) 4P3T
4PDT (On/On/On Type 1) 4P5T
4PDT (On/On/On Type 2) 4P5T (Super/Mega)
5 band 4P6T
5 throws / 5 positions 4PDT
5PDT 4PDT (On/Off/On)
5PDT (On/Off/On) 4PDT (On/On/On Type 1)
6 throws / 6 positions 4PDT (On/On/On Type 2)
7 throws / 7 positions 5 band
8 throws / 8 positions 5 throws / 5 positions
9 throws / 9 positions 5PDT
A-O-I REGULATOR 5PDT (On/Off/On)
AC 6 throws / 6 positions
ANSI 7 throws / 7 positions
AWG 8 throws / 8 positions
Alternate 9 throws / 9 positions
And 90 degrees clockwise
Angle Offset A variant with that name already exists. Overwrite?
B-C-E BJT A-O-I REGULATOR
Background AC
Box ANSI
C-B-E BJT AWG
Circle About
Coil(s) Above
Component reordering is possible only when Project Explorer is sorted by z-index. Access User Files
Configuration Add Flexible Leads
Could not apply changes. Check the log for details. Add Validation Step
D-G-S JFET All Connected
D-G-S MOSFET Alpha
D-S-G JFET Alternate
D-S-G MOSFET Analyze
DC Analyze Guitar Diagrams
DFM A And
DFM B Angle
DIP Angle Offset
DP3T Anti-Aliasing
DP3T (Import 5-Position Strat) Apply Model
DP4T (6-Position Oak Grigsby) Apply Variant
DP5T Arrow Size
DPDT Author
DPDT (On/Off/On) Auto-Create Pads
DPDT (On/On) Auto-Edit Mode
DPDT (On/On/On Type 1) B-C-E BJT
DPDT (On/On/On Type 2) Background
Designation Base
Deutsch Below
Dimension Mode Board
Dots (Gradual) Board Color
Dots (Uniform) Board Width
Double Rails Boards
Double Rods Bobbin 1
Draw Standard Bobbin 2
Drop Body
E+ Border
E-B-C BJT Border Thickness
Eight Both
English Both Sides
Español Bottom
Export Bottom Left
Export to Gerber Bottom Right
Filament Voltage Box
Français Bracket
G-D-S JFET Bring Forward
G-D-S MOSFET Bring Selection to Front
G-I-O REGULATOR Buffer
G-O-I REGULATOR C-B-E BJT
G-S-D JFET Center
G-S-D MOSFET Center Negative
Generate DIYLC Netlist (excl. Switches) Center Positive
Generate DIYLC Netlist (incl. Switches) Center Terminal
Gray Central
Hole Type Change Password
Humbucking - 4 leads Channel
I-G-O REGULATOR Chassis
IEC Check Trace Proximity
Inner 1 Circle
Inner 2 Circular
Inner 3 Click on a component to highlight area directly or indirectly connected to the area below the cursor. To continue editing, this mode needs to be switched OFF
Inner 4 Click on the canvas to create a new %s or press %s to cancel
Inner 5 Click on the canvas to set the %s control point of a new %s or press %s to cancel
Inner 6 Click the lightbulb icon in the bottom-right corner of the window for more info.
Italiano Click to fetch the most recent public announcement
Lin Click to show recent changes and updates
Log Click to toggle to the next option
MPJA Coil
Markers Coil Border
Maximum number of switching combinations exceeded. Allowed: %s, actual: %s Coil Length
NPN Coil Width
Nand Coil(s)
Nederlands Color
Nine Color 1
Non-Plated Through Hole Color 2
Non-shorting Color code
Nor Column Spacing
Not Columns
Numeric (0-10) Component
Numeric (1-10) Component API
Numeric (1-11) Component reordering is possible only when Project Explorer is sorted by z-index.
Numeric (1-12) Components
Numeric (Even, No Ticks) Config
Numeric (Even, With Ticks) Configuration
O-G-I REGULATOR Connectivity
One Connector
Or Connector (Mirrored)
PAF Contacts
PCB Continuous Creation
PNP Coordinate Color
Pitch Coordinate Origin
Plated Through Hole Coordinates
Poles Copy
Português Core
RS Core Border
Rectangle Core Thickness
Rev log Core Width
S-G-D JFET Could not apply changes. Check the log for details.
S-G-D MOSFET Could not create a new file. Check the log for details.
SMD Could not create component. Check log for details.
SPDT Could not fetch public announcements.
SPDT (On/Off/On) Could not save the project to file. Check the log for details.
SPDT (On/On) Could not set component type slot. Check log for details.
SPST Cover
Screw Position Create B.O.M.
Shorting Create New Account
Show Project Explorer Current
Single - North Cut
Single - South Cut Between Holes
Six Cut Orientation
Sort by Name D-G-S JFET
Sort by Type D-G-S MOSFET
Sort by Z-index D-S-G JFET
Source Style D-S-G MOSFET
Source Type DC
Srpski DFM A
Stroke DFM B
Ten DIP
Terminal DIP (Mirrored)
Timing DP3T
Tubular Beveled DP3T (Import 5-Position Strat)
Xnor DP3T (Standard 3-Position Strat)
Xor DP3T (Standard 5-Position Strat)
cm DP4T (4-Position Tele)
ft DP4T (6-Position Oak Grigsby)
in DP5T
mm DPDT
px DPDT (On/Off/On)
yd DPDT (On/On)
DPDT (On/On/On Type 1)
DPDT (On/On/On Type 2)
Dashed
Decimals
Default
Default Font
Default Font Size
Delete Selection
Description
Designation
Diameter
Dimension Mode
Directional
Directly heated
Display
Display Pin #s
Dog Ear
Donate
Dot Spacing
Dots (Gradual)
Dots (Uniform)
Dotted
Double Rails
Double Rods
Drag control point(s) of
Drag the mouse over the canvas to place a new
Draw Standard
Drop
Duodecar B12C
Duplicate
E+
E-B-C BJT
Edges
Edit
Edit Project Settings
Edit Selection
Eight
Electro-Mechanical
Electrode Labels
Enable Cache Boost
End Arrow
Enjoying DIYLC? Click here to buy me a coffee :)
Error
Error occurred while editing selection. Check the log for details.
Exit
Expand Selection
Explicit Dimensions
Explicit Length
Explicit Width
Export
Export Building Blocks
Export Grid
Export Variants
Export to Gerber
Export to PDF
Export to PNG
Exporting outline for board %s to file %s
Extra Working Area
Eyelet color
FAQ
Filament Voltage
File
Filtertron
Find
Five
Flip
Folded
Font
Font Bold
Font Italic
Font Size
Font Size Override
Four
Full
Fuse
G-D-S JFET
G-D-S MOSFET
G-I-O REGULATOR
G-O-I REGULATOR
G-S-D JFET
G-S-D MOSFET
Generate DIYLC Netlist (excl. Switches)
Generate DIYLC Netlist (incl. Switches)
Generate Spice Netlist
Gerber Export
Gerber export completed successfully. The following files were created:%s
Grid
Grid Spacing
Group Selection
Guitar
Half
Heaters
Height
Help
Hi-Quality Rendering
Highlight Connected Areas
Hole
Hole Size
Hole Spacing
Hole Type
Holes Per Strip
Horizontal
Horizontal Alignment
Horizontal Large
Horizontal Medium
Horizontal Small 1
Horizontal Small 2
Horizontal X-Small
Humbucking - 4 leads
I-G-O REGULATOR
IEC
If this box is checked application will use the current value as a<br>default when creating new components of the same type
Image
Immediate Only
Import
Import Building Blocks
Import Netlist
Import Variants
In-Line D-44
In-line
Indent
Information
Inline
Inner 1
Inner 2
Inner 3
Inner 4
Inner 5
Inner 6
Input error for "%s": %s
Inside Color
Integration
Invert Polarity
Label
Label Color
Label Orientation
Label Position
Labels
Language
Language selection will be applied after the application is restarted.
Layer
Layers
Lead Color
Lead Count
Lead Length
Lead Spacing
Left
Left click to instantiate this component, right click for more options
Left-to-Right
Legs
Length
Letters
Lin
Loadline Editor
Lock
Log
Log In
Log Out
Lug Size
Lugs
MPJA
Make a Donation
Manage Account
Manage My Uploads
Mark Common Lugs
Marker
Marker Size
Markers
Maximum number of switching combinations exceeded. Allowed: %s, actual: %s
Mini
Miniature
Mirror Horizontally
Mirror Selection
Mirror Vertically
Mirroring operation will change the circuit. Do you want to continue?
Misc
Model
Mono
Mount
Mounting Lugs
Mouse Wheel Zoom
Moveable Label
NPN
Name
Nand
Negative
New
New version available
Nine
No
No new public announcements available.
Non-Plated Through Hole
Non-shorting
None
Nor
Not
Noval B9A
Nudge
Numbers
Numeric (0-10)
Numeric (1-10)
Numeric (1-11)
Numeric (1-12)
Numeric (Even, No Ticks)
Numeric (Even, With Ticks)
Nut
O-G-I REGULATOR
Octal
Offset
One
One Side
Open
Opposing Points
Or
Orientation
Outer Foil
Outer Foil Mark
Outline Mode
Outside
Oval horizontal
Oval vertical
PAF
PCB
PNP
Pad Color
Pad color
Panel
Passive
Paste
Pin Arrangement
Pin Color
Pin Spacing
Pin spacing
Pinout
Pins
Pitch
Plated Through Hole
Play Test
Plugin API
Point Count
Polarity
Polarized
Pole Color
Pole Pieces
Pole Pieces 1
Pole Pieces 2
Poles
Positions
Positive
Power Rating
Power Strip
Primary CT
Print...
Project Cloud
Public Announcement
RS
Radius
Rail
Recent Files
Recent Updates
Rectangle
Redo
Renumber On Paste
Renumber Selection
Resistance
Rev log
Reverse (standing)
Right
Rim
Rods
Rotate Clockwise
Rotate Counterclockwise
Rotate Selection
Round
Round WOG A
Round WOG B
Row Spacing
Rows
Ruler Inch Subdivision...
S-G-D JFET
S-G-D MOSFET
SMD
SPDT
SPDT (On/Off/On)
SPDT (On/On)
SPST
Same Type Only
Save
Save As
Save as Variant
Scale
Schematic Symbols
Screw Position
Screws
Search The Cloud
Searchable Tree
Secondary CT
Select
Select All
Selected component(s) have reached the bottom of their layer. Do you want to force the selection to the back?
Selected component(s) have reached the top of their layer. Do you want to force the selection to the top?
Selection
Selection Size
Selection contains components that cannot be mirrored. Do you want to exclude them?
Selection contains components that cannot be rotated. Do you want to exclude them?
Selection is empty.
Semiconductors
Send Backward
Send Selection to Back
Seven
Shaft Down
Shaft Up
Shape
Shapes
Shorting
Show Bracket
Show Grid
Show Project Explorer
Show Rulers
Shroud
Shrouded
Single - North
Single - South
Single Rail
Single Rods
Six
Size
Sizing Mode
Small-button B7G
Smooth
Snap To
Soap Bar
Solid
Sort by Name
Sort by Type
Sort by Z-index
Source Style
Source Type
Spacing
Square
Square BR-3
Standard
Start Arrow
Start Recording
Stereo
Sticky Points
Stop Recording
Stratocaster
Strip Color
Stripe
Stripe 1
Stripe 2
Stripe Color
Stripe Color 1
Stripe Color 2
Stroke
Style
Submit a Bug
Suppressor grid
Switched
Switches
Tab
Tab Border
Tabbed Toolbar
Taper
Telecaster
Ten
Terminal
Terminal Spacing
Terminals
Test
Text
Text Color
There are some components that are outside of the bounds of boards.%sThey will be ignored unless you add a board component underneath them.%sDo you want to continue?
There are unsaved changes. Would you like to save them?
Thickness
Three
Through Hole
Tick
Tick Width
Ticks
Timing
Title
Toolbox
Top
Top Lead
Top Left
Top Right
Top-to-Bottom
Trace
Trace Color
Trace Mask
Trace1
Transform Selection
Triangle
Tubes
Tubular
Tubular Beveled
Two
Type
Ultra-miniature
Underside Pad Color
Underside Trace Color
Undo
Ungroup Selection
Unit
Unlock
Upload A Project
User Manual
Value
Version history is not available.
Vertical
Vertical Alignment
Vertical Inline
Vertical Offset 1
Vertical Offset 2
View
Visible
Voltage
Wafer
Warning
Width
Winding Spacing
Wiring
X-axis
Xnor
Xor
Y-axis
Zoom
base of 10
base of 2
cm
ft
hold %s and drag to unstick from
in
mm
px
yd
Binary file not shown.
Binary file not shown.