Share and Clamp the Build Plate Tilt Shift in Support Generators

The three support generators each computed lh * tan(tilt), which overflows
coord_t at 90 degrees and flips sign beyond it (belt sync can write up to
180). One helper now returns the tilt slope with the tilt capped at 89 degrees.
This commit is contained in:
Hanif Koh
2026-09-14 17:27:32 +08:00
parent 5092831007
commit 6e33f3f5dd
5 changed files with 20 additions and 22 deletions
+6
View File
@@ -2069,4 +2069,10 @@ sub clip_with_shape {
}
*/
Vec2d build_plate_tilt_slope(const PrintConfig &print_config)
{
auto slope = [](double tilt_deg) { return std::tan(Geometry::deg2rad(std::clamp(tilt_deg, -89., 89.))); };
return { slope(print_config.build_plate_tilt_y.value), slope(print_config.build_plate_tilt_x.value) };
}
} // namespace Slic3r