Skip to content

Commit

Permalink
fix monotonic
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Dec 28, 2023
1 parent fce5146 commit b207034
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/libslic3r/Fill/FillBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,16 @@ void Fill::fill_surface_extrusion(const Surface *surface, const FillParams &para
good_role,
used_flow,
used_flow.scaled_width() / 8,
true);
!params.monotonic);
// compute the path of the nozzle -> extruded volume
for (const ExtrusionEntity* entity : entities) {
extruded_volume += entity->total_volume();
}
//append (move so the pointers are reused, and won't need to be deleted)
all_new_paths->append(std::move(entities));
}
if(params.monotonic)
all_new_paths->set_can_sort_reverse(false, false);
thick_polylines.clear();


Expand Down Expand Up @@ -305,7 +307,8 @@ void Fill::fill_surface_extrusion(const Surface *surface, const FillParams &para
good_role,
params.flow.mm3_per_mm()* params.flow_mult * mult_flow,
(float)(params.flow.width()* params.flow_mult * mult_flow),
(float)params.flow.height());
(float)params.flow.height(),
!params.monotonic);
}
} catch (InfillFailedException&) {
}
Expand Down
3 changes: 2 additions & 1 deletion src/libslic3r/Fill/FillRectilinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3532,7 +3532,8 @@ FillRectilinearWGapFill::fill_surface_extrusion(const Surface *surface, const Fi
good_role,
params.flow.mm3_per_mm() * params.flow_mult * flow_mult_exact_volume,
params.flow.width() * params.flow_mult * float(flow_mult_exact_volume),
params.flow.height());
params.flow.height(),
!is_monotonic());

coll_nosort->append(ExtrusionEntitiesPtr{ eec });

Expand Down
6 changes: 6 additions & 0 deletions src/libslic3r/Fill/FillRectilinear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ class FillMonotonic : public FillRectilinear
public:
Fill* clone() const override { return new FillMonotonic(*this); }
~FillMonotonic() override = default;
//apply monotonic
void fill_surface_extrusion(const Surface *surface, const FillParams &params, ExtrusionEntitiesPtr &out) const override {
FillParams monotonic_params = params;
monotonic_params.monotonic = true;
FillRectilinear::fill_surface_extrusion(surface, monotonic_params, out);
}
Polylines fill_surface(const Surface* surface, const FillParams& params) const override;
bool no_sort() const override { return true; }
};
Expand Down

0 comments on commit b207034

Please sign in to comment.