Limit upper tolerance in Gyroid

Do not reduce resolution more than necessary when using larger nozzles
and/or higher layer heights.
This commit is contained in:
Yuri D'Elia 2019-07-19 12:59:57 +02:00 committed by supermerill
parent d8732ecfcd
commit 73f8ffe76a

View File

@ -106,9 +106,9 @@ static Polylines make_gyroid_waves(double gridZ, double density_adjusted, double
{
const double scaleFactor = scale_(line_spacing) / density_adjusted;
// tolerance (in scaled units)
// TODO: should consider layer thickness
const double tolerance = line_spacing / 2 / unscale<double>(scaleFactor);
// tolerance (in scaled units) - note: clamp the maximum tolerance
// as there's no benefit to reduce the definition with large nozzles
const double tolerance = std::min(line_spacing, 0.4) / 2 / unscale<double>(scaleFactor);
//scale factor for 5% : 8 712 388
// 1z = 10^-6 mm ?