2019-08-21 12:52:22 +00:00
|
|
|
#ifndef slic3r_PolygonTrimmer_hpp_
|
|
|
|
#define slic3r_PolygonTrimmer_hpp_
|
|
|
|
|
|
|
|
#include "libslic3r.h"
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include "Line.hpp"
|
|
|
|
#include "MultiPoint.hpp"
|
|
|
|
#include "Polyline.hpp"
|
2019-08-22 09:35:25 +00:00
|
|
|
#include "Polygon.hpp"
|
2019-08-21 12:52:22 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
namespace EdgeGrid {
|
|
|
|
class Grid;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TrimmedLoop
|
|
|
|
{
|
|
|
|
std::vector<Point> points;
|
|
|
|
// Number of points per segment. Empty if the loop is
|
|
|
|
std::vector<unsigned int> segments;
|
|
|
|
|
|
|
|
bool is_trimmed() const { return ! segments.empty(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
TrimmedLoop trim_loop(const Polygon &loop, const EdgeGrid::Grid &grid);
|
|
|
|
std::vector<TrimmedLoop> trim_loops(const Polygons &loops, const EdgeGrid::Grid &grid);
|
|
|
|
|
|
|
|
} // namespace Slic3r
|
|
|
|
|
|
|
|
#endif /* slic3r_PolygonTrimmer_hpp_ */
|