diff options
author | bubnikv <bubnikv@gmail.com> | 2016-09-13 14:30:00 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2016-09-13 14:30:00 +0300 |
commit | 620c6c7378c4799980f63794669548c104b9bcea (patch) | |
tree | fc7aea3342539018bb19d27abd1144956eb00b4d /xs/src/libslic3r/Polygon.hpp | |
parent | a5b7f14dfa291039fd6971a356efd011fab84440 (diff) |
Ported from the playground branch. Various documentation and optimization.
Diffstat (limited to 'xs/src/libslic3r/Polygon.hpp')
-rw-r--r-- | xs/src/libslic3r/Polygon.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xs/src/libslic3r/Polygon.hpp b/xs/src/libslic3r/Polygon.hpp index ccde4a740..9f0bc6028 100644 --- a/xs/src/libslic3r/Polygon.hpp +++ b/xs/src/libslic3r/Polygon.hpp @@ -25,7 +25,9 @@ class Polygon : public MultiPoint { Point last_point() const; virtual Lines lines() const; Polyline split_at_vertex(const Point &point) const; + // Split a closed polygon into an open polyline, with the split point duplicated at both ends. Polyline split_at_index(int index) const; + // Split a closed polygon into an open polyline, with the split point duplicated at both ends. Polyline split_at_first_point() const; Points equally_spaced_points(double distance) const; double area() const; @@ -34,6 +36,8 @@ class Polygon : public MultiPoint { bool make_counter_clockwise(); bool make_clockwise(); bool is_valid() const; + // Does an unoriented polygon contain a point? + // Tested by counting intersections along a horizontal line. bool contains(const Point &point) const; Polygons simplify(double tolerance) const; void simplify(double tolerance, Polygons &polygons) const; @@ -44,6 +48,9 @@ class Polygon : public MultiPoint { Points convex_points(double angle = PI) const; }; +extern BoundingBox get_extents(const Polygon &poly); +extern BoundingBox get_extents(const Polygons &polygons); + } // start Boost |