mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-10-22 10:21:07 +08:00

New step - estimation of curling on both the model and the support extrusions. Improvements in curled filament estimation algortihm Implementation of Jump Point Search algorithm Use of JPS algorithm to avoid curled extrusions during travel moves in Gcode export
37 lines
989 B
C++
37 lines
989 B
C++
#ifndef SRC_LIBSLIC3R_JUMPPOINTSEARCH_HPP_
|
|
#define SRC_LIBSLIC3R_JUMPPOINTSEARCH_HPP_
|
|
|
|
#include "BoundingBox.hpp"
|
|
#include "libslic3r/Layer.hpp"
|
|
#include "libslic3r/Point.hpp"
|
|
#include "libslic3r/Polyline.hpp"
|
|
#include "libslic3r/libslic3r.h"
|
|
#include <unordered_map>
|
|
#include <unordered_set>
|
|
|
|
namespace Slic3r {
|
|
|
|
class JPSPathFinder
|
|
{
|
|
using Pixel = Point;
|
|
std::unordered_set<Pixel, PointHash> inpassable;
|
|
coordf_t print_z;
|
|
Pixel obstacle_min;
|
|
Pixel obstacle_max;
|
|
|
|
const coord_t resolution = scaled(1.5);
|
|
Pixel pixelize(const Point &p) { return p / resolution; }
|
|
Point unpixelize(const Pixel &p) { return p * resolution; }
|
|
|
|
public:
|
|
JPSPathFinder() { clear(); };
|
|
void clear();
|
|
void add_obstacles(const Lines &obstacles);
|
|
void add_obstacles(const Layer* layer, const Point& global_origin);
|
|
Polyline find_path(const Point &start, const Point &end);
|
|
};
|
|
|
|
} // namespace Slic3r
|
|
|
|
#endif /* SRC_LIBSLIC3R_JUMPPOINTSEARCH_HPP_ */
|