mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-09 00:31:19 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user