Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::Polygon Class Reference

#include <src/libslic3r/Polygon.hpp>

+ Inheritance diagram for Slic3r::Polygon:
+ Collaboration diagram for Slic3r::Polygon:

Public Types

using iterator = Points::iterator
 
using const_iterator = Points::const_iterator
 

Public Member Functions

 Polygon ()=default
 
 Polygon (const Points &points)
 
 Polygon (std::initializer_list< Point > points)
 
 Polygon (const Polygon &other)
 
 Polygon (Polygon &&other)
 
Polygonoperator= (const Polygon &other)
 
Polygonoperator= (Polygon &&other)
 
Pointoperator[] (Points::size_type idx)
 
const Pointoperator[] (Points::size_type idx) const
 
const Pointlast_point () const
 
double length () const
 
Lines lines () const
 
Polyline split_at_vertex (const Point &point) const
 
Polyline split_at_index (int index) const
 
Polyline split_at_first_point () const
 
Points equally_spaced_points (double distance) const
 
double area () const
 
bool is_counter_clockwise () const
 
bool is_clockwise () const
 
bool make_counter_clockwise ()
 
bool make_clockwise ()
 
bool is_valid () const
 
void douglas_peucker (double tolerance)
 
bool contains (const Point &point) const
 
bool on_boundary (const Point &point, double eps) const
 
Polygons simplify (double tolerance) const
 
void densify (float min_length, std::vector< float > *lengths=nullptr)
 
void triangulate_convex (Polygons *polygons) const
 
Point centroid () const
 
bool intersection (const Line &line, Point *intersection) const
 
bool first_intersection (const Line &line, Point *intersection) const
 
bool intersections (const Line &line, Points *intersections) const
 
Points convex_points (double angle_threshold=0.) const
 
Points concave_points (double angle_threshold=0.) const
 
Point point_projection (const Point &point) const
 
std::vector< float > parameter_by_length () const
 
void scale (double factor)
 
void scale (double factor_x, double factor_y)
 
void translate (double x, double y)
 
void translate (const Point &vector)
 
void rotate (double angle)
 
void rotate (double cos_angle, double sin_angle)
 
void rotate (double angle, const Point &center)
 
void reverse ()
 
const Pointfront () const
 
const Pointback () const
 
const Pointfirst_point () const
 
size_t size () const
 
bool empty () const
 
int find_point (const Point &point) const
 
int find_point (const Point &point, const double scaled_epsilon) const
 
int closest_point_index (const Point &point) const
 
const Pointclosest_point (const Point &point) const
 
BoundingBox bounding_box () const
 
bool has_duplicate_points () const
 
bool remove_duplicate_points ()
 
void clear ()
 
void append (const Point &point)
 
void append (const Points &src)
 
void append (const Points::const_iterator &begin, const Points::const_iterator &end)
 
void append (Points &&src)
 
auto begin ()
 
auto begin () const
 
auto end ()
 
auto end () const
 
auto cbegin () const
 
auto cend () const
 

Static Public Member Functions

static Polygon new_scale (const std::vector< Vec2d > &points)
 
static double area (const Points &pts)
 
static Points douglas_peucker (const Points &points, const double tolerance)
 
static Points visivalingam (const Points &pts, const double &tolerance)
 

Public Attributes

Points points
 

Detailed Description

Member Typedef Documentation

◆ const_iterator

using Slic3r::Polygon::const_iterator = Points::const_iterator

◆ iterator

using Slic3r::Polygon::iterator = Points::iterator

Constructor & Destructor Documentation

◆ Polygon() [1/5]

Slic3r::Polygon::Polygon ( )
default

◆ Polygon() [2/5]

Slic3r::Polygon::Polygon ( const Points points)
inlineexplicit
MultiPoint()=default
Points points
Definition MultiPoint.hpp:18

◆ Polygon() [3/5]

Slic3r::Polygon::Polygon ( std::initializer_list< Point points)
inline

◆ Polygon() [4/5]

Slic3r::Polygon::Polygon ( const Polygon other)
inline
29: MultiPoint(other.points) {}

◆ Polygon() [5/5]

Slic3r::Polygon::Polygon ( Polygon &&  other)
inline
30: MultiPoint(std::move(other.points)) {}

Member Function Documentation

◆ append() [1/4]

void Slic3r::MultiPoint::append ( const Point point)
inlineinherited
71{ this->points.push_back(point); }

◆ append() [2/4]

void Slic3r::MultiPoint::append ( const Points src)
inlineinherited
72{ this->append(src.begin(), src.end()); }
void append(const Point &point)
Definition MultiPoint.hpp:71

References Slic3r::MultiPoint::append().

Referenced by Slic3r::MultiPoint::append().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ append() [3/4]

void Slic3r::MultiPoint::append ( const Points::const_iterator &  begin,
const Points::const_iterator &  end 
)
inlineinherited
73{ this->points.insert(this->points.end(), begin, end); }
auto begin()
Definition MultiPoint.hpp:87
auto end()
Definition MultiPoint.hpp:89

References Slic3r::MultiPoint::begin(), and Slic3r::MultiPoint::end().

+ Here is the call graph for this function:

◆ append() [4/4]

void Slic3r::MultiPoint::append ( Points &&  src)
inlineinherited
75 {
76 if (this->points.empty()) {
77 this->points = std::move(src);
78 } else {
79 this->points.insert(this->points.end(), src.begin(), src.end());
80 src.clear();
81 }
82 }

◆ area() [1/2]

double Slic3r::Polygon::area ( ) const
64{
65 return Polygon::area(points);
66}
double area() const
Definition Polygon.cpp:63

References area(), and Slic3r::MultiPoint::points.

Referenced by area(), and Slic3r::arrangement::poly_area().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ area() [2/2]

double Slic3r::Polygon::area ( const Points pts)
static
50{
51 double a = 0.;
52 if (points.size() >= 3) {
53 Vec2d p1 = points.back().cast<double>();
54 for (const Point &p : points) {
55 Vec2d p2 = p.cast<double>();
56 a += cross2(p1, p2);
57 p1 = p2;
58 }
59 }
60 return 0.5 * a;
61}
Derived::Scalar cross2(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:93
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:51
Kernel::Point_2 Point
Definition point_areas.cpp:20

References Slic3r::cross2(), and Slic3r::MultiPoint::points.

Referenced by Slic3r::BuildVolume::BuildVolume(), Slic3r::ExPolygon::area(), Slic3r::area(), Slic3r::SupportMaterialInternal::collect_bridging_perimeter_areas(), Slic3r::sla::anonymous_namespace{Rotfinder.cpp}::get_chull_rotations(), Slic3r::make_expolygons_simple(), Slic3r::GUI::FillBedJob::prepare(), and triangulate_convex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ back()

◆ begin() [1/2]

auto Slic3r::MultiPoint::begin ( )
inlineinherited
87{ return points.begin(); }

References Slic3r::MultiPoint::points.

Referenced by Slic3r::MultiPoint::append(), Slic3r::contour_distance(), Slic3r::contour_distance(), Slic3r::contour_distance2(), Slic3r::EdgeGrid::Grid::create_from_m_contours(), and Slic3r::GUI::Selection::scale_to_fit_print_volume().

+ Here is the caller graph for this function:

◆ begin() [2/2]

auto Slic3r::MultiPoint::begin ( ) const
inlineinherited
88{ return points.begin(); }

References Slic3r::MultiPoint::points.

◆ bounding_box()

◆ cbegin()

auto Slic3r::MultiPoint::cbegin ( ) const
inlineinherited
91{ return points.begin(); }

References Slic3r::MultiPoint::points.

◆ cend()

auto Slic3r::MultiPoint::cend ( ) const
inlineinherited
92{ return points.end(); }

References Slic3r::MultiPoint::points.

◆ centroid()

Point Slic3r::Polygon::centroid ( ) const
139{
140 double area_sum = 0.;
141 Vec2d c(0., 0.);
142 if (points.size() >= 3) {
143 Vec2d p1 = points.back().cast<double>();
144 for (const Point &p : points) {
145 Vec2d p2 = p.cast<double>();
146 double a = cross2(p1, p2);
147 area_sum += a;
148 c += (p1 + p2) * a;
149 p1 = p2;
150 }
151 }
152 return Point(Vec2d(c / (3. * area_sum)));
153}

References Slic3r::cross2(), and Slic3r::MultiPoint::points.

Referenced by Slic3r::sla::ConcaveHull::centroid(), priv::find_closest_volume(), Slic3r::GUI::Emboss::CreateObjectJob::process(), and Slic3r::GUI::MeshClipper::recalculate_triangles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

void Slic3r::MultiPoint::clear ( )
inlineinherited

◆ closest_point()

const Point * Slic3r::MultiPoint::closest_point ( const Point point) const
inlineinherited
64{ return this->points.empty() ? nullptr : &this->points[this->closest_point_index(point)]; }
int closest_point_index(const Point &point) const
Definition MultiPoint.hpp:49

References Slic3r::MultiPoint::closest_point_index().

+ Here is the call graph for this function:

◆ closest_point_index()

int Slic3r::MultiPoint::closest_point_index ( const Point point) const
inlineinherited
49 {
50 int idx = -1;
51 if (! this->points.empty()) {
52 idx = 0;
53 double dist_min = (point - this->points.front()).cast<double>().norm();
54 for (int i = 1; i < int(this->points.size()); ++ i) {
55 double d = (this->points[i] - point).cast<double>().norm();
56 if (d < dist_min) {
57 dist_min = d;
58 idx = i;
59 }
60 }
61 }
62 return idx;
63 }

Referenced by Slic3r::MultiPoint::closest_point(), and Slic3r::WipeTower::finish_layer().

+ Here is the caller graph for this function:

◆ concave_points()

Points Slic3r::Polygon::concave_points ( double  angle_threshold = 0.) const
261{
262 return filter_convex_concave_points_by_angle_threshold(this->points, angle_threshold, [](const Vec2d &v1, const Vec2d &v2){ return cross2(v1, v2) < 0.; });
263}
Points filter_convex_concave_points_by_angle_threshold(const Points &poly, double angle_threshold, ConvexConcaveFilterFn convex_concave_filter)
Definition Polygon.cpp:240

References Slic3r::cross2(), Slic3r::filter_convex_concave_points_by_angle_threshold(), and Slic3r::MultiPoint::points.

+ Here is the call graph for this function:

◆ contains()

bool Slic3r::Polygon::contains ( const Point point) const
inline
66{ return Slic3r::contains(*this, point, true); }
bool contains(const ContainerType &c, const ValueType &v)
Definition libslic3r.h:247

References Slic3r::contains().

Referenced by Slic3r::GUI::Bed3D::contains(), Slic3r::GUI::Emboss::CreateObjectJob::process(), Slic3r::PerimeterGenerator::process_classic(), and Slic3r::Arachne::removeSmallAreas().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convex_points()

Points Slic3r::Polygon::convex_points ( double  angle_threshold = 0.) const
256{
257 return filter_convex_concave_points_by_angle_threshold(this->points, angle_threshold, [](const Vec2d &v1, const Vec2d &v2){ return cross2(v1, v2) > 0.; });
258}

References Slic3r::cross2(), Slic3r::filter_convex_concave_points_by_angle_threshold(), and Slic3r::MultiPoint::points.

+ Here is the call graph for this function:

◆ densify()

void Slic3r::Polygon::densify ( float  min_length,
std::vector< float > *  lengths = nullptr 
)
314{
315 std::vector<float> lengths_local;
316 std::vector<float>& lengths = lengths_ptr ? *lengths_ptr : lengths_local;
317
318 if (! lengths_ptr) {
319 // Length parametrization has not been provided. Calculate our own.
320 lengths = this->parameter_by_length();
321 }
322
323 assert(points.size() == lengths.size() - 1);
324
325 for (size_t j=1; j<=points.size(); ++j) {
326 bool last = j == points.size();
327 int i = last ? 0 : j;
328
329 if (lengths[j] - lengths[j-1] > min_length) {
330 Point diff = points[i] - points[j-1];
331 float diff_len = lengths[j] - lengths[j-1];
332 float r = (min_length/diff_len);
333 Point new_pt = points[j-1] + Point(r*diff[0], r*diff[1]);
334 points.insert(points.begin() + j, new_pt);
335 lengths.insert(lengths.begin() + j, lengths[j-1] + min_length);
336 }
337 }
338 assert(points.size() == lengths.size() - 1);
339}
std::vector< float > parameter_by_length() const
Definition Polygon.cpp:303
Slic3r::Polygons diff(const Slic3r::Polygon &subject, const Slic3r::Polygon &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:672

References Slic3r::diff(), parameter_by_length(), and Slic3r::MultiPoint::points.

+ Here is the call graph for this function:

◆ douglas_peucker() [1/2]

Points Slic3r::MultiPoint::douglas_peucker ( const Points points,
const double  tolerance 
)
staticinherited
107{
108 Points result_pts;
109 auto tolerance_sq = int64_t(sqr(tolerance));
110 if (! pts.empty()) {
111 const Point *anchor = &pts.front();
112 size_t anchor_idx = 0;
113 const Point *floater = &pts.back();
114 size_t floater_idx = pts.size() - 1;
115 result_pts.reserve(pts.size());
116 result_pts.emplace_back(*anchor);
117 if (anchor_idx != floater_idx) {
118 assert(pts.size() > 1);
119 std::vector<size_t> dpStack;
120 dpStack.reserve(pts.size());
121 dpStack.emplace_back(floater_idx);
122 for (;;) {
123 int64_t max_dist_sq = 0;
124 size_t furthest_idx = anchor_idx;
125 // find point furthest from line seg created by (anchor, floater) and note it
126 {
127 const Point a = *anchor;
128 const Point f = *floater;
129 const Vec2i64 v = (f - a).cast<int64_t>();
130 if (const int64_t l2 = v.squaredNorm(); l2 == 0) {
131 for (size_t i = anchor_idx + 1; i < floater_idx; ++ i)
132 if (int64_t dist_sq = (pts[i] - a).cast<int64_t>().squaredNorm(); dist_sq > max_dist_sq) {
133 max_dist_sq = dist_sq;
134 furthest_idx = i;
135 }
136 } else {
137 const double dl2 = double(l2);
138 const Vec2d dv = v.cast<double>();
139 for (size_t i = anchor_idx + 1; i < floater_idx; ++ i) {
140 const Point p = pts[i];
141 const Vec2i64 va = (p - a).template cast<int64_t>();
142 const int64_t t = va.dot(v);
143 int64_t dist_sq;
144 if (t <= 0) {
145 dist_sq = va.squaredNorm();
146 } else if (t >= l2) {
147 dist_sq = (p - f).cast<int64_t>().squaredNorm();
148 } else {
149 const Vec2i64 w = ((double(t) / dl2) * dv).cast<int64_t>();
150 dist_sq = (w - va).squaredNorm();
151 }
152 if (dist_sq > max_dist_sq) {
153 max_dist_sq = dist_sq;
154 furthest_idx = i;
155 }
156 }
157 }
158 }
159 // remove point if less than tolerance
160 if (max_dist_sq <= tolerance_sq) {
161 result_pts.emplace_back(*floater);
162 anchor_idx = floater_idx;
163 anchor = floater;
164 assert(dpStack.back() == floater_idx);
165 dpStack.pop_back();
166 if (dpStack.empty())
167 break;
168 floater_idx = dpStack.back();
169 } else {
170 floater_idx = furthest_idx;
171 dpStack.emplace_back(floater_idx);
172 }
173 floater = &pts[floater_idx];
174 }
175 }
176 assert(result_pts.front() == pts.front());
177 assert(result_pts.back() == pts.back());
178
179#if 0
180 {
181 static int iRun = 0;
182 BoundingBox bbox(pts);
183 BoundingBox bbox2(result_pts);
184 bbox.merge(bbox2);
185 SVG svg(debug_out_path("douglas_peucker_%d.svg", iRun ++).c_str(), bbox);
186 if (pts.front() == pts.back())
187 svg.draw(Polygon(pts), "black");
188 else
189 svg.draw(Polyline(pts), "black");
190 if (result_pts.front() == result_pts.back())
191 svg.draw(Polygon(result_pts), "green", scale_(0.1));
192 else
193 svg.draw(Polyline(result_pts), "green", scale_(0.1));
194 }
195#endif
196 }
197 return result_pts;
198}
#define scale_(val)
Definition libslic3r.h:69
std::string debug_out_path(const char *name,...)
Definition utils.cpp:218
T l2(const boost::geometry::model::d2::point_xy< T > &v)
Definition ExtrusionSimulator.cpp:166
Eigen::Matrix< int64_t, 2, 1, Eigen::DontAlign > Vec2i64
Definition Point.hpp:43
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:12
constexpr T sqr(T x)
Definition libslic3r.h:258
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:58
Slic3r::Polygon Polygon
Definition Emboss.cpp:34
__int64 int64_t
Definition unistd.h:76

References Slic3r::debug_out_path(), Slic3r::SVG::draw(), Slic3r::f(), Slic3r::l2(), Slic3r::BoundingBoxBase< PointType, APointsType >::merge(), scale_, and Slic3r::sqr().

Referenced by douglas_peucker(), Slic3r::Polyline::simplify(), simplify(), Slic3r::ExPolygon::simplify_p(), Slic3r::simplify_polygon_impl(), and Slic3r::Geometry::simplify_polygons().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ douglas_peucker() [2/2]

void Slic3r::Polygon::douglas_peucker ( double  tolerance)
97{
98 this->points.push_back(this->points.front());
99 Points p = MultiPoint::douglas_peucker(this->points, tolerance);
100 p.pop_back();
101 this->points = std::move(p);
102}
static Points douglas_peucker(const Points &points, const double tolerance)
Definition MultiPoint.cpp:106

References Slic3r::MultiPoint::douglas_peucker(), and Slic3r::MultiPoint::points.

Referenced by Slic3r::ExPolygon::douglas_peucker().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ empty()

◆ end() [1/2]

auto Slic3r::MultiPoint::end ( )
inlineinherited
89{ return points.end(); }

References Slic3r::MultiPoint::points.

Referenced by Slic3r::MultiPoint::append(), Slic3r::Polyline::append(), Slic3r::contour_distance(), Slic3r::contour_distance(), Slic3r::contour_distance2(), Slic3r::EdgeGrid::Grid::create_from_m_contours(), and Slic3r::GUI::Selection::scale_to_fit_print_volume().

+ Here is the caller graph for this function:

◆ end() [2/2]

auto Slic3r::MultiPoint::end ( ) const
inlineinherited
90{ return points.end(); }

References Slic3r::MultiPoint::points.

◆ equally_spaced_points()

Points Slic3r::Polygon::equally_spaced_points ( double  distance) const
inline
54{ return this->split_at_first_point().equally_spaced_points(distance); }
Polyline split_at_first_point() const
Definition Polygon.hpp:53
Points equally_spaced_points(double distance) const
Definition Polyline.cpp:85

References Slic3r::Polyline::equally_spaced_points(), and split_at_first_point().

Referenced by Slic3r::sla::sample_expolygon_boundary().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_point() [1/2]

int Slic3r::MultiPoint::find_point ( const Point point) const
inherited
49{
50 for (const Point &pt : this->points)
51 if (pt == point)
52 return int(&pt - &this->points.front());
53 return -1; // not found
54}
const Point & front() const
Definition MultiPoint.hpp:36
if(!(yy_init))
Definition lexer.c:1190

References Slic3r::MultiPoint::points.

Referenced by Slic3r::MultiPoint::find_point().

+ Here is the caller graph for this function:

◆ find_point() [2/2]

int Slic3r::MultiPoint::find_point ( const Point point,
const double  scaled_epsilon 
) const
inherited
57{
58 if (scaled_epsilon == 0)
59 return this->find_point(point);
60
61 auto dist2_min = std::numeric_limits<double>::max();
62 auto eps2 = scaled_epsilon * scaled_epsilon;
63 int idx_min = -1;
64 for (const Point &pt : this->points) {
65 double d2 = (pt - point).cast<double>().squaredNorm();
66 if (d2 < dist2_min) {
67 idx_min = int(&pt - &this->points.front());
68 dist2_min = d2;
69 }
70 }
71 return dist2_min < eps2 ? idx_min : -1;
72}
int find_point(const Point &point) const
Definition MultiPoint.cpp:48

References Slic3r::MultiPoint::find_point(), and Slic3r::MultiPoint::points.

+ Here is the call graph for this function:

◆ first_intersection()

bool Slic3r::Polygon::first_intersection ( const Line line,
Point intersection 
) const
168{
169 if (this->points.size() < 2)
170 return false;
171
172 bool found = false;
173 double dmin = 0.;
174 Line l(this->points.back(), this->points.front());
175 for (size_t i = 0; i < this->points.size(); ++ i) {
176 l.b = this->points[i];
177 Point ip;
178 if (l.intersection(line, &ip)) {
179 if (! found) {
180 found = true;
181 dmin = (line.a - ip).cast<double>().squaredNorm();
182 *intersection = ip;
183 } else {
184 double d = (line.a - ip).cast<double>().squaredNorm();
185 if (d < dmin) {
186 dmin = d;
187 *intersection = ip;
188 }
189 }
190 }
191 l.a = l.b;
192 }
193 return found;
194}
double BLASFUNC() dmin(int *, double *, int *)
bool intersection(const Line &line, Point *intersection) const
Definition Polygon.cpp:155

References Slic3r::Line::a, Slic3r::Line::b, dmin(), Slic3r::Line::intersection(), intersection(), and Slic3r::MultiPoint::points.

+ Here is the call graph for this function:

◆ first_point()

const Point & Slic3r::MultiPoint::first_point ( ) const
inlineinherited
38{ return this->front(); }

References Slic3r::MultiPoint::front().

Referenced by Slic3r::connect_brim_lines(), Slic3r::Polyline::equally_spaced_points(), Slic3r::FFFSupport::LoopInterfaceProcessor::generate(), Slic3r::improve_ordering_by_two_exchanges_with_segment_flipping(), Slic3r::Polyline::is_straight(), Slic3r::need_wipe(), Slic3r::optimize_polylines_by_reversing(), and Slic3r::reconnect_polylines().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ front()

◆ has_duplicate_points()

bool Slic3r::MultiPoint::has_duplicate_points ( ) const
inherited
80{
81 for (size_t i = 1; i < points.size(); ++i)
82 if (points[i-1] == points[i])
83 return true;
84 return false;
85}

References Slic3r::MultiPoint::points.

Referenced by Slic3r::polylines_from_paths(), and Slic3r::traverse_graph_generate_polylines().

+ Here is the caller graph for this function:

◆ intersection()

bool Slic3r::Polygon::intersection ( const Line line,
Point intersection 
) const
156{
157 if (this->points.size() < 2)
158 return false;
159 if (Line(this->points.front(), this->points.back()).intersection(line, intersection))
160 return true;
161 for (size_t i = 1; i < this->points.size(); ++ i)
162 if (Line(this->points[i - 1], this->points[i]).intersection(line, intersection))
163 return true;
164 return false;
165}

References Slic3r::Line::intersection(), intersection(), and Slic3r::MultiPoint::points.

Referenced by first_intersection(), intersection(), intersections(), and Slic3r::ExPolygon::medial_axis().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intersections()

bool Slic3r::Polygon::intersections ( const Line line,
Points intersections 
) const
197{
198 if (this->points.size() < 2)
199 return false;
200
201 size_t intersections_size = intersections->size();
202 Line l(this->points.back(), this->points.front());
203 for (size_t i = 0; i < this->points.size(); ++ i) {
204 l.b = this->points[i];
206 if (l.intersection(line, &intersection))
207 intersections->emplace_back(std::move(intersection));
208 l.a = l.b;
209 }
210 return intersections->size() > intersections_size;
211}
bool intersections(const Line &line, Points *intersections) const
Definition Polygon.cpp:196

References Slic3r::Line::a, Slic3r::Line::b, Slic3r::Line::intersection(), intersection(), intersections(), and Slic3r::MultiPoint::points.

Referenced by intersections().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_clockwise()

bool Slic3r::Polygon::is_clockwise ( ) const
74{
75 return !this->is_counter_clockwise();
76}
bool is_counter_clockwise() const
Definition Polygon.cpp:68

References is_counter_clockwise().

Referenced by Slic3r::Arachne::ExtrusionLine::is_contour(), and Slic3r::ExtrusionLoop::make_counter_clockwise().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_counter_clockwise()

bool Slic3r::Polygon::is_counter_clockwise ( ) const
69{
70 return ClipperLib::Orientation(this->points);
71}
bool Orientation(const Path &poly)
Definition clipper.hpp:200

References ClipperLib::Orientation(), and Slic3r::MultiPoint::points.

Referenced by Slic3r::elephant_foot_compensation(), Slic3r::extract_colored_segments(), Slic3r::inner_offset(), is_clockwise(), Slic3r::ExtrusionLoop::make_clockwise(), make_clockwise(), make_counter_clockwise(), simplify(), and Slic3r::validate_expoly_orientation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_valid()

bool Slic3r::Polygon::is_valid ( ) const
inline
62{ return this->points.size() >= 3; }

References Slic3r::MultiPoint::points.

Referenced by Slic3r::ExPolygon::is_valid().

+ Here is the caller graph for this function:

◆ last_point()

const Point & Slic3r::Polygon::last_point ( ) const
inline
45{ return this->points.front(); }

References Slic3r::MultiPoint::points.

◆ length()

double Slic3r::Polygon::length ( ) const
12{
13 double l = 0;
14 if (this->points.size() > 1) {
15 l = (this->points.back() - this->points.front()).cast<double>().norm();
16 for (size_t i = 1; i < this->points.size(); ++ i)
17 l += (this->points[i] - this->points[i - 1]).cast<double>().norm();
18 }
19 return l;
20}

References Slic3r::MultiPoint::points.

◆ lines()

Lines Slic3r::Polygon::lines ( ) const
23{
24 return to_lines(*this);
25}
Lines to_lines(const ExPolygon &src)
Definition ExPolygon.hpp:117

References Slic3r::to_lines().

Referenced by Slic3r::ExPolygon::lines().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_clockwise()

bool Slic3r::Polygon::make_clockwise ( )
88{
89 if (this->is_counter_clockwise()) {
90 this->reverse();
91 return true;
92 }
93 return false;
94}
void reverse()
Definition MultiPoint.hpp:34

References is_counter_clockwise(), and Slic3r::MultiPoint::reverse().

+ Here is the call graph for this function:

◆ make_counter_clockwise()

bool Slic3r::Polygon::make_counter_clockwise ( )
79{
80 if (!this->is_counter_clockwise()) {
81 this->reverse();
82 return true;
83 }
84 return false;
85}

References is_counter_clockwise(), and Slic3r::MultiPoint::reverse().

Referenced by Slic3r::SupportSpotsGenerator::estimate_supports_malformations(), and Slic3r::SeamPlacerImpl::process_perimeter_polygon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ new_scale()

static Polygon Slic3r::Polygon::new_scale ( const std::vector< Vec2d > &  points)
inlinestatic
31 {
32 Polygon pgn;
33 pgn.points.reserve(points.size());
34 for (const Vec2d &pt : points)
35 pgn.points.emplace_back(Point::new_scale(pt(0), pt(1)));
36 return pgn;
37 }
static Polygon new_scale(const std::vector< Vec2d > &points)
Definition Polygon.hpp:31
Polygon()=default

References Slic3r::MultiPoint::points.

Referenced by Slic3r::BuildVolume::BuildVolume(), Slic3r::GUI::Bed_2D::repaint(), and Slic3r::GUI::Bed3D::set_shape().

+ Here is the caller graph for this function:

◆ on_boundary()

bool Slic3r::Polygon::on_boundary ( const Point point,
double  eps 
) const
inline
69 { return (this->point_projection(point) - point).cast<double>().squaredNorm() < eps * eps; }
Point point_projection(const Point &point) const
Definition Polygon.cpp:266

References point_projection().

Referenced by Slic3r::ExPolygon::on_boundary().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

Polygon & Slic3r::Polygon::operator= ( const Polygon other)
inline
38{ points = other.points; return *this; }

References Slic3r::MultiPoint::points.

◆ operator=() [2/2]

Polygon & Slic3r::Polygon::operator= ( Polygon &&  other)
inline
39{ points = std::move(other.points); return *this; }

References Slic3r::MultiPoint::points.

◆ operator[]() [1/2]

Point & Slic3r::Polygon::operator[] ( Points::size_type  idx)
inline
41{ return this->points[idx]; }

References Slic3r::MultiPoint::points.

◆ operator[]() [2/2]

const Point & Slic3r::Polygon::operator[] ( Points::size_type  idx) const
inline
42{ return this->points[idx]; }

References Slic3r::MultiPoint::points.

◆ parameter_by_length()

std::vector< float > Slic3r::Polygon::parameter_by_length ( ) const
304{
305 // Parametrize the polygon by its length.
306 std::vector<float> lengths(points.size()+1, 0.);
307 for (size_t i = 1; i < points.size(); ++ i)
308 lengths[i] = lengths[i-1] + (points[i] - points[i-1]).cast<float>().norm();
309 lengths.back() = lengths[lengths.size()-2] + (points.front() - points.back()).cast<float>().norm();
310 return lengths;
311}

References Slic3r::MultiPoint::points.

Referenced by densify().

+ Here is the caller graph for this function:

◆ point_projection()

Point Slic3r::Polygon::point_projection ( const Point point) const
267{
268 Point proj = point;
269 double dmin = std::numeric_limits<double>::max();
270 if (! this->points.empty()) {
271 for (size_t i = 0; i < this->points.size(); ++ i) {
272 const Point &pt0 = this->points[i];
273 const Point &pt1 = this->points[(i + 1 == this->points.size()) ? 0 : i + 1];
274 double d = (point - pt0).cast<double>().norm();
275 if (d < dmin) {
276 dmin = d;
277 proj = pt0;
278 }
279 d = (point - pt1).cast<double>().norm();
280 if (d < dmin) {
281 dmin = d;
282 proj = pt1;
283 }
284 Vec2d v1(coordf_t(pt1(0) - pt0(0)), coordf_t(pt1(1) - pt0(1)));
285 coordf_t div = v1.squaredNorm();
286 if (div > 0.) {
287 Vec2d v2(coordf_t(point(0) - pt0(0)), coordf_t(point(1) - pt0(1)));
288 coordf_t t = v1.dot(v2) / div;
289 if (t > 0. && t < 1.) {
290 Point foot(coord_t(floor(coordf_t(pt0(0)) + t * v1(0) + 0.5)), coord_t(floor(coordf_t(pt0(1)) + t * v1(1) + 0.5)));
291 d = (point - foot).cast<double>().norm();
292 if (d < dmin) {
293 dmin = d;
294 proj = foot;
295 }
296 }
297 }
298 }
299 }
300 return proj;
301}
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
Definition ArrayCwiseUnaryOps.h:388
int32_t coord_t
Definition libslic3r.h:39
double coordf_t
Definition libslic3r.h:45
double coordf_t
Definition GUI_ObjectList.hpp:36

References dmin(), floor(), and Slic3r::MultiPoint::points.

Referenced by on_boundary(), Slic3r::ExPolygon::point_projection(), and Slic3r::GUI::Bed3D::point_projection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_duplicate_points()

bool Slic3r::MultiPoint::remove_duplicate_points ( )
inherited
88{
89 size_t j = 0;
90 for (size_t i = 1; i < points.size(); ++i) {
91 if (points[j] == points[i]) {
92 // Just increase index i.
93 } else {
94 ++ j;
95 if (j < i)
96 points[j] = points[i];
97 }
98 }
99 if (++ j < points.size()) {
100 points.erase(points.begin() + j, points.end());
101 return true;
102 }
103 return false;
104}

References Slic3r::MultiPoint::points.

Referenced by Slic3r::ExPolygonWithOffset::ExPolygonWithOffset(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::polylines_from_paths(), and Slic3r::traverse_graph_generate_polylines().

+ Here is the caller graph for this function:

◆ reverse()

◆ rotate() [1/3]

void Slic3r::MultiPoint::rotate ( double  angle)
inlineinherited
31{ this->rotate(cos(angle), sin(angle)); }
EIGEN_DEVICE_FUNC const CosReturnType cos() const
Definition ArrayCwiseUnaryOps.h:202
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Definition ArrayCwiseUnaryOps.h:220
void rotate(double angle)
Definition MultiPoint.hpp:31
double angle(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:112

References Slic3r::angle(), cos(), Slic3r::MultiPoint::rotate(), and sin().

Referenced by Slic3r::ExPolygonWithOffset::ExPolygonWithOffset(), Slic3r::ExPolygonWithOffset::ExPolygonWithOffset(), Slic3r::FillHoneycomb::_fill_surface_single(), Slic3r::get_arrange_poly(), Slic3r::ExPolygon::rotate(), Slic3r::MultiPoint::rotate(), Slic3r::ExPolygon::rotate(), Slic3r::Print::sequential_print_horizontal_clearance_valid(), and Slic3r::ModelInstance::transform_polygon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rotate() [2/3]

void Slic3r::MultiPoint::rotate ( double  angle,
const Point center 
)
inherited
38{
39 double s = sin(angle);
40 double c = cos(angle);
41 for (Point &pt : points) {
42 Vec2crd v(pt - center);
43 pt(0) = (coord_t)round(double(center(0)) + c * v[0] - s * v[1]);
44 pt(1) = (coord_t)round(double(center(1)) + c * v[1] + s * v[0]);
45 }
46}
EIGEN_DEVICE_FUNC const RoundReturnType round() const
Definition ArrayCwiseUnaryOps.h:374
Eigen::Matrix< coord_t, 2, 1, Eigen::DontAlign > Vec2crd
Definition Point.hpp:37

References Slic3r::angle(), cos(), Slic3r::MultiPoint::points, round(), and sin().

+ Here is the call graph for this function:

◆ rotate() [3/3]

void Slic3r::MultiPoint::rotate ( double  cos_angle,
double  sin_angle 
)
inherited
28{
29 for (Point &pt : this->points) {
30 double cur_x = double(pt(0));
31 double cur_y = double(pt(1));
32 pt(0) = coord_t(round(cos_angle * cur_x - sin_angle * cur_y));
33 pt(1) = coord_t(round(cos_angle * cur_y + sin_angle * cur_x));
34 }
35}

References Slic3r::MultiPoint::points, and round().

+ Here is the call graph for this function:

◆ scale() [1/2]

void Slic3r::MultiPoint::scale ( double  factor)
inherited
7{
8 for (Point &pt : points)
9 pt *= factor;
10}

References Slic3r::MultiPoint::points.

Referenced by Slic3r::FFFTreeSupport::RichInterfacePlacer::add_points_along_lines(), Slic3r::ExPolygon::scale(), Slic3r::ExPolygon::scale(), and Slic3r::ModelInstance::transform_polygon().

+ Here is the caller graph for this function:

◆ scale() [2/2]

void Slic3r::MultiPoint::scale ( double  factor_x,
double  factor_y 
)
inherited
13{
14 for (Point &pt : points)
15 {
16 pt(0) = coord_t(pt(0) * factor_x);
17 pt(1) = coord_t(pt(1) * factor_y);
18 }
19}

References Slic3r::MultiPoint::points.

◆ simplify()

Polygons Slic3r::Polygon::simplify ( double  tolerance) const
105{
106 // Works on CCW polygons only, CW contour will be reoriented to CCW by Clipper's simplify_polygons()!
107 assert(this->is_counter_clockwise());
108
109 // repeat first point at the end in order to apply Douglas-Peucker
110 // on the whole polygon
111 Points points = this->points;
112 points.push_back(points.front());
114 p.points.pop_back();
115
116 Polygons pp;
117 pp.push_back(p);
118 return simplify_polygons(pp);
119}
std::vector< Polygon, PointsAllocator< Polygon > > Polygons
Definition Polygon.hpp:15
Polygons simplify_polygons(const Polygons &subject)
Definition ClipperUtils.cpp:969

References Slic3r::MultiPoint::douglas_peucker(), is_counter_clockwise(), Slic3r::MultiPoint::points, and Slic3r::simplify_polygons().

+ Here is the call graph for this function:

◆ size()

size_t Slic3r::MultiPoint::size ( ) const
inlineinherited
39{ return points.size(); }

Referenced by Slic3r::BuildVolume::BuildVolume(), Slic3r::GCode::_do_export(), Slic3r::FillPlanePath::_fill_surface_single(), Slic3r::any_expolygon_contains(), Slic3r::avoid_perimeters_inner(), Slic3r::SeamPlacerImpl::calculate_polygon_angles_at_vertices(), Slic3r::Fill::connect_base_support(), Slic3r::connect_layer_slices(), Slic3r::FillAdaptive::connect_lines_using_hooks(), Slic3r::contour_distance(), Slic3r::contour_distance(), Slic3r::contour_distance2(), Slic3r::Geometry::convex_hull(), Slic3r::Geometry::convex_hull(), Slic3r::Geometry::convex_polygons_intersect(), Slic3r::create_boundary_infill_graph(), Slic3r::GUI::ImGuiWrapper::draw(), Slic3r::emit_loops_in_band(), Slic3r::FFFTreeSupport::ensure_maximum_distance_polyline(), Slic3r::expolygons_to_zpaths_shrunk(), Slic3r::find_first_different_vertex(), Slic3r::fuzzy_polygon(), priv::get_closest_point_index(), Slic3r::get_shortest_direction(), Slic3r::FillLightning::Layer::getBestGroundingLocation(), Slic3r::Geometry::rotcalip::Idx::inc(), Slic3r::BoundaryInfillGraph::interpolate_contour_point(), Slic3r::mark_boundary_segments_overlapping_infill(), Slic3r::ExtrusionPath::middle_point(), Slic3r::mittered_offset_path_scaled(), Slic3r::FFFTreeSupport::move_inside(), Slic3r::need_wipe(), Slic3r::Geometry::rotcalip::Idx::next(), Slic3r::Geometry::rotcalip::Idx::next_dir(), Slic3r::Voronoi::offset(), Slic3r::Arachne::PolygonsPointIndexSegmentLocator::operator()(), Slic3r::paths_touch(), Slic3r::polygons_match(), Slic3r::precompute_polygon_distances(), Slic3r::Geometry::rotcalip::Idx::prev_dir(), Slic3r::SeamPlacerImpl::process_perimeter_polygon(), Slic3r::GUI::MeshClipper::recalculate_triangles(), Slic3r::remove_duplicates(), Slic3r::Arachne::removeColinearEdges(), Slic3r::Arachne::removeDegenerateVerts(), Slic3r::FillLightning::Node::removeJunctionOverlap(), Slic3r::resample_polygon(), Slic3r::resample_polygon(), Slic3r::Arachne::simplify(), Slic3r::ExtrusionPath::size(), Slic3r::slice_region_by_vertical_lines(), Slic3r::smooth_compensation_banded(), Slic3r::smooth_outward(), Slic3r::smooth_outward(), Slic3r::Polyline::split_at(), Slic3r::Arachne::WallToolPaths::stitchToolPaths(), Slic3r::take(), Slic3r::take_ccw_full(), Slic3r::take_ccw_limited(), Slic3r::take_cw_full(), Slic3r::take_cw_limited(), Slic3r::take_limited(), priv::to_expoly(), Slic3r::to_polyline(), Slic3r::FFFSupport::tree_supports_generate_paths(), Slic3r::triangulate_wall(), and Slic3r::Wipe::wipe().

◆ split_at_first_point()

Polyline Slic3r::Polygon::split_at_first_point ( ) const
inline
53{ return this->split_at_index(0); }
Polyline split_at_index(int index) const
Definition Polygon.cpp:38

References split_at_index().

Referenced by Slic3r::ExtrusionLoop::as_polyline(), equally_spaced_points(), Slic3r::FFFSupport::LoopInterfaceProcessor::generate(), and Slic3r::traverse_loops_classic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ split_at_index()

Polyline Slic3r::Polygon::split_at_index ( int  index) const
39{
40 Polyline polyline;
41 polyline.points.reserve(this->points.size() + 1);
42 for (Points::const_iterator it = this->points.begin() + index; it != this->points.end(); ++it)
43 polyline.points.push_back(*it);
44 for (Points::const_iterator it = this->points.begin(); it != this->points.begin() + index + 1; ++it)
45 polyline.points.push_back(*it);
46 return polyline;
47}

References Slic3r::MultiPoint::points.

Referenced by split_at_first_point(), and split_at_vertex().

+ Here is the caller graph for this function:

◆ split_at_vertex()

Polyline Slic3r::Polygon::split_at_vertex ( const Point point) const
28{
29 // find index of point
30 for (const Point &pt : this->points)
31 if (pt == point)
32 return this->split_at_index(int(&pt - &this->points.front()));
33 throw Slic3r::InvalidArgument("Point not found");
34 return Polyline();
35}

References Slic3r::MultiPoint::points, and split_at_index().

+ Here is the call graph for this function:

◆ translate() [1/2]

void Slic3r::MultiPoint::translate ( const Point vector)
inherited
22{
23 for (Point &pt : points)
24 pt += v;
25}

References Slic3r::MultiPoint::points.

◆ translate() [2/2]

void Slic3r::MultiPoint::translate ( double  x,
double  y 
)
inlineinherited
29{ this->translate(Point(coord_t(x), coord_t(y))); }
void translate(double x, double y)
Definition MultiPoint.hpp:29

References Slic3r::MultiPoint::translate().

Referenced by Slic3r::LinesBucket::curLines(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::get_arrange_poly(), priv::heal_dupl_inter(), Slic3r::Emboss::heal_shape(), priv::remove_self_intersections(), Slic3r::GCode::set_origin(), Slic3r::ExPolygon::translate(), Slic3r::MultiPoint::translate(), Slic3r::AvoidCrossingPerimeters::travel_to(), and Slic3r::GCode::travel_to().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ triangulate_convex()

void Slic3r::Polygon::triangulate_convex ( Polygons polygons) const
123{
124 for (Points::const_iterator it = this->points.begin() + 2; it != this->points.end(); ++it) {
125 Polygon p;
126 p.points.reserve(3);
127 p.points.push_back(this->points.front());
128 p.points.push_back(*(it-1));
129 p.points.push_back(*it);
130
131 // this should be replaced with a more efficient call to a merge_collinear_segments() method
132 if (p.area() > 0) polygons->push_back(p);
133 }
134}

References area(), and Slic3r::MultiPoint::points.

+ Here is the call graph for this function:

◆ visivalingam()

Points Slic3r::MultiPoint::visivalingam ( const Points pts,
const double &  tolerance 
)
staticinherited
223{
224 // Make sure there's enough points in "pts" to bother with simplification.
225 assert(pts.size() >= 2);
226 // Result object
227 Points results;
228 // Lambda to calculate effective area spanned by a point and its immediate
229 // successor + predecessor.
230 auto effective_area = [pts](const size_t& curr_pt_idx, const size_t& prev_pt_idx, const size_t& next_pt_idx)->coordf_t {
231 const Point& curr = pts[curr_pt_idx];
232 const Point& prev = pts[prev_pt_idx];
233 const Point& next = pts[next_pt_idx];
234 // Use point objects as vector-distances
235 const Vec2d curr_to_next = (next - curr).cast<double>();
236 const Vec2d prev_to_next = (prev - curr).cast<double>();
237 // Take cross product of these two vector distances
238 return 0.50 * abs(cross2(curr_to_next, prev_to_next));
239 };
240 // We store the effective areas for each node
241 std::vector<coordf_t> areas;
242 areas.reserve(pts.size());
243 // Construct the initial set of nodes. We will make a heap out of the "heap" vector using
244 // std::make_heap. node_list is used later.
245 std::vector<vis_node*> node_list;
246 node_list.resize(pts.size());
247 std::vector<vis_node*> heap;
248 heap.reserve(pts.size());
249 for (size_t i = 1; i < pts.size() - 1; ++ i) {
250 // Get effective area of current node.
251 coordf_t area = effective_area(i, i - 1, i + 1);
252 // If area is greater than some arbitrarily small value, use it.
253 node_list[i] = new vis_node(i, i - 1, i + 1, area);
254 heap.push_back(node_list[i]);
255 }
256 // Call std::make_heap, which uses the < operator by default to make "heap" into
257 // a binheap, sorted by the < operator we defind in the vis_node struct
258 std::make_heap(heap.begin(), heap.end());
259 // Start comparing areas. Set min_area to an outrageous value initially.
260 double min_area = -std::numeric_limits<double>::max();
261 while (!heap.empty()) {
262 // Get current node.
263 vis_node* curr = heap.front();
264 // Pop node we just retrieved off the heap. pop_heap moves front element in vector
265 // to the back, so we can call pop_back()
266 std::pop_heap(heap.begin(), heap.end());
267 heap.pop_back();
268 // Sanity assert check
269 assert(curr == node_list[curr->pt_idx]);
270 // If the current pt'ss area is less than that of the previous pt's area
271 // use the last pt's area instead. This ensures we don't elimate the current
272 // point without eliminating the previous
273 min_area = std::max(min_area, curr->area);
274 // Update prev
275 vis_node* prev = node_list[curr->prev_idx];
276 if(prev != nullptr){
277 prev->next_idx = curr->next_idx;
278 prev->area = effective_area(prev->pt_idx, prev->prev_idx, prev->next_idx);
279 // For some reason, std::make_heap() is the fastest way to resort the heap. Probably needs testing.
280 std::make_heap(heap.begin(), heap.end());
281 }
282 // Update next
283 vis_node* next = node_list[curr->next_idx];
284 if(next != nullptr){
285 next->prev_idx = curr->prev_idx;
286 next->area = effective_area(next->pt_idx, next->prev_idx, next->next_idx);
287 std::make_heap(heap.begin(), heap.end());
288 }
289 areas[curr->pt_idx] = min_area;
290 node_list[curr->pt_idx] = nullptr;
291 delete curr;
292 }
293 // Clear node list and shrink_to_fit() (to free actual memory). Not necessary. Could be removed.
294 node_list.clear();
295 node_list.shrink_to_fit();
296 // This lambda is how we test whether or not to keep a point.
297 auto use_point = [areas, tolerance](const size_t& idx)->bool {
298 assert(idx < areas.size());
299 // Return true at front/back of path/areas
300 if(idx == 0 || idx == areas.size() - 1){
301 return true;
302 }
303 // Return true if area at idx is greater than minimum area to consider "valid"
304 else{
305 return areas[idx] > tolerance;
306 }
307 };
308 // Use previously defined lambda to build results.
309 for (size_t i = 0; i < pts.size(); ++i) {
310 if (use_point(i)){
311 results.push_back(pts[i]);
312 }
313 }
314 // Check that results has at least two points
315 assert(results.size() >= 2);
316 // Return simplified vector of points
317 return results;
318}
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half abs(const half &a)
Definition Half.h:445
double area(const ExPolygon &poly)
Definition ExPolygon.hpp:467

References Slic3r::area(), Slic3r::vis_node::area, Slic3r::cross2(), Slic3r::vis_node::next_idx, Slic3r::vis_node::prev_idx, and Slic3r::vis_node::pt_idx.

+ Here is the call graph for this function:

Member Data Documentation

◆ points

Points Slic3r::MultiPoint::points
inherited

Referenced by Slic3r::BuildVolume::BuildVolume(), Slic3r::ExPolygonsIndices::ExPolygonsIndices(), Slic3r::Polyline::Polyline(), Slic3r::GCode::_do_export(), Slic3r::GCode::_extrude(), Slic3r::FillHoneycomb::_fill_surface_single(), Slic3r::FillPlanePath::_fill_surface_single(), Slic3r::Print::_make_skirt(), Slic3r::sla::ConcaveHull::add_connector_rectangles(), Slic3r::FFFTreeSupport::RichInterfacePlacer::add_points_along_lines(), libnest2d::shapelike::addVertex(), Slic3r::any_expolygon_contains(), Slic3r::Polyline::append(), Slic3r::Polyline::append(), Slic3r::Polyline::append(), Slic3r::Polyline::append(), Slic3r::Polyline::append(), Slic3r::anonymous_namespace{SL1_SVG.cpp}::append_svg(), Slic3r::WipeTowerIntegration::append_tcr(), area(), area(), Slic3r::ExtrusionMultiPath::as_polyline(), Slic3r::MutablePolygon::assign(), Slic3r::MultiPoint::begin(), Slic3r::MultiPoint::begin(), boost::polygon::polygon_traits< Slic3r::ExPolygon >::begin_points(), boost::polygon::polygon_traits< Slic3r::Polygon >::begin_points(), Slic3r::MultiPoint::bounding_box(), Slic3r::SeamPlacerImpl::calculate_polygon_angles_at_vertices(), Slic3r::MultiPoint::cbegin(), Slic3r::MultiPoint::cend(), centroid(), Slic3r::chain_lines(), Slic3r::SupportSpotsGenerator::check_extrusion_entity_stability(), Slic3r::ExPolygon::clear(), Slic3r::ClipperUtils::clip_clipper_polygon_with_subject_bbox(), Slic3r::ClipperUtils::clip_clipper_polygon_with_subject_bbox(), Slic3r::Polyline::clip_end(), Slic3r::Polyline::clip_start(), Slic3r::SupportMaterialInternal::collect_bridging_perimeter_areas(), priv::collect_close_points(), Slic3r::ExtrusionPath::collect_points(), Slic3r::ExtrusionMultiPath::collect_points(), Slic3r::ExtrusionLoop::collect_points(), Slic3r::colored_points_to_polygon(), concave_points(), Slic3r::Fill::connect_base_support(), Slic3r::connect_brim_lines(), Slic3r::Fill::connect_infill(), Slic3r::FillAdaptive::connect_lines_using_hooks(), Slic3r::contains(), Slic3r::contour_distance(), Slic3r::contours_simplified(), Slic3r::EdgeGrid::Grid::contours_simplified(), Slic3r::Geometry::convex_hull(), Slic3r::Geometry::convex_hulll(), convex_points(), Slic3r::count_points(), Slic3r::count_points(), Slic3r::EdgeGrid::Grid::create(), Slic3r::EdgeGrid::Grid::create(), libnest2d::shapelike::create(), Slic3r::create_boundary_infill_graph(), densify(), Slic3r::diff(), Slic3r::diff_ex(), Slic3r::diff_ex(), Slic3r::diff_pl(), Slic3r::diff_pl(), Slic3r::diff_pl(), Slic3r::distance_of_segmens(), Slic3r::sla::anonymous_namespace{Pad.cpp}::divide_blueprint(), Slic3r::Emboss::divide_segments_for_close_point(), douglas_peucker(), Slic3r::GUI::ImGuiWrapper::draw(), Slic3r::FFFSupport::draw_perimeters(), Slic3r::elephant_foot_compensation(), Slic3r::emit_perimeter_prev_next_segment(), Slic3r::emit_perimeter_segment_on_vertical_line(), Slic3r::ExPolygon::empty(), Slic3r::MultiPoint::empty(), Slic3r::MultiPoint::end(), Slic3r::MultiPoint::end(), boost::polygon::polygon_traits< Slic3r::ExPolygon >::end_points(), boost::polygon::polygon_traits< Slic3r::Polygon >::end_points(), Slic3r::FFFTreeSupport::ensure_maximum_distance_polyline(), Slic3r::Polyline::equally_spaced_points(), Slic3r::ExtrusionQualityEstimator::estimate_speed_from_extrusion_quality(), Slic3r::SupportSpotsGenerator::estimate_supports_malformations(), Slic3r::evaluate_support_arch_cost(), Slic3r::evaluate_support_arches(), Slic3r::ClipperZUtils::expolygons_to_zpaths(), Slic3r::Algorithm::expolygons_to_zpaths_expanded_opened(), Slic3r::expolygons_to_zpaths_shrunk(), Slic3r::Polyline::extend_end(), Slic3r::Polyline::extend_start(), Slic3r::SupportGridPattern::extract_support(), Slic3r::GCode::extrude_loop(), Slic3r::GCode::extrude_multi_path(), Slic3r::ExtrusionSimulator::extrude_to_accumulator(), Slic3r::extrusion_entities_append_loops(), Slic3r::extrusion_polyline_extents(), priv::fill_polygon_distances(), Slic3r::Print::finalize_first_layer_convex_hull(), priv::find_close_point(), Slic3r::find_first_different_vertex(), Slic3r::MultiPoint::find_point(), Slic3r::MultiPoint::find_point(), Slic3r::WipeTower::finish_layer(), first_intersection(), Slic3r::ExtrusionPath::first_point(), Slic3r::NSVGUtils::flatten_cubic_bez(), Slic3r::foreach_vertex(), Slic3r::sla::foreach_vertex(), Slic3r::fuzzy_polygon(), Slic3r::FFFSupport::LoopInterfaceProcessor::generate(), Slic3r::get_all_polygons(), Slic3r::get_arrange_poly(), Slic3r::get_extents(), Slic3r::get_extents(), Slic3r::get_extents_rotated(), Slic3r::get_extents_rotated(), Slic3r::SVG::get_path_d(), Slic3r::get_polygon_vertex_inward_normal(), Slic3r::get_polygon_vertex_offset(), Slic3r::GUI::GLGizmoPainterBase::get_projected_mouse_positions(), Slic3r::FillLightning::Layer::getBestGroundingLocation(), Slic3r::FakeWipeTower::getFakeExtrusionPathsFromWipeTower(), Slic3r::MultiPoint::has_duplicate_points(), Slic3r::has_duplicate_points(), Slic3r::has_duplicate_points(), Slic3r::has_duplicate_points(), Slic3r::FillAdaptive::has_no_collinear_lines(), Slic3r::GUI::GLModel::init_from(), priv::insert_edges(), priv::insert_edges(), intersection(), Slic3r::intersection(), Slic3r::intersection_pl(), Slic3r::intersection_pl(), Slic3r::intersection_pl(), Slic3r::intersection_pl(), intersections(), Slic3r::Geometry::is_ccw(), Slic3r::ExtrusionPath::is_closed(), Slic3r::Polyline::is_closed(), Slic3r::Arachne::ExtrusionLine::is_contour(), is_counter_clockwise(), is_valid(), Slic3r::SupportGridPattern::island_samples(), last_point(), Slic3r::Polyline::last_point(), Slic3r::ExtrusionPath::last_point(), Slic3r::Polyline::leftmost_point(), length(), Slic3r::Polyline::length(), Slic3r::Polyline::lines(), Slic3r::GUI::Plater::priv::load_model_objects(), Slic3r::make_circle_num_segments(), Slic3r::make_expolygons_simple(), Slic3r::make_fill_polylines(), Slic3r::make_wave(), Slic3r::makeGrid(), Slic3r::mark_boundary_segments_overlapping_infill(), Slic3r::ExtrusionPath::middle_point(), Slic3r::FFFSupport::modulate_extrusion_by_overlapping_layers(), new_scale(), Slic3r::Polyline::new_scale(), Slic3r::Voronoi::offset(), Slic3r::offset(), Slic3r::offset(), Slic3r::offset_expolygon_inner(), Slic3r::operator!=(), Slic3r::operator!=(), Slic3r::ClipperUtils::ExPolygonProvider::iterator::operator*(), Slic3r::MultiPoint::operator=(), operator=(), Slic3r::Polyline::operator=(), Slic3r::MultiPoint::operator=(), operator=(), Slic3r::Polyline::operator=(), Slic3r::operator==(), Slic3r::operator==(), operator[](), Slic3r::Polyline::operator[](), operator[](), Slic3r::Polyline::operator[](), Slic3r::FillAdaptive::Intersection::other_hook(), Slic3r::ExPolygon::overlaps(), parameter_by_length(), Slic3r::paths_touch(), point_projection(), Slic3r::ExtrusionLoop::polygon(), Slic3r::MutablePolygon::polygon(), Slic3r::BoundingBox::polygon(), Slic3r::polygon_is_convex(), Slic3r::polygon_segment_append(), Slic3r::polygon_segment_append_reversed(), Slic3r::polygons_match(), Slic3r::polylines_from_paths(), Slic3r::precompute_polygon_distances(), Slic3r::Print::process(), Slic3r::sla::raster_to_polygons(), Slic3r::SL1_SVGReader::read(), Slic3r::reconnect_polylines(), Slic3r::remove_collinear(), Slic3r::MultiPoint::remove_duplicate_points(), priv::remove_same_neighbor(), priv::remove_spikes_in_duplicates(), Slic3r::remove_sticks(), priv::remove_when_spike(), Slic3r::Arachne::removeColinearEdges(), Slic3r::Arachne::removeDegenerateVerts(), Slic3r::FillLightning::Node::removeJunctionOverlap(), Slic3r::resample_polygon(), libnest2d::shapelike::reserve(), Slic3r::anonymous_namespace{SL1.cpp}::rings_to_expolygons(), Slic3r::MultiPoint::rotate(), Slic3r::MultiPoint::rotate(), Slic3r::MultiPoint::scale(), Slic3r::MultiPoint::scale(), Slic3r::segment_length(), boost::polygon::polygon_mutable_traits< Slic3r::ExPolygon >::set_points(), boost::polygon::polygon_mutable_traits< Slic3r::Polygon >::set_points(), Slic3r::Polyline::simplify(), simplify(), Slic3r::Arachne::simplify(), Slic3r::ExPolygon::simplify_p(), boost::polygon::polygon_traits< Slic3r::ExPolygon >::size(), boost::polygon::polygon_traits< Slic3r::Polygon >::size(), Slic3r::slice_region_by_vertical_lines(), Slic3r::ExtrusionLoop::split_at(), Slic3r::Polyline::split_at(), split_at_index(), split_at_vertex(), Slic3r::ExtrusionLoop::split_at_vertex(), Slic3r::GUI::ImGuiWrapper::suggest_location(), Slic3r::take(), Slic3r::take_ccw_full(), Slic3r::take_ccw_limited(), Slic3r::take_cw_full(), Slic3r::take_cw_limited(), Slic3r::take_limited(), Slic3r::GluTessWrapper::tesselate3d(), Slic3r::PerimeterGenerator::thick_polyline_to_multi_path(), Slic3r::to_lines(), Slic3r::to_lines(), Slic3r::to_lines(), Slic3r::to_lines(), Slic3r::to_lines(), Slic3r::to_linesf(), Slic3r::sla::AGGRaster< PixelRenderer, Renderer, Rasterizer, Scanline >::to_path(), Slic3r::to_points(), Slic3r::to_points(), Slic3r::to_points(), Slic3r::Arachne::to_polygon(), Slic3r::to_polygon(), Slic3r::NSVGUtils::to_polygons(), Slic3r::to_polyline(), Slic3r::to_polyline(), Slic3r::to_polylines(), Slic3r::to_polylines(), Slic3r::to_polylines(), Slic3r::to_polylines(), Slic3r::to_polylines(), Slic3r::SupportSpotsGenerator::to_short_lines(), Slic3r::Arachne::ExtrusionLine::toPolygon(), libnest2d::shapelike::toString(), Slic3r::anonymous_namespace{SL1_SVG.cpp}::transform(), Slic3r::MultiPoint::translate(), Slic3r::AvoidCrossingPerimeters::travel_to(), Slic3r::traverse_graph_generate_polylines(), Slic3r::traverse_loops_classic(), Slic3r::traverse_pt(), Slic3r::FFFSupport::tree_supports_generate_paths(), Slic3r::Triangulation::triangulate(), triangulate_convex(), Slic3r::triangulate_wall(), Slic3r::GUI::GLCanvas3D::update_sequential_clearance(), Slic3r::FFFTreeSupport::validate_range(), Slic3r::variable_offset_inner_raw(), Slic3r::variable_offset_outer_ex(), Slic3r::variable_offset_outer_raw(), Slic3r::wall_strip(), and Slic3r::Wipe::wipe().


The documentation for this class was generated from the following files: