mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 05:35:59 +08:00
Add missing includes
This commit is contained in:
parent
3db66af716
commit
9936b8e34e
@ -12,6 +12,11 @@
|
|||||||
#include "AvoidCrossingPerimeters.hpp"
|
#include "AvoidCrossingPerimeters.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <numeric>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
|
#include <tbb/parallel_for.h>
|
||||||
|
#include <boost/log/trivial.hpp>
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
@ -457,7 +462,7 @@ Polyline AvoidCrossingPerimeters2::simplify_travel(const EdgeGrid::Grid &edge_gr
|
|||||||
|
|
||||||
visitor.pt_current = ¤t_point;
|
visitor.pt_current = ¤t_point;
|
||||||
|
|
||||||
for (size_t point_idx_2 = point_idx + 1; point_idx_2 < travel.size(); point_idx_2++) {
|
for (size_t point_idx_2 = point_idx + 1; point_idx_2 < travel.size(); ++point_idx_2) {
|
||||||
if (travel.points[point_idx_2] == current_point) {
|
if (travel.points[point_idx_2] == current_point) {
|
||||||
next = travel.points[point_idx_2];
|
next = travel.points[point_idx_2];
|
||||||
point_idx = point_idx_2;
|
point_idx = point_idx_2;
|
||||||
@ -610,7 +615,7 @@ size_t AvoidCrossingPerimeters2::avoid_perimeters(const Polygons &boundari
|
|||||||
return intersections.size();
|
return intersections.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AvoidCrossingPerimeters2::needs_wipe(const GCode & gcodegen,
|
bool AvoidCrossingPerimeters2::need_wipe(const GCode & gcodegen,
|
||||||
const Line & original_travel,
|
const Line & original_travel,
|
||||||
const Polyline &result_travel,
|
const Polyline &result_travel,
|
||||||
const size_t intersection_count)
|
const size_t intersection_count)
|
||||||
@ -625,7 +630,8 @@ bool AvoidCrossingPerimeters2::needs_wipe(const GCode & gcodegen,
|
|||||||
// If the z-lift is enabled, then a wipe is needed when the original travel leads above the holes.
|
// If the z-lift is enabled, then a wipe is needed when the original travel leads above the holes.
|
||||||
if (z_lift_enabled) {
|
if (z_lift_enabled) {
|
||||||
if (any_expolygon_contains(m_slice, original_travel)) {
|
if (any_expolygon_contains(m_slice, original_travel)) {
|
||||||
// Check if original_travel and are not same result_travel
|
// Check if original_travel and result_travel are not same.
|
||||||
|
// If both are the same, then it is possible to skip testing of result_travel
|
||||||
if (result_travel.size() == 2 && result_travel.first_point() == original_travel.a && result_travel.last_point() == original_travel.b) {
|
if (result_travel.size() == 2 && result_travel.first_point() == original_travel.a && result_travel.last_point() == original_travel.b) {
|
||||||
wipe_needed = false;
|
wipe_needed = false;
|
||||||
} else {
|
} else {
|
||||||
@ -676,7 +682,7 @@ Polyline AvoidCrossingPerimeters2::travel_to(const GCode &gcodegen, const Point
|
|||||||
result.translate(-scaled_origin);
|
result.translate(-scaled_origin);
|
||||||
*could_be_wipe_disabled = false;
|
*could_be_wipe_disabled = false;
|
||||||
} else
|
} else
|
||||||
*could_be_wipe_disabled = !needs_wipe(gcodegen, travel, result, travel_intersection_count);
|
*could_be_wipe_disabled = !need_wipe(gcodegen, travel, result, travel_intersection_count);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ private:
|
|||||||
|
|
||||||
static size_t avoid_perimeters(const Polygons &boundaries, const EdgeGrid::Grid &grid, const Point &start, const Point &end, Polyline *result_out);
|
static size_t avoid_perimeters(const Polygons &boundaries, const EdgeGrid::Grid &grid, const Point &start, const Point &end, Polyline *result_out);
|
||||||
|
|
||||||
bool needs_wipe(const GCode &gcodegen, const Line &original_travel, const Polyline &result_travel, const size_t intersection_count);
|
bool need_wipe(const GCode &gcodegen, const Line &original_travel, const Polyline &result_travel, const size_t intersection_count);
|
||||||
|
|
||||||
// Slice of layer with elephant foot compensation
|
// Slice of layer with elephant foot compensation
|
||||||
ExPolygons m_slice;
|
ExPolygons m_slice;
|
||||||
@ -120,7 +120,7 @@ public:
|
|||||||
return this->travel_to(gcodegen, point, &could_be_wipe_disabled);
|
return this->travel_to(gcodegen, point, &could_be_wipe_disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Polyline travel_to(const GCode &gcodegen, const Point &point, bool *needs_wipe) override;
|
virtual Polyline travel_to(const GCode &gcodegen, const Point &point, bool *could_be_wipe_disabled) override;
|
||||||
|
|
||||||
void init_layer(const Layer &layer);
|
void init_layer(const Layer &layer);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user