Move gyroid constants to the class declaration

This commit is contained in:
Yuri D'Elia 2019-08-07 21:58:45 +02:00
parent da6c285f1f
commit 90c85b7c8a
2 changed files with 10 additions and 4 deletions

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) - 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);
// tolerance in scaled units. clamp the maximum tolerance as there's
// no processing-speed benefit to do so beyond a certain point
const double tolerance = std::min(line_spacing, FillGyroid::PatternTolerance) / 2 / unscale<double>(scaleFactor);
//scale factor for 5% : 8 712 388
// 1z = 10^-6 mm ?
@ -158,7 +158,7 @@ void FillGyroid::_fill_surface_single(
BoundingBox bb = expolygon.contour.bounding_box();
// Density adjusted to have a good %of weight.
double density_adjusted = std::max(0., params.density * 2.44);
double density_adjusted = std::max(0., params.density * DensityAdjust);
// Distance between the gyroid waves in scaled coordinates.
coord_t distance = coord_t(scale_(this->spacing) / density_adjusted);

View File

@ -20,6 +20,12 @@ public:
// speed in default configuration (degrees)
static constexpr float CorrectionAngle = -45.;
// Density adjustment to have a good %of weight.
static constexpr double DensityAdjust = 2.44;
// Gyroid upper resolution tolerance (mm^-2)
static constexpr double PatternTolerance = 0.4;
protected:
virtual void _fill_surface_single(