Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Aligned Monotonic infill for improving surface finish and clarity of clear parts #10847

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/libslic3r/Fill/FillBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Fill* Fill::new_from_type(const InfillPattern type)
case ipAlignedRectilinear: return new FillAlignedRectilinear();
case ipMonotonic: return new FillMonotonic();
case ipMonotonicLines: return new FillMonotonicLines();
case ipAlignedMonotonic: return new FillAlignedMonotonic();
case ipLine: return new FillLine();
case ipGrid: return new FillGrid();
case ipTriangles: return new FillTriangles();
Expand Down
10 changes: 10 additions & 0 deletions src/libslic3r/Fill/FillRectilinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2974,6 +2974,16 @@ Polylines FillMonotonic::fill_surface(const Surface *surface, const FillParams &
return polylines_out;
}

Polylines FillAlignedMonotonic::fill_surface(const Surface *surface, const FillParams &params)
{
FillParams params2 = params;
params2.monotonic = true;
Polylines polylines_out;
if (! fill_surface_by_lines(surface, params2, 0.f, 0.f, polylines_out))
BOOST_LOG_TRIVIAL(error) << "FillAlignedMonotonic::fill_surface() failed to fill a region.";
return polylines_out;
}

Polylines FillMonotonicLines::fill_surface(const Surface *surface, const FillParams &params)
{
FillParams params2 = params;
Expand Down
13 changes: 13 additions & 0 deletions src/libslic3r/Fill/FillRectilinear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ class FillMonotonicLines : public FillRectilinear
bool no_sort() const override { return true; }
};

class FillAlignedMonotonic : public FillRectilinear
{
public:
Fill* clone() const override { return new FillAlignedMonotonic(*this); }
~FillAlignedMonotonic() override = default;
Polylines fill_surface(const Surface *surface, const FillParams &params) override;
bool no_sort() const override { return true; }

protected:
// Always generate infill at the same angle.
virtual float _layer_angle(size_t idx) const override { return 0.f; }
};

class FillGrid : public FillRectilinear
{
public:
Expand Down
4 changes: 4 additions & 0 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static const t_config_enum_values s_keys_map_InfillPattern {
{ "monotonic", ipMonotonic },
{ "monotoniclines", ipMonotonicLines },
{ "alignedrectilinear", ipAlignedRectilinear },
{ "alignedmonotonic", ipAlignedMonotonic },
{ "grid", ipGrid },
{ "triangles", ipTriangles },
{ "stars", ipStars },
Expand Down Expand Up @@ -814,6 +815,7 @@ void PrintConfigDef::init_fff_params()
{ "monotonic", L("Monotonic") },
{ "monotoniclines", L("Monotonic Lines") },
{ "alignedrectilinear", L("Aligned Rectilinear") },
{ "alignedmonotonic", L("Aligned Monotonic") },
{ "concentric", L("Concentric") },
{ "hilbertcurve", L("Hilbert Curve") },
{ "archimedeanchords", L("Archimedean Chords") },
Expand Down Expand Up @@ -1225,6 +1227,8 @@ void PrintConfigDef::init_fff_params()
def->set_enum<InfillPattern>({
{ "rectilinear", L("Rectilinear") },
{ "alignedrectilinear", L("Aligned Rectilinear") },
{ "monotonic", L("Monotonic") },
{ "alignedmonotonic", L("Aligned Monotonic") },
{ "grid", L("Grid") },
{ "triangles", L("Triangles")},
{ "stars", L("Stars")},
Expand Down
6 changes: 3 additions & 3 deletions src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ enum class FuzzySkinType {
};

enum InfillPattern : int {
ipRectilinear, ipMonotonic, ipMonotonicLines, ipAlignedRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb,
ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipAdaptiveCubic, ipSupportCubic, ipSupportBase,
ipLightning,
ipRectilinear, ipMonotonic, ipMonotonicLines, ipAlignedRectilinear, ipAlignedMonotonic, ipGrid, ipTriangles, ipStars, ipCubic, ipLine,
ipConcentric, ipHoneycomb, ip3DHoneycomb, ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipAdaptiveCubic, ipSupportCubic,
ipSupportBase,ipLightning,
ipEnsuring,
ipCount,
};
Expand Down