forked from pcb2gcode/pcb2gcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsegmentize.hpp
More file actions
27 lines (21 loc) · 889 Bytes
/
segmentize.hpp
File metadata and controls
27 lines (21 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef SEGMENTIZE_H
#define SEGMENTIZE_H
#include <vector>
#include <map>
#include "geometry.hpp"
#include <boost/polygon/isotropy.hpp>
#include <boost/polygon/segment_concept.hpp>
#include <boost/polygon/segment_utils.hpp>
namespace segmentize {
// Return a vector of unique linestrings. Each input linestring must have just 2 points.
std::vector<std::pair<linestring_type_fp, bool>> unique(
const std::vector<std::pair<linestring_type_fp, bool>>& lss);
/* Convert each linestring, which might have multiple points in it,
* into a linestrings that have just two points, the start and the
* end. Directionality is maintained on each one along with whether
* or not it is reversible.
*/
std::vector<std::pair<linestring_type_fp, bool>> segmentize_paths(
const std::vector<std::pair<linestring_type_fp, bool>>& toolpaths);
} //namespace segmentize
#endif //SEGMENTIZE_H