1
#ifndef slic3r_Geometry_hpp_
2
#define slic3r_Geometry_hpp_
4
#include "BoundingBox.hpp"
6
#include "Polyline.hpp"
8
#include "boost/polygon/voronoi.hpp"
9
using boost::polygon::voronoi_builder;
10
using boost::polygon::voronoi_diagram;
12
namespace Slic3r { namespace Geometry {
14
void convex_hull(Points &points, Polygon* hull);
15
void chained_path(Points &points, std::vector<Points::size_type> &retval, Point start_near);
16
void chained_path(Points &points, std::vector<Points::size_type> &retval);
17
template<class T> void chained_path_items(Points &points, T &items, T &retval);
18
bool directions_parallel(double angle1, double angle2, double max_diff = 0);
26
MedialAxis(double _max_width, double _min_width) : max_width(_max_width), min_width(_min_width) {};
27
void build(Polylines* polylines);
30
typedef voronoi_diagram<double> VD;
32
std::set<const VD::edge_type*> edges;
33
Line edge_to_line(const VD::edge_type &edge) const;
34
void process_edge_neighbors(const voronoi_diagram<double>::edge_type& edge, Points* points);
35
bool is_valid_edge(const voronoi_diagram<double>::edge_type& edge) const;
36
Line retrieve_segment(const voronoi_diagram<double>::cell_type& cell) const;