fix fill (override keyword added to avoid this bug in the future)

This commit is contained in:
supermerill 2019-12-12 14:31:40 +01:00
parent 9191ef8e78
commit 9e2b819880
14 changed files with 89 additions and 73 deletions

View File

@ -6,6 +6,7 @@
namespace Slic3r { namespace Slic3r {
/* /*
Creates a contiguous sequence of points at a specified height that make Creates a contiguous sequence of points at a specified height that make
up a horizontal slice of the edges of a space filling truncated up a horizontal slice of the edges of a space filling truncated
@ -138,7 +139,7 @@ void Fill3DHoneycomb::_fill_surface_single(
unsigned int thickness_layers, unsigned int thickness_layers,
const std::pair<float, Point> &direction, const std::pair<float, Point> &direction,
ExPolygon &expolygon, ExPolygon &expolygon,
Polylines &polylines_out) Polylines &polylines_out) const
{ {
// no rotation is supported for this infill pattern // no rotation is supported for this infill pattern
BoundingBox bb = expolygon.contour.bounding_box(); BoundingBox bb = expolygon.contour.bounding_box();

View File

@ -21,7 +21,7 @@ protected:
unsigned int thickness_layers, unsigned int thickness_layers,
const std::pair<float, Point> &direction, const std::pair<float, Point> &direction,
ExPolygon &expolygon, ExPolygon &expolygon,
Polylines &polylines_out); Polylines &polylines_out) const override;
}; };
} // namespace Slic3r } // namespace Slic3r

View File

@ -7,6 +7,7 @@
#include <stdint.h> #include <stdint.h>
#include <type_traits> #include <type_traits>
#include <boost/log/trivial.hpp>
#include "../libslic3r.h" #include "../libslic3r.h"
#include "../BoundingBox.hpp" #include "../BoundingBox.hpp"
@ -110,6 +111,7 @@ public:
// Perform the fill. // Perform the fill.
virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const; virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const;
virtual Fill* clone() const = 0;
protected: protected:
Fill() : Fill() :
layer_id(size_t(-1)), layer_id(size_t(-1)),
@ -131,7 +133,9 @@ protected:
unsigned int /* thickness_layers */, unsigned int /* thickness_layers */,
const std::pair<float, Point> & /* direction */, const std::pair<float, Point> & /* direction */,
ExPolygon & /* expolygon */, ExPolygon & /* expolygon */,
Polylines & /* polylines_out */) const {}; Polylines & /* polylines_out */) const {
BOOST_LOG_TRIVIAL(error)<<"Error, the fill isn't implemented";
};
virtual float _layer_angle(size_t idx) const { return (idx & 1) ? float(M_PI/2.) : 0; } virtual float _layer_angle(size_t idx) const { return (idx & 1) ? float(M_PI/2.) : 0; }

View File

@ -72,7 +72,10 @@ FillConcentric::_fill_surface_single(
// We want the loops to be split inside the G-code generator to get optimum path planning. // We want the loops to be split inside the G-code generator to get optimum path planning.
} }
void FillConcentricWGapFill::fill_surface_extrusion(const Surface *surface, const FillParams &params, void
FillConcentricWGapFill::fill_surface_extrusion(
const Surface *surface,
const FillParams &params,
ExtrusionEntitiesPtr &out) const { ExtrusionEntitiesPtr &out) const {
// Perform offset. // Perform offset.

View File

@ -18,7 +18,7 @@ protected:
unsigned int thickness_layers, unsigned int thickness_layers,
const std::pair<float, Point> &direction, const std::pair<float, Point> &direction,
ExPolygon &expolygon, ExPolygon &expolygon,
Polylines &polylines_out) const; Polylines &polylines_out) const override;
virtual bool no_sort() const { return true; } virtual bool no_sort() const { return true; }
}; };

View File

