mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-25 07:37:37 +08:00
Revamp of implementation of the avoid crossing perimeters algorithm.
The strategy for the avoid crossing perimeters algorithm has been redesigned. But external travels (travel between objects or supports) have not been solved yet. For these travels is used a direct path between two points. Much of the code has been reworked, which leads to significant speedup compared to the previous implementation. Also, several potential bugs have been fixed.
This commit is contained in:
parent
606db666fc
commit
55c282d85d
File diff suppressed because it is too large
Load Diff
@ -32,6 +32,17 @@ public:
|
||||
|
||||
Polyline travel_to(const GCode& gcodegen, const Point& point, bool* could_be_wipe_disabled);
|
||||
|
||||
struct Boundary {
|
||||
// Collection of boundaries used for detection of crossing perimeters for travels
|
||||
Polygons boundaries;
|
||||
// Bounding box of boundaries
|
||||
BoundingBoxf bbox;
|
||||
// Precomputed distances of all points in boundaries
|
||||
std::vector<std::vector<float>> boundaries_params;
|
||||
// Used for detection of intersection between line and any polygon from boundaries
|
||||
EdgeGrid::Grid grid;
|
||||
};
|
||||
|
||||
private:
|
||||
bool m_use_external_mp { false };
|
||||
// just for the next travel move
|
||||
@ -40,18 +51,14 @@ private:
|
||||
// we enable it by default for the first travel move in print
|
||||
bool m_disabled_once { true };
|
||||
|
||||
// Slice of layer with elephant foot compensation
|
||||
ExPolygons m_slice;
|
||||
// Collection of boundaries used for detection of crossing perimetrs for travels inside object
|
||||
Polygons m_boundaries;
|
||||
// Collection of boundaries used for detection of crossing perimetrs for travels outside object
|
||||
Polygons m_boundaries_external;
|
||||
// Bounding box of m_boundaries
|
||||
BoundingBoxf m_bbox;
|
||||
// Bounding box of m_boundaries_external
|
||||
BoundingBoxf m_bbox_external;
|
||||
EdgeGrid::Grid m_grid;
|
||||
EdgeGrid::Grid m_grid_external;
|
||||
// Used for detection of line or polyline is inside of any polygon.
|
||||
EdgeGrid::Grid m_grid_lslice;
|
||||
// Store all needed data for travels inside object
|
||||
Boundary m_internal;
|
||||
#if 0
|
||||
// Store all needed data for travels outside object
|
||||
Boundary m_external;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace Slic3r
|
||||
|
@ -124,7 +124,7 @@ inline void append(std::vector<T>& dest, std::vector<T>&& src)
|
||||
if (dest.empty())
|
||||
dest = std::move(src);
|
||||
else {
|
||||
dest.resize(dest.size() + src.size());
|
||||
dest.reserve(dest.size() + src.size());
|
||||
std::move(std::begin(src), std::end(src), std::back_inserter(dest));
|
||||
}
|
||||
src.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user