~ubuntu-branches/ubuntu/wily/slic3r/wily-proposed

« back to all changes in this revision

Viewing changes to xs/src/Geometry.hpp

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2014-06-17 01:27:26 UTC
  • Revision ID: package-import@ubuntu.com-20140617012726-2wrs4zdo251nr4vg
Tags: upstream-1.1.4+dfsg
ImportĀ upstreamĀ versionĀ 1.1.4+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef slic3r_Geometry_hpp_
 
2
#define slic3r_Geometry_hpp_
 
3
 
 
4
#include "BoundingBox.hpp"
 
5
#include "Polygon.hpp"
 
6
#include "Polyline.hpp"
 
7
 
 
8
#include "boost/polygon/voronoi.hpp"
 
9
using boost::polygon::voronoi_builder;
 
10
using boost::polygon::voronoi_diagram;
 
11
 
 
12
namespace Slic3r { namespace Geometry {
 
13
 
 
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);
 
19
 
 
20
class MedialAxis {
 
21
    public:
 
22
    Points points;
 
23
    Lines lines;
 
24
    double max_width;
 
25
    double min_width;
 
26
    MedialAxis(double _max_width, double _min_width) : max_width(_max_width), min_width(_min_width) {};
 
27
    void build(Polylines* polylines);
 
28
    
 
29
    private:
 
30
    typedef voronoi_diagram<double> VD;
 
31
    VD 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;
 
37
};
 
38
 
 
39
} }
 
40
 
 
41
#endif