@ -153,7 +153,7 @@ void FillGyroid::_fill_surface_single(
unsigned int thickness_layers, unsigned int thickness_layers,
const std::pair<float, Point> &direction, const std::pair<float, Point> &direction,
ExPolygon &expolygon, ExPolygon &expolygon,
Polylines &polylines_out) Polylines &polylines_out) const
{ {
float infill_angle = this->angle + (CorrectionAngle * 2*M_PI) / 360.; float infill_angle = this->angle + (CorrectionAngle * 2*M_PI) / 360.;
if(abs(infill_angle) >= EPSILON) if(abs(infill_angle) >= EPSILON)

View File

@ -30,7 +30,7 @@ protected:
unsigned int thickness_layers, unsigned int thickness_layers,
const std::pair<float, Point> &direction, const std::pair<float, Point> &direction,
ExPolygon &expolygon, ExPolygon &expolygon,
Polylines &polylines_out); Polylines &polylines_out) const override;
}; };
} // namespace Slic3r } // namespace Slic3r

View File

@ -6,18 +6,20 @@
namespace Slic3r { namespace Slic3r {
FillHoneycomb::Cache FillHoneycomb::cache{};
void FillHoneycomb::_fill_surface_single( void FillHoneycomb::_fill_surface_single(
const FillParams &params, const FillParams &params,
unsigned int thickness_layers, unsigned int thickness_layers,
const std::pair<float, Point> &direction, const std::pair<float, Point> &direction,
ExPolygon &expolygon, ExPolygon &expolygon,
Polylines &polylines_out) Polylines &polylines_out) const
{ {
// cache hexagons math // cache hexagons math
CacheID cache_id(params.density, this->spacing); CacheID cache_id(params.density, this->spacing);
Cache::iterator it_m = this->cache.find(cache_id); Cache::iterator it_m = FillHoneycomb::cache.find(cache_id);
if (it_m == this->cache.end()) { if (it_m == FillHoneycomb::cache.end()) {
it_m = this->cache.insert(it_m, std::pair<CacheID, CacheData>(cache_id, CacheData())); it_m = FillHoneycomb::cache.insert(it_m, std::pair<CacheID, CacheData>(cache_id, CacheData()));
CacheData &m = it_m->second; CacheData &m = it_m->second;
coord_t min_spacing = scale_(this->spacing); coord_t min_spacing = scale_(this->spacing);
m.distance = min_spacing / params.density; m.distance = min_spacing / params.density;

View File

@ -21,7 +21,7 @@ protected:
unsigned int thickness_layers, unsigned int thickness_layers,
const std::pair<float, Point> &direction, const std::pair<float, Point> &direction,
ExPolygon &expolygon, ExPolygon &expolygon,
Polylines &polylines_out); Polylines &polylines_out) const override;
// Caching the // Caching the
struct CacheID struct CacheID
@ -47,7 +47,7 @@ protected:
Point hex_center; Point hex_center;
}; };
typedef std::map<CacheID, CacheData> Cache; typedef std::map<CacheID, CacheData> Cache;
Cache cache; static Cache cache;
virtual float _layer_angle(size_t idx) const { return float(M_PI/3.) * (idx % 3); } virtual float _layer_angle(size_t idx) const { return float(M_PI/3.) * (idx % 3); }
}; };

View File

@ -7,28 +7,32 @@
namespace Slic3r { namespace Slic3r {
void FillRectilinear::_fill_surface_single( void FillRectilinear::init_spacing(coordf_t spacing, const FillParams &params) {
const FillParams &params, this->spacing = spacing;
unsigned int thickness_layers,
const std::pair<float, Point> &direction,
ExPolygon &expolygon,
Polylines &polylines_out)
{
// rotate polygons so that we can work with vertical lines here
expolygon.rotate(- direction.first);
this->_min_spacing = scale_(this->spacing); this->_min_spacing = scale_(this->spacing);
assert(params.density > 0.0001f); assert(params.density > 0.0001f);
this->_line_spacing = coord_t(coordf_t(this->_min_spacing) / params.density); this->_line_spacing = coord_t(coordf_t(this->_min_spacing) / params.density);
this->_diagonal_distance = this->_line_spacing * 2; this->_diagonal_distance = this->_line_spacing * 2;
this->_line_oscillation = this->_line_spacing - this->_min_spacing; // only for Line infill this->_line_oscillation = this->_line_spacing - this->_min_spacing; // only for Line infill
BoundingBox bounding_box = expolygon.contour.bounding_box();
// define flow spacing according to requested density // define flow spacing according to requested density
if (params.density > 0.9999f && !params.dont_adjust) { if (params.density > 0.9999f && !params.dont_adjust) {
this->_line_spacing = this->_adjust_solid_spacing(bounding_box.size()(0), this->_line_spacing); this->_line_spacing = this->_adjust_solid_spacing(bounding_box.size()(0), this->_line_spacing);
this->spacing = unscale<double>(this->_line_spacing); this->spacing = unscale<double>(this->_line_spacing);
} else { }
}
void FillRectilinear::_fill_surface_single(
const FillParams &params,
unsigned int thickness_layers,
const std::pair<float, Point> &direction,
ExPolygon &expolygon,
Polylines &polylines_out) const
{
// rotate polygons so that we can work with vertical lines here
expolygon.rotate(- direction.first);
BoundingBox bounding_box = expolygon.contour.bounding_box();
if (!(params.density > 0.9999f && !params.dont_adjust)) {
// extend bounding box so that our pattern will be aligned with other layers // extend bounding box so that our pattern will be aligned with other layers
// Transform the reference point to the rotated coordinate system. // Transform the reference point to the rotated coordinate system.
bounding_box.merge(_align_to_grid( bounding_box.merge(_align_to_grid(

View File

@ -21,7 +21,7 @@ protected:
unsigned int thickness_layers, unsigned int thickness_layers,
const std::pair<float, Point> &direction, const std::pair<float, Point> &direction,
ExPolygon &expolygon, ExPolygon &expolygon,
Polylines &polylines_out); Polylines &polylines_out) const override;
coord_t _min_spacing; coord_t _min_spacing;
coord_t _line_spacing; coord_t _line_spacing;
@ -29,6 +29,7 @@ protected:
coord_t _diagonal_distance; coord_t _diagonal_distance;
// only for line infill // only for line infill
coord_t _line_oscillation; coord_t _line_oscillation;
virtual void init_spacing(coordf_t spacing, const FillParams &params) override;
// Enabled for the grid infill, disabled for the rectilinear and line infill. // Enabled for the grid infill, disabled for the rectilinear and line infill.
virtual bool _horizontal_lines() const { return false; } virtual bool _horizontal_lines() const { return false; }
@ -36,7 +37,7 @@ protected:
virtual Line _line(int i, coord_t x, coord_t y_min, coord_t y_max) const virtual Line _line(int i, coord_t x, coord_t y_min, coord_t y_max) const
{ return Line(Point(x, y_min), Point(x, y_max)); } { return Line(Point(x, y_min), Point(x, y_max)); }
virtual bool _can_connect(coord_t dist_X, coord_t dist_Y) { virtual bool _can_connect(coord_t dist_X, coord_t dist_Y) const {
return dist_X <= this->_diagonal_distance return dist_X <= this->_diagonal_distance
&& dist_Y <= this->_diagonal_distance; && dist_Y <= this->_diagonal_distance;
} }
@ -48,12 +49,12 @@ public:
virtual ~FillLine() {} virtual ~FillLine() {}
protected: protected:
virtual Line _line(int i, coord_t x, coord_t y_min, coord_t y_max) const { virtual Line _line(int i, coord_t x, coord_t y_min, coord_t y_max) const override {
coord_t osc = (i & 1) ? this->_line_oscillation : 0; coord_t osc = (i & 1) ? this->_line_oscillation : 0;
return Line(Point(x - osc, y_min), Point(x + osc, y_max)); return Line(Point(x - osc, y_min), Point(x + osc, y_max));
} }
virtual bool _can_connect(coord_t dist_X, coord_t dist_Y) virtual bool _can_connect(coord_t dist_X, coord_t dist_Y) const override
{ {
double TOLERANCE = 10 * SCALED_EPSILON; double TOLERANCE = 10 * SCALED_EPSILON;
return (dist_X >= (this->_line_spacing - this->_line_oscillation) - TOLERANCE) return (dist_X >= (this->_line_spacing - this->_line_oscillation) - TOLERANCE)
@ -69,9 +70,9 @@ public:
protected: protected:
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill. // The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
virtual float _layer_angle(size_t idx) const { return 0.f; } virtual float _layer_angle(size_t idx) const override { return 0.f; }
// Flag for Slic3r::Fill::Rectilinear to fill both directions. // Flag for Slic3r::Fill::Rectilinear to fill both directions.
virtual bool _horizontal_lines() const { return true; } virtual bool _horizontal_lines() const override { return true; }
}; };
}; // namespace Slic3r }; // namespace Slic3r

View File

@ -14,9 +14,9 @@ struct ExPolygonWithOffset;
class FillRectilinear2 : public Fill class FillRectilinear2 : public Fill
{ {
public: public:
virtual Fill* clone() const { return new FillRectilinear2(*this); }; virtual Fill* clone() const override { return new FillRectilinear2(*this); };
virtual ~FillRectilinear2() {} virtual ~FillRectilinear2() {}
void init_spacing(coordf_t spacing, const FillParams &params) override; virtual void init_spacing(coordf_t spacing, const FillParams &params) override;
virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override; virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
protected: protected:
@ -28,56 +28,56 @@ protected:
class FillGrid2 : public FillRectilinear2 class FillGrid2 : public FillRectilinear2
{ {
public: public:
virtual Fill* clone() const { return new FillGrid2(*this); }; virtual Fill* clone() const override { return new FillGrid2(*this); };
virtual ~FillGrid2() {} virtual ~FillGrid2() {}
virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override; virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
protected: protected:
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill. // The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
virtual float _layer_angle(size_t idx) const { return 0.f; } virtual float _layer_angle(size_t idx) const override { return 0.f; }
}; };
class FillTriangles : public FillRectilinear2 class FillTriangles : public FillRectilinear2
{ {
public: public:
virtual Fill* clone() const { return new FillTriangles(*this); }; virtual Fill* clone() const override { return new FillTriangles(*this); };
virtual ~FillTriangles() {} virtual ~FillTriangles() {}
virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override; virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
protected: protected:
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill. // The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
virtual float _layer_angle(size_t idx) const { return 0.f; } virtual float _layer_angle(size_t idx) const override { return 0.f; }
}; };
class FillStars : public FillRectilinear2 class FillStars : public FillRectilinear2
{ {
public: public:
virtual Fill* clone() const { return new FillStars(*this); }; virtual Fill* clone() const override { return new FillStars(*this); };
virtual ~FillStars() {} virtual ~FillStars() {}
virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override; virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
protected: protected:
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill. // The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
virtual float _layer_angle(size_t idx) const { return 0.f; } virtual float _layer_angle(size_t idx) const override { return 0.f; }
}; };
class FillCubic : public FillRectilinear2 class FillCubic : public FillRectilinear2
{ {
public: public:
virtual Fill* clone() const { return new FillCubic(*this); }; virtual Fill* clone() const override { return new FillCubic(*this); };
virtual ~FillCubic() {} virtual ~FillCubic() {}
virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override; virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
protected: protected:
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill. // The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
virtual float _layer_angle(size_t idx) const { return 0.f; } virtual float _layer_angle(size_t idx) const override { return 0.f; }
}; };
class FillRectilinear2Peri : public FillRectilinear2 class FillRectilinear2Peri : public FillRectilinear2
{ {
public: public:
virtual Fill* clone() const { return new FillRectilinear2Peri(*this); }; virtual Fill* clone() const override { return new FillRectilinear2Peri(*this); };
virtual ~FillRectilinear2Peri() {} virtual ~FillRectilinear2Peri() {}
//virtual Polylines fill_surface(const Surface *surface, const FillParams &params); //virtual Polylines fill_surface(const Surface *surface, const FillParams &params);
virtual void fill_surface_extrusion(const Surface *surface, const FillParams &params, ExtrusionEntitiesPtr &out) const override; virtual void fill_surface_extrusion(const Surface *surface, const FillParams &params, ExtrusionEntitiesPtr &out) const override;
@ -93,15 +93,15 @@ public:
virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override; virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
protected: protected:
virtual float _layer_angle(size_t idx) const; virtual float _layer_angle(size_t idx) const override;
virtual std::vector<SegmentedIntersectionLine> _vert_lines_for_polygon(const ExPolygonWithOffset &poly_with_offset, const BoundingBox &bounding_box, const FillParams &params, coord_t line_spacing) const; virtual std::vector<SegmentedIntersectionLine> _vert_lines_for_polygon(const ExPolygonWithOffset &poly_with_offset, const BoundingBox &bounding_box, const FillParams &params, coord_t line_spacing) const override;
virtual coord_t _line_spacing_for_density(float density) const; virtual coord_t _line_spacing_for_density(float density) const override;
}; };
class FillRectilinearSawtooth : public FillRectilinear2 { class FillRectilinearSawtooth : public FillRectilinear2 {
public: public:
virtual Fill* clone() const { return new FillRectilinearSawtooth(*this); }; virtual Fill* clone() const override { return new FillRectilinearSawtooth(*this); };
virtual ~FillRectilinearSawtooth() {} virtual ~FillRectilinearSawtooth() {}
virtual void fill_surface_extrusion(const Surface *surface, const FillParams &params, ExtrusionEntitiesPtr &out) const override; virtual void fill_surface_extrusion(const Surface *surface, const FillParams &params, ExtrusionEntitiesPtr &out) const override;

View File

@ -1529,7 +1529,7 @@ static bool fill_hatching_segments_legacy(
}; // namespace FillRectilinear3_Internal }; // namespace FillRectilinear3_Internal
bool FillRectilinear3::fill_surface_by_lines(const Surface *surface, const FillParams &params, std::vector<FillDirParams> &fill_dir_params, Polylines &polylines_out) bool FillRectilinear3::fill_surface_by_lines(const Surface *surface, const FillParams &params, std::vector<FillDirParams> &fill_dir_params, Polylines &polylines_out) const
{ {
assert(params.density > 0.0001f); assert(params.density > 0.0001f);
@ -1566,20 +1566,21 @@ bool FillRectilinear3::fill_surface_by_lines(const Surface *surface, const FillP
return true; return true;
} }
Polylines FillRectilinear3::fill_surface(const Surface *surface, const FillParams &params) Polylines FillRectilinear3::fill_surface(const Surface *surface, const FillParams &params) const
{ {
Polylines polylines_out; Polylines polylines_out;
std::vector<FillDirParams> fill_dir_params; std::vector<FillDirParams> fill_dir_params;
fill_dir_params.emplace_back(FillDirParams(this->spacing, 0.f)); fill_dir_params.emplace_back(FillDirParams(this->spacing, 0.f));
if (! fill_surface_by_lines(surface, params, fill_dir_params, polylines_out)) if (! fill_surface_by_lines(surface, params, fill_dir_params, polylines_out))
printf("FillRectilinear3::fill_surface() failed to fill a region.\n"); printf("FillRectilinear3::fill_surface() failed to fill a region.\n");
if (params.full_infill() && ! params.dont_adjust) //if (params.full_infill() && ! params.dont_adjust)
// Return back the adjusted spacing. // Return back the adjusted spacing. //NOT POSSIBLE : DO NOT MODIFY PARAMS AFTER INITIALISATION !!! No one will read it anyway.
this->spacing = fill_dir_params.front().spacing; //this->spacing = fill_dir_params.front().spacing;
return polylines_out; return polylines_out;
} }
Polylines FillGrid3::fill_surface(const Surface *surface, const FillParams &params) Polylines FillGrid3::fill_surface(const Surface *surface, const FillParams &params) const
{ {
// Each linear fill covers half of the target coverage. // Each linear fill covers half of the target coverage.
FillParams params2 = params; FillParams params2 = params;
@ -1593,7 +1594,7 @@ Polylines FillGrid3::fill_surface(const Surface *surface, const FillParams &para
return polylines_out; return polylines_out;
} }
Polylines FillTriangles3::fill_surface(const Surface *surface, const FillParams &params) Polylines FillTriangles3::fill_surface(const Surface *surface, const FillParams &params) const
{ {
// Each linear fill covers 1/3 of the target coverage. // Each linear fill covers 1/3 of the target coverage.
FillParams params2 = params; FillParams params2 = params;
@ -1608,7 +1609,7 @@ Polylines FillTriangles3::fill_surface(const Surface *surface, const FillParams
return polylines_out; return polylines_out;
} }
Polylines FillStars3::fill_surface(const Surface *surface, const FillParams &params) Polylines FillStars3::fill_surface(const Surface *surface, const FillParams &params) const
{ {
// Each linear fill covers 1/3 of the target coverage. // Each linear fill covers 1/3 of the target coverage.
FillParams params2 = params; FillParams params2 = params;
@ -1623,7 +1624,7 @@ Polylines FillStars3::fill_surface(const Surface *surface, const FillParams &par
return polylines_out; return polylines_out;
} }
Polylines FillCubic3::fill_surface(const Surface *surface, const FillParams &params) Polylines FillCubic3::fill_surface(const Surface *surface, const FillParams &params) const
{ {
// Each linear fill covers 1/3 of the target coverage. // Each linear fill covers 1/3 of the target coverage.
FillParams params2 = params; FillParams params2 = params;

View File

@ -12,9 +12,9 @@ class Surface;
class FillRectilinear3 : public Fill class FillRectilinear3 : public Fill
{ {
public: public:
virtual Fill* clone() const { return new FillRectilinear3(*this); }; virtual Fill* clone() const override { return new FillRectilinear3(*this); };
virtual ~FillRectilinear3() {} virtual ~FillRectilinear3() {}
virtual Polylines fill_surface(const Surface *surface, const FillParams &params); virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
struct FillDirParams struct FillDirParams
{ {
@ -26,55 +26,55 @@ public:
}; };
protected: protected:
bool fill_surface_by_lines(const Surface *surface, const FillParams &params, std::vector<FillDirParams> &fill_dir_params, Polylines &polylines_out); bool fill_surface_by_lines(const Surface *surface, const FillParams &params, std::vector<FillDirParams> &fill_dir_params, Polylines &polylines_out) const;
}; };
class FillGrid3 : public FillRectilinear3 class FillGrid3 : public FillRectilinear3
{ {
public: public:
virtual Fill* clone() const { return new FillGrid3(*this); }; virtual Fill* clone() const override { return new FillGrid3(*this); };
virtual ~FillGrid3() {} virtual ~FillGrid3() {}
virtual Polylines fill_surface(const Surface *surface, const FillParams &params); virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
protected: protected:
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill. // The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
virtual float _layer_angle(size_t /* idx */) const { return 0.f; } virtual float _layer_angle(size_t /* idx */) const override { return 0.f; }
}; };
class FillTriangles3 : public FillRectilinear3 class FillTriangles3 : public FillRectilinear3
{ {
public: public:
virtual Fill* clone() const { return new FillTriangles3(*this); }; virtual Fill* clone() const override { return new FillTriangles3(*this); };
virtual ~FillTriangles3() {} virtual ~FillTriangles3() {}
virtual Polylines fill_surface(const Surface *surface, const FillParams &params); virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
protected: protected:
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill. // The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
virtual float _layer_angle(size_t /* idx */) const { return 0.f; } virtual float _layer_angle(size_t /* idx */) const override { return 0.f; }
}; };
class FillStars3 : public FillRectilinear3 class FillStars3 : public FillRectilinear3
{ {
public: public:
virtual Fill* clone() const { return new FillStars3(*this); }; virtual Fill* clone() const override { return new FillStars3(*this); };
virtual ~FillStars3() {} virtual ~FillStars3() {}
virtual Polylines fill_surface(const Surface *surface, const FillParams &params); virtual Polylines fill_surface(const Surface *surface, const FillParams &params) const override;
protected: protected:
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill. // The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
virtual float _layer_angle(size_t /* idx */) const { return 0.f; } virtual float _layer_angle(size_t /* idx */) const override { return 0.f; }
}; };
class FillCubic3 : public FillRectilinear3 class FillCubic3 : public FillRectilinear3
{ {
public: public:
virtual Fill* clone() const { return new FillCubic3(*this); }; virtual Fill* clone() const override { return new FillCubic3(*this); };
virtual ~FillCubic3() {} virtual ~FillCubic3() {}
virtual Polylines fill_surface(const Surface *surface, const FillParams &params); virtual Polylines fill_surface(const Surface *surface, const FillParams &params)const override;
protected: protected:
// The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill. // The grid fill will keep the angle constant between the layers, see the implementation of Slic3r::Fill.
virtual float _layer_angle(size_t /* idx */) const { return 0.f; } virtual float _layer_angle(size_t /* idx */) const override { return 0.f; }
}; };