1
#ifndef slic3r_Line_hpp_
2
#define slic3r_Line_hpp_
18
explicit Line(Point _a, Point _b): a(_a), b(_b) {};
19
std::string wkt() const;
20
operator Polyline() const;
21
void scale(double factor);
22
void translate(double x, double y);
23
void rotate(double angle, const Point ¢er);
25
double length() const;
26
Point* midpoint() const;
27
void point_at(double distance, Point* point) const;
28
Point point_at(double distance) const;
29
bool coincides_with(const Line &line) const;
30
double distance_to(const Point &point) const;
31
bool parallel_to(double angle) const;
32
bool parallel_to(const Line &line) const;
33
double atan2_() const;
34
double direction() const;
35
Vector vector() const;
38
void from_SV(SV* line_sv);
39
void from_SV_check(SV* line_sv);
41
SV* to_SV_pureperl() const;
45
typedef std::vector<Line> Lines;
50
#include <boost/polygon/polygon.hpp>
51
namespace boost { namespace polygon {
53
struct geometry_concept<Line> { typedef segment_concept type; };
56
struct segment_traits<Line> {
57
typedef coord_t coordinate_type;
58
typedef Point point_type;
60
static inline point_type get(const Line& line, direction_1d dir) {
61
return dir.to_int() ? line.b : line.a;