mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 07:08:59 +08:00
Automatically switch to rectilinear when a pattern is used that doesn't support solid infill
This commit is contained in:
parent
ee2d14fcd2
commit
182d68ad85
@ -75,6 +75,9 @@ public:
|
||||
// Do not sort the fill lines to optimize the print head path?
|
||||
virtual bool no_sort() const { return false; };
|
||||
|
||||
// Can this pattern be used for solid infill?
|
||||
virtual bool can_solid() const { return false; };
|
||||
|
||||
// Perform the fill.
|
||||
virtual Polylines fill_surface(const Surface &surface);
|
||||
|
||||
|
@ -19,6 +19,7 @@ protected:
|
||||
Polylines* polylines_out);
|
||||
|
||||
virtual bool no_sort() const { return true; }
|
||||
virtual bool can_solid() const { return true; };
|
||||
};
|
||||
|
||||
} // namespace Slic3r
|
||||
|
@ -12,6 +12,7 @@ class FillRectilinear : public Fill
|
||||
public:
|
||||
virtual Fill* clone() const { return new FillRectilinear(*this); };
|
||||
virtual ~FillRectilinear() {}
|
||||
virtual bool can_solid() const { return true; };
|
||||
|
||||
protected:
|
||||
virtual void _fill_surface_single(
|
||||
@ -50,6 +51,7 @@ class FillAlignedRectilinear : public FillRectilinear
|
||||
public:
|
||||
virtual Fill* clone() const { return new FillAlignedRectilinear(*this); };
|
||||
virtual ~FillAlignedRectilinear() {};
|
||||
virtual bool can_solid() const { return false; };
|
||||
|
||||
protected:
|
||||
// Keep the angle constant in all layers.
|
||||
@ -61,6 +63,7 @@ class FillGrid : public FillRectilinear
|
||||
public:
|
||||
virtual Fill* clone() const { return new FillGrid(*this); };
|
||||
virtual ~FillGrid() {}
|
||||
virtual bool can_solid() const { return false; };
|
||||
|
||||
protected:
|
||||
// The grid fill will keep the angle constant between the layers,; see the implementation of Slic3r::Fill.
|
||||
@ -78,6 +81,7 @@ class FillTriangles : public FillRectilinear
|
||||
public:
|
||||
virtual Fill* clone() const { return new FillTriangles(*this); };
|
||||
virtual ~FillTriangles() {}
|
||||
virtual bool can_solid() const { return false; };
|
||||
|
||||
protected:
|
||||
// The grid fill will keep the angle constant between the layers,; see the implementation of Slic3r::Fill.
|
||||
@ -95,6 +99,7 @@ class FillStars : public FillRectilinear
|
||||
public:
|
||||
virtual Fill* clone() const { return new FillStars(*this); };
|
||||
virtual ~FillStars() {}
|
||||
virtual bool can_solid() const { return false; };
|
||||
|
||||
protected:
|
||||
// The grid fill will keep the angle constant between the layers,; see the implementation of Slic3r::Fill.
|
||||
@ -112,6 +117,7 @@ class FillCubic : public FillRectilinear
|
||||
public:
|
||||
virtual Fill* clone() const { return new FillCubic(*this); };
|
||||
virtual ~FillCubic() {}
|
||||
virtual bool can_solid() const { return false; };
|
||||
|
||||
protected:
|
||||
// The grid fill will keep the angle constant between the layers,; see the implementation of Slic3r::Fill.
|
||||
|
@ -183,6 +183,15 @@ LayerRegion::make_fill()
|
||||
#else
|
||||
std::auto_ptr<Fill> f = std::auto_ptr<Fill>(Fill::new_from_type(fill_pattern));
|
||||
#endif
|
||||
|
||||
// switch to rectilinear if this pattern doesn't support solid infill
|
||||
if (density > 0.9999f && !f->can_solid())
|
||||
#if SLIC3R_CPPVER >= 11
|
||||
f = std::unique_ptr<Fill>(Fill::new_from_type(ipRectilinear));
|
||||
#else
|
||||
f = std::auto_ptr<Fill>(Fill::new_from_type(ipRectilinear));
|
||||
#endif
|
||||
|
||||
f->bounding_box = this->layer()->object()->bounding_box();
|
||||
|
||||
// calculate the actual flow we'll be using for this infill
|
||||
|
Loading…
x
Reference in New Issue
Block a user