Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replaces #510. But instead of specifying slots with just a width and height property (as originally intended by a
DrillSize
class), I decided to make slots even more flexible. Since the Excellon file format supports creating arbitrary slots by movement commands (G00..G03), let's reflect that flexibility in LibrePCB as well.File Format
So far, a hole object was stored this way:
Now a hole is specified by vertices (exactly the same way as for polygons):
Holes with only one vertex are circular. Holes with multiple vertices are slots. They can even be curved (
angle
!= 0):User Interface
The hole properties dialog allows to specify holes either as circular drills, simple linear slots, or arbitrary slots:
The editors do not yet contain a tool to draw slots. Currently you can just add circular holes and and then convert them to slots by modifying their properties. A slot tool could be added later without needing any file format change.
Excellon Export
By default, slotted holes are exported with commands G00..G03 in the Excellon drill file. This seems to be the recommended way (KiCad doesn't recommend G85 and the XNC Specs from Ucamco doesn't even mention G85; see also #510 (comment)).
However, there might be manufacturers which require slots exported as G85 slot commands. Even Gerbv does only render G85 correctly, but not G00..G03 which is quite a shame. Therefore I made it configurable which command to use:
Since G85 cannot draw arcs, it can be used only for boards which do not contain curved slots. If there are curved slots, an error occurs during the export.
DRC
The support of curved slots unfortunately varies between different PCB manufacturers. Multi-segment slots maybe too, I'm not sure. And whether G85 shall be used or not, also depends on the manufacturer. To avoid surprises during production, I added a new DRC rule which allows to warn if slots of a particular style are used in a board:
Fixes #505.