mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
Partial fix of v2.2.0 alpha2 Unhandled exception - extrusion width #3482
Exceptions thrown by Flow calculation were made explicit classes derived from std::invalid_argument. The PresetHints::recommended_thin_wall_thickness() newly catches these exceptions and it shows the reason of why the hint is invalid.
This commit is contained in:
@@ -262,12 +262,16 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre
|
||||
int num_lines = std::min(num_perimeters * 2, 10);
|
||||
out += (boost::format(_utf8(L("Recommended object thin wall thickness for layer height %.2f and"))) % layer_height).str() + " ";
|
||||
// Start with the width of two closely spaced
|
||||
double width = external_perimeter_flow.width + external_perimeter_flow.spacing();
|
||||
for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) {
|
||||
if (i > 2)
|
||||
out += ", ";
|
||||
out += (boost::format(_utf8(L("%d lines: %.2f mm"))) % i % width).str() + " ";
|
||||
width += perimeter_flow.spacing() * (thin_walls ? 1.f : 2.f);
|
||||
try {
|
||||
double width = external_perimeter_flow.width + external_perimeter_flow.spacing();
|
||||
for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) {
|
||||
if (i > 2)
|
||||
out += ", ";
|
||||
out += (boost::format(_utf8(L("%d lines: %.2f mm"))) % i % width).str() + " ";
|
||||
width += perimeter_flow.spacing() * (thin_walls ? 1.f : 2.f);
|
||||
}
|
||||
} catch (const FlowErrorNegativeSpacing &) {
|
||||
out = _utf8(L("Recommended object thin wall thickness: Not available due to excessively small extrusion width."));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
|
||||
Reference in New Issue
Block a user