Skip to content

Commit

Permalink
fix: Don't round bits that will be milldrilled.
Browse files Browse the repository at this point in the history
This fixes #631
  • Loading branch information
eyal0 committed Sep 10, 2022
1 parent 14f425a commit 689326d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
5 changes: 5 additions & 0 deletions drill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,11 @@ map<int, drillbit> ExcellonProcessor::optimize_bits() {
auto& wanted_drill_bit = wanted_drill.second;
auto old_string = drill_to_string(wanted_drill_bit);
const Length& wanted_length = wanted_drill_bit.as_length();
if (min_milldrill_diameter &&
wanted_length.asInch(inputFactor) > min_milldrill_diameter->asInch(inputFactor)) {
// We're not going to drill this one anyway so don't adjust it.
continue;
}
auto best_available_drill = std::min_element(
available_drills.begin(), available_drills.end(),
[&](AvailableDrill a, AvailableDrill b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ G81 R1.50000 Z-1.75000 F100.00000 X120.00000 Y-100.16000
X120.00000 Y-97.62000
X120.00000 Y-95.08000
X130.16000 Y-90.00000
X130.16000 Y-92.54000
X130.16000 Y-95.08000
X130.16000 Y-97.62000
X130.16000 Y-100.16000
G80

G00 Z10.000 ( All done -- retract )
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions units.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ class UnitBase {
throw comparison_exception("Can't compare with units and without.");
}
}
bool operator>(const UnitBase<dimension_t>& other) const {
return other < *this;
}
bool operator>=(const UnitBase<dimension_t>& other) const {
return !(*this < other);
}
Expand Down

0 comments on commit 689326d

Please sign in to comment.