OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::Polygon Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/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) noexcept
Polygon & operator= (const Polygon &other)
Polygon & operator= (Polygon &&other) noexcept
Point & operator[] (Points::size_type idx)
const Point & operator[] (Points::size_type idx) const
const Point & last_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
bool overlaps (const Polygons &other) 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
Polygon transform (const Transform3d &trafo) 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 Point & front () const
const Point & back () const
const Point & first_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
bool has_boundary_point (const Point &point) const
int closest_point_index (const Point &point) const
const Point * closest_point (const Point &point) const
double distance_to (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)
void symmetric_y (const coord_t &y_axis)
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)
static Points concave_hull_2d (const Points &pts, const double tolerence)
static double minimumDistanceBetweenLinesDefinedByPoints (const Points &A, const Points &B)
 Calculates the minimum distance between two lines defined by sets of points.

Public Attributes

Points points

Static Private Member Functions

static double squaredDistanceToLineSegment (const Point &p, const Point &v, const Point &w)
 Calculates the squared distance between a point and a line segment defined by two 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

Referenced by Polygon(), Polygon(), new_scale(), operator=(), operator=(), simplify(), transform(), and triangulate_convex().

Here is the caller graph for this function:

◆ Polygon() [2/5]

Slic3r::Polygon::Polygon ( const Points & points)
inlineexplicit
Points points
Definition MultiPoint.hpp:22
MultiPoint()
Definition MultiPoint.hpp:24

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

Here is the call graph for this function:

◆ Polygon() [3/5]

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

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

Here is the call graph for this function:

◆ Polygon() [4/5]

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

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

Here is the call graph for this function:

◆ Polygon() [5/5]

Slic3r::Polygon::Polygon ( Polygon && other)
inlinenoexcept
37: MultiPoint(std::move(other.points)) {}

References Polygon().

Here is the call graph for this function:

Member Function Documentation

◆ _douglas_peucker()

Points Slic3r::MultiPoint::_douglas_peucker ( const Points & points,
const double tolerance )
staticinherited
176{
177 Points result_pts;
178 double tolerance_sq = tolerance * tolerance;
179 if (! pts.empty()) {
180 const Point *anchor = &pts.front();
181 size_t anchor_idx = 0;
182 const Point *floater = &pts.back();
183 size_t floater_idx = pts.size() - 1;
184 result_pts.reserve(pts.size());
185 result_pts.emplace_back(*anchor);
186 if (anchor_idx != floater_idx) {
187 assert(pts.size() > 1);
188 std::vector<size_t> dpStack;
189 dpStack.reserve(pts.size());
190 dpStack.emplace_back(floater_idx);
191 for (;;) {
192 double max_dist_sq = 0.0;
193 size_t furthest_idx = anchor_idx;
194 // find point furthest from line seg created by (anchor, floater) and note it
195 for (size_t i = anchor_idx + 1; i < floater_idx; ++ i) {
196 double dist_sq = Line::distance_to_squared(pts[i], *anchor, *floater);
197 if (dist_sq > max_dist_sq) {
198 max_dist_sq = dist_sq;
199 furthest_idx = i;
200 }
201 }
202 // remove point if less than tolerance
203 if (max_dist_sq <= tolerance_sq) {
204 result_pts.emplace_back(*floater);
205 anchor_idx = floater_idx;
206 anchor = floater;
207 assert(dpStack.back() == floater_idx);
208 dpStack.pop_back();
209 if (dpStack.empty())
210 break;
211 floater_idx = dpStack.back();
212 } else {
213 floater_idx = furthest_idx;
214 dpStack.emplace_back(floater_idx);
215 }
216 floater = &pts[floater_idx];
217 }
218 }
219 assert(result_pts.front() == pts.front());
220 assert(result_pts.back() == pts.back());
221
222#if 0
223 {
224 static int iRun = 0;
225 BoundingBox bbox(pts);
226 BoundingBox bbox2(result_pts);
227 bbox.merge(bbox2);
228 SVG svg(debug_out_path("douglas_peucker_%d.svg", iRun ++).c_str(), bbox);
229 if (pts.front() == pts.back())
230 svg.draw(Polygon(pts), "black");
231 else
232 svg.draw(Polyline(pts), "black");
233 if (result_pts.front() == result_pts.back())
234 svg.draw(Polygon(result_pts), "green", scale_(0.1));
235 else
236 svg.draw(Polyline(result_pts), "green", scale_(0.1));
237 }
238#endif
239 }
240 return result_pts;
241}
double distance_to_squared(const Point &point) const
Definition Line.hpp:170
#define scale_(val)
Definition libslic3r.h:106
Kernel::Point_3 Point
Definition MeshRepair.cpp:81
std::string debug_out_path(const char *name,...)
Definition utils.cpp:382
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:73
Slic3r::Polygon Polygon
Definition Emboss.cpp:101

References Slic3r::debug_out_path(), Slic3r::Line::distance_to_squared(), Slic3r::SVG::draw(), Slic3r::BoundingBoxBase< PointType, APointsType >::merge(), and scale_.

Referenced by Slic3r::ArcFitter::do_arc_fitting_and_simplify(), Slic3r::Polygon::douglas_peucker(), Slic3r::GUI::GLGizmoBrimEars::generate_points(), Slic3r::GUI::GLGizmoBrimEars::get_detection_radius_max(), Slic3r::make_brim_ears_auto(), Slic3r::polygons_simplify(), Slic3r::Polygon::simplify(), Slic3r::Polyline::simplify(), Slic3r::ExPolygon::simplify_p(), and Slic3r::Geometry::simplify_polygons().

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

◆ append() [1/4]

◆ append() [2/4]

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

References append().

Referenced by 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
92{ this->points.insert(this->points.end(), begin, end); }
auto begin()
Definition MultiPoint.hpp:114
auto end()
Definition MultiPoint.hpp:116

References begin(), and end().

Here is the call graph for this function:

◆ append() [4/4]

void Slic3r::MultiPoint::append ( Points && src)
inlineinherited
94 {
95 if (this->points.empty()) {
96 this->points = std::move(src);
97 } else {
98 this->points.insert(this->points.end(), src.begin(), src.end());
99 src.clear();
100 }
101 }

◆ area() [1/2]

double Slic3r::Polygon::area ( ) const
80{
81 return Polygon::area(points);
82}
double area() const
Definition Polygon.cpp:79

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

Referenced by area(), is_counter_clockwise(), and Slic3r::polygons_simplify().

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
66{
67 double a = 0.;
68 if (points.size() >= 3) {
69 Vec2d p1 = points.back().cast<double>();
70 for (const Point &p : points) {
71 Vec2d p2 = p.cast<double>();
72 a += cross2(p1, p2);
73 p1 = p2;
74 }
75 }
76 return 0.5 * a;
77}
int32_t cross2(const Eigen::MatrixBase< Eigen::Matrix< int32_t, 2, 1, Options > > &v1, const Eigen::MatrixBase< Eigen::Matrix< int32_t, 2, 1, Options > > &v2)=delete
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67

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

Referenced by Slic3r::GCode::_do_export(), Slic3r::bed_exclusion_arrange_polygon(), Slic3r::compSecondMoment(), Slic3r::sla::anonymous_namespace{Rotfinder.cpp}::get_chull_rotations(), Slic3r::WipeTower::its_make_rib_brim(), Slic3r::WipeTower::its_make_rib_tower(), Slic3r::anonymous_namespace{PrintConfig.cpp}::parse_exclude_polygon_points(), Slic3r::arrangement::poly_area(), Slic3r::GUI::FillBedJob::prepare(), and triangulate_convex().

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

◆ back()

const Point & Slic3r::MultiPoint::back ( ) const
inlineinherited
46{ return this->points.back(); }

Referenced by Slic3r::Arachne::removeDegenerateVerts(), Slic3r::FillLightning::Node::removeJunctionOverlap(), Slic3r::GCode::travel_to(), and Slic3r::tree_supports_generate_paths().

Here is the caller graph for this function:

◆ begin() [1/2]

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

References points.

Referenced by append(), Slic3r::Polyline::append(), Slic3r::generate_transform_pattern(), and Slic3r::Polyline::split_at_index().

Here is the caller graph for this function:

◆ begin() [2/2]

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

References points.

◆ bounding_box()

◆ cbegin()

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

References points.

◆ cend()

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

References points.

◆ centroid()

Point Slic3r::Polygon::centroid ( ) const
155{
156 double area_sum = 0.;
157 Vec2d c(0., 0.);
158 if (points.size() >= 3) {
159 Vec2d p1 = points.back().cast<double>();
160 for (const Point &p : points) {
161 Vec2d p2 = p.cast<double>();
162 double a = cross2(p1, p2);
163 area_sum += a;
164 c += (p1 + p2) * a;
165 p1 = p2;
166 }
167 }
168 return Point(Vec2d(c / (3. * area_sum)));
169}

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

Referenced by Slic3r::compSecondMoment(), anonymous_namespace{EmbossJob.cpp}::find_closest(), Slic3r::generate_spiral_insets(), anonymous_namespace{EmbossJob.cpp}::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
89{ this->points.clear(); }

Referenced by Slic3r::Polyline::clear().

Here is the caller graph for this function:

◆ closest_point()

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

References closest_point_index().

Referenced by distance_to().

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

◆ closest_point_index()

int Slic3r::MultiPoint::closest_point_index ( const Point & point) const
inlineinherited
62 {
63 int idx = -1;
64 if (! this->points.empty()) {
65 idx = 0;
66 double dist_min = (point - this->points.front()).cast<double>().norm();
67 for (int i = 1; i < int(this->points.size()); ++ i) {
68 double d = (this->points[i] - point).cast<double>().norm();
69 if (d < dist_min) {
70 dist_min = d;
71 idx = i;
72 }
73 }
74 }
75 return idx;
76 }
auto cast(const BoundingBoxBase< Tin > &b)
Definition BoundingBox.hpp:299

References Slic3r::cast().

Referenced by closest_point(), and Slic3r::remove_points_from_polygon().

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

◆ concave_hull_2d()

Points Slic3r::MultiPoint::concave_hull_2d ( const Points & pts,
const double tolerence )
staticinherited
365{
366 Points hull;
367 int n = (int)pts.size();
368 if (n >= 3) {
369 int k = 0;
370 hull.resize(n);
371 for (int i = 0; i < n; ++i) {
372 while (k >= 2 && pts[i].ccw(hull[k - 2], hull[k - 1]) <= 0 && -pts[i].ccw(hull[k - 2], hull[k - 1]) / (pts[i] - hull[k - 1]).norm() < tolerence)
373 --k;
374 hull[k++] = pts[i];
375 }
376 hull.resize(k);
377 if (hull.front() == hull.back())
378 hull.pop_back();
379 }
380 return hull;
381}

◆ concave_points()

Points Slic3r::Polygon::concave_points ( double angle_threshold = 0.) const
329{
330 return filter_convex_concave_points_by_angle_threshold(this->points, angle_threshold, [](const Vec2d &v1, const Vec2d &v2){ return cross2(v1, v2) < 0.; });
331}
Points filter_convex_concave_points_by_angle_threshold(const Points &poly, double angle_threshold, ConvexConcaveFilterFn convex_concave_filter)
Filters points in a polygon based on a minimum angle threshold and a convex/concave criterion.
Definition Polygon.cpp:288

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

Referenced by Slic3r::GUI::GLGizmoBrimEars::generate_points(), and Slic3r::make_brim_ears_auto().

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

◆ contains()

bool Slic3r::Polygon::contains ( const Point & point) const
inline
73{ return Slic3r::contains(*this, point, true); }
bool contains(const std::vector< T > &vector, const Point &point)
Definition Geometry.cpp:55

References Slic3r::Geometry::contains().

Referenced by Slic3r::generate_spiral_insets(), Slic3r::GUI::GLCanvas3D::get_empty_cells(), anonymous_namespace{EmbossJob.cpp}::CreateObjectJob::process(), Slic3r::PerimeterGenerator::process_classic(), Slic3r::Arachne::removeSmallAreas(), and Slic3r::ExclusionVolumePathChecker::segment_intersects_region().

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
324{
325 return filter_convex_concave_points_by_angle_threshold(this->points, angle_threshold, [](const Vec2d &v1, const Vec2d &v2){ return cross2(v1, v2) > 0.; });
326}

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

Referenced by Slic3r::GUI::GLGizmoBrimEars::generate_points(), and Slic3r::make_brim_ears_auto().

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

◆ densify()

void Slic3r::Polygon::densify ( float min_length,
std::vector< float > * lengths = nullptr )
382{
383 std::vector<float> lengths_local;
384 std::vector<float>& lengths = lengths_ptr ? *lengths_ptr : lengths_local;
385
386 if (! lengths_ptr) {
387 // Length parametrization has not been provided. Calculate our own.
388 lengths = this->parameter_by_length();
389 }
390
391 assert(points.size() == lengths.size() - 1);
392
393 for (size_t j=1; j<=points.size(); ++j) {
394 bool last = j == points.size();
395 int i = last ? 0 : j;
396
397 if (lengths[j] - lengths[j-1] > min_length) {
398 Point diff = points[i] - points[j-1];
399 float diff_len = lengths[j] - lengths[j-1];
400 float r = (min_length/diff_len);
401 Point new_pt = points[j-1] + Point(r*diff[0], r*diff[1]);
402 points.insert(points.begin() + j, new_pt);
403 lengths.insert(lengths.begin() + j, lengths[j-1] + min_length);
404 }
405 }
406 assert(points.size() == lengths.size() - 1);
407}
std::vector< float > parameter_by_length() const
Definition Polygon.cpp:371
Slic3r::Polygons diff(const Slic3r::Polygon &subject, const Slic3r::Polygon &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:731

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

Here is the call graph for this function:

◆ distance_to()

double Slic3r::MultiPoint::distance_to ( const Point & point) const
inlineinherited
80 {
81 const Point* cl = closest_point(point);
82 return (*cl - point).cast<double>().norm();
83 }
const Point * closest_point(const Point &point) const
Definition MultiPoint.hpp:77

References closest_point().

Here is the call graph for this function:

◆ douglas_peucker()

void Slic3r::Polygon::douglas_peucker ( double tolerance)
113{
114 this->points.push_back(this->points.front());
115 Points p = MultiPoint::_douglas_peucker(this->points, tolerance);
116 p.pop_back();
117 this->points = std::move(p);
118}
static Points _douglas_peucker(const Points &points, const double tolerance)
Definition MultiPoint.cpp:175

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

Here is the call graph for this function:

◆ empty()

◆ end() [1/2]

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

References points.

Referenced by append(), Slic3r::Polyline::append(), and Slic3r::generate_transform_pattern().

Here is the caller graph for this function:

◆ end() [2/2]

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

References points.

◆ equally_spaced_points()

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

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

Here is the call graph for this function:

◆ find_point() [1/2]

int Slic3r::MultiPoint::find_point ( const Point & point) const
inherited
70{
71 for (const Point &pt : this->points)
72 if (pt == point)
73 return int(&pt - &this->points.front());
74 return -1; // not found
75}

References points.

Referenced by find_point(), Slic3r::Polyline::split_at(), and Slic3r::Polyline::split_at_length().

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
78{
79 if (scaled_epsilon == 0) return this->find_point(point);
80
81 auto dist2_min = std::numeric_limits<double>::max();
82 auto eps2 = scaled_epsilon * scaled_epsilon;
83 int idx_min = -1;
84 for (const Point &pt : this->points) {
85 double d2 = (pt - point).cast<double>().squaredNorm();
86 if (d2 < dist2_min) {
87 idx_min = int(&pt - &this->points.front());
88 dist2_min = d2;
89 }
90 }
91 return dist2_min < eps2 ? idx_min : -1;
92}
int find_point(const Point &point) const
Definition MultiPoint.cpp:69

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

Here is the call graph for this function:

◆ first_intersection()

bool Slic3r::Polygon::first_intersection ( const Line & line,
Point * intersection ) const
184{
185 if (this->points.size() < 2)
186 return false;
187
188 bool found = false;
189 double dmin = 0.;
190 Line l(this->points.back(), this->points.front());
191 for (size_t i = 0; i < this->points.size(); ++ i) {
192 l.b = this->points[i];
193 Point ip;
194 if (l.intersection(line, &ip)) {
195 if (! found) {
196 found = true;
197 dmin = (line.a - ip).cast<double>().squaredNorm();
198 *intersection = ip;
199 } else {
200 double d = (line.a - ip).cast<double>().squaredNorm();
201 if (d < dmin) {
202 dmin = d;
203 *intersection = ip;
204 }
205 }
206 }
207 l.a = l.b;
208 }
209 return found;
210}
bool intersection(const Line &line, Point *intersection) const
Definition Polygon.cpp:171

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

Here is the call graph for this function:

◆ first_point()

◆ front()

const Point & Slic3r::MultiPoint::front ( ) const
inlineinherited
45{ return this->points.front(); }

Referenced by first_point(), Slic3r::Algorithm::merge_expansions_into_expolygons(), and Slic3r::precompute_expolygon_distances().

Here is the caller graph for this function:

◆ has_boundary_point()

bool Slic3r::MultiPoint::has_boundary_point ( const Point & point) const
inherited
95{
96 double dist = (point.projection_onto(*this) - point).cast<double>().norm();
97 return dist < SCALED_EPSILON;
98}
#define SCALED_EPSILON
Definition libslic3r.h:109
T dist(const boost::polygon::point_data< T > &p1, const boost::polygon::point_data< T > &p2)
Definition Geometry.cpp:298

References Slic3r::Geometry::dist(), Slic3r::Point::projection_onto(), and SCALED_EPSILON.

Here is the call graph for this function:

◆ has_duplicate_points()

bool Slic3r::MultiPoint::has_duplicate_points ( ) const
inherited
106{
107 for (size_t i = 1; i < points.size(); ++i)
108 if (points[i-1] == points[i])
109 return true;
110 return false;
111}

References 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
172{
173 if (this->points.size() < 2)
174 return false;
175 if (Line(this->points.front(), this->points.back()).intersection(line, intersection))
176 return true;
177 for (size_t i = 1; i < this->points.size(); ++ i)
178 if (Line(this->points[i - 1], this->points[i]).intersection(line, intersection))
179 return true;
180 return false;
181}

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

Referenced by first_intersection(), intersection(), and intersections().

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
213{
214 if (this->points.size() < 2)
215 return false;
216
217 size_t intersections_size = intersections->size();
218 Line l(this->points.back(), this->points.front());
219 for (size_t i = 0; i < this->points.size(); ++ i) {
220 l.b = this->points[i];
222 if (l.intersection(line, &intersection))
223 intersections->emplace_back(std::move(intersection));
224 l.a = l.b;
225 }
226 return intersections->size() > intersections_size;
227}
bool intersections(const Line &line, Points *intersections) const
Definition Polygon.cpp:212

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
90{
91 return !this->is_counter_clockwise();
92}
bool is_counter_clockwise() const
Definition Polygon.cpp:84

References is_counter_clockwise().

Referenced by Slic3r::ExtrusionLoop::is_clockwise(), Slic3r::ExtrusionLoop::make_counter_clockwise(), and Slic3r::sweep_ex().

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
85{
86 return this->area() >= 0.;
87}

References area().

Referenced by Slic3r::GCode::extrude_loop(), Slic3r::find_spiral_start_corner(), is_clockwise(), Slic3r::ExtrusionLoop::is_counter_clockwise(), Slic3r::ExtrusionLoop::make_clockwise(), make_clockwise(), make_counter_clockwise(), Slic3r::arrangement::process_arrangeable(), 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
69{ return this->points.size() >= 3; }

References Slic3r::MultiPoint::points.

Referenced by Slic3r::GCodeProcessor::check_multi_extruder_gcode_valid().

Here is the caller graph for this function:

◆ last_point()

const Point & Slic3r::Polygon::last_point ( ) const
inlinevirtual

Implements Slic3r::MultiPoint.

52{ return this->points.front(); }

References Slic3r::MultiPoint::points.

◆ length()

double Slic3r::Polygon::length ( ) const
25{
26 double l = 0;
27 if (this->points.size() > 1) {
28 l = (this->points.back() - this->points.front()).cast<double>().norm();
29 for (size_t i = 1; i < this->points.size(); ++ i)
30 l += (this->points[i] - this->points[i - 1]).cast<double>().norm();
31 }
32 return l;
33}

References Slic3r::MultiPoint::points.

Referenced by Slic3r::Print::_make_skirt().

Here is the caller graph for this function:

◆ lines()

Lines Slic3r::Polygon::lines ( ) const
virtual

Implements Slic3r::MultiPoint.

36{
37 return to_lines(*this);
38}
Lines to_lines(const ExPolygon &src)
Definition ExPolygon.hpp:124

References Slic3r::to_lines().

Here is the call graph for this function:

◆ make_clockwise()

bool Slic3r::Polygon::make_clockwise ( )
104{
105 if (this->is_counter_clockwise()) {
106 this->reverse();
107 return true;
108 }
109 return false;
110}
void reverse()
Definition MultiPoint.hpp:43

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

Referenced by Slic3r::create_polyholes().

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

◆ make_counter_clockwise()

bool Slic3r::Polygon::make_counter_clockwise ( )

◆ minimumDistanceBetweenLinesDefinedByPoints()

double Slic3r::MultiPoint::minimumDistanceBetweenLinesDefinedByPoints ( const Points & A,
const Points & B )
staticinherited

Calculates the minimum distance between two lines defined by sets of points.

Parameters
AThe first set of points defining a polyline.
BThe second set of points defining a polyline.
Returns
double The minimum distance between the two polylines.
414 {
415 double min_distance = std::numeric_limits<double>::infinity();
416
417 // Calculate the minimum distance between segments in A and points in B
418 for (size_t i = 0; i < A.size() - 1; ++i) {
419 for (const auto& b : B) {
420 double distance = squaredDistanceToLineSegment(b, A[i], A[i + 1]);
421 min_distance = std::min(min_distance, std::sqrt(distance));
422 }
423 }
424
425 // Calculate the minimum distance between segments in B and points in A
426 for (size_t i = 0; i < B.size() - 1; ++i) {
427 for (const auto& a : A) {
428 double distance = squaredDistanceToLineSegment(a, B[i], B[i + 1]);
429 min_distance = std::min(min_distance, std::sqrt(distance));
430 }
431 }
432
433 return min_distance;
434}
static double squaredDistanceToLineSegment(const Point &p, const Point &v, const Point &w)
Calculates the squared distance between a point and a line segment defined by two points.
Definition MultiPoint.cpp:393
float distance(SpiralVase::SpiralPoint a, SpiralVase::SpiralPoint b)
Definition SpiralVase.cpp:19

References squaredDistanceToLineSegment().

Here is the call graph for this function:

◆ new_scale()

Polygon Slic3r::Polygon::new_scale ( const std::vector< Vec2d > & points)
inlinestatic
38 {
39 Polygon pgn;
40 pgn.points.reserve(points.size());
41 for (const Vec2d &pt : points)
42 pgn.points.emplace_back(Point::new_scale(pt(0), pt(1)));
43 return pgn;
44 }
static Point new_scale(coordf_t x, coordf_t y)
Definition Point.hpp:214
Polygon()=default

References Polygon(), Slic3r::Point::new_scale(), and Slic3r::MultiPoint::points.

Referenced by Slic3r::BuildVolume::BuildVolume(), Slic3r::WipeTower2::WipeTower2(), Slic3r::GCodeProcessor::check_multi_extruder_gcode_valid(), Slic3r::GLVolumeCollection::check_wipe_tower_outside_state(), Slic3r::GUI::PartPlate::get_bounding_box_crd(), Slic3r::Print::get_extruder_printable_polygons(), Slic3r::Print::get_extruder_shared_printable_polygon(), Slic3r::Print::get_extruder_unprintable_polygons(), Slic3r::GUI::PartPlate::get_shared_printable_polygon(), Slic3r::make_counter_clockwise(), anonymous_namespace{OrcaSlicer_profile_validator.cpp}::place_wipe_tower(), Slic3r::GUI::Selection::scale_to_fit_print_volume(), Slic3r::GUI::Plater::priv::scaled_bed_shape_bb(), and Slic3r::GUI::Bed3D::update_bed_triangles().

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

◆ on_boundary()

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

References point_projection().

Referenced by Slic3r::anonymous_namespace{ClipperUtils.cpp}::path_encloses(), and Slic3r::anonymous_namespace{ExclusionVolumeTravelAvoidance.cpp}::point_on_expolygon_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
45{ points = other.points; return *this; }

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

Here is the call graph for this function:

◆ operator=() [2/2]

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

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

Here is the call graph for this function:

◆ operator[]() [1/2]

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

References Slic3r::MultiPoint::points.

◆ operator[]() [2/2]

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

References Slic3r::MultiPoint::points.

◆ overlaps()

bool Slic3r::Polygon::overlaps ( const Polygons & other) const
230{
231 if (this->empty() || other.empty())
232 return false;
233 Polylines pl_out = intersection_pl(to_polylines(other), *this);
234
235 // See unit test SCENARIO("Clipper diff with polyline", "[Clipper]")
236 // for in which case the intersection_pl produces any intersection.
237 return !pl_out.empty() ||
238 // If *this is completely inside other, then pl_out is empty, but the expolygons overlap. Test for that situation.
239 std::any_of(other.begin(), other.end(), [this](auto& poly) {return poly.contains(this->points.front()); });
240}
bool empty() const
Definition MultiPoint.hpp:51
Polylines to_polylines(const ExPolygon &src)
Definition ExPolygon.hpp:235
std::vector< Polyline > Polylines
Definition Polyline.hpp:22
Slic3r::Polylines intersection_pl(const Slic3r::Polylines &subject, const Slic3r::Polygon &clip)
Definition ClipperUtils.cpp:1111

References Slic3r::MultiPoint::empty(), Slic3r::intersection_pl(), and Slic3r::to_polylines().

Here is the call graph for this function:

◆ parameter_by_length()

std::vector< float > Slic3r::Polygon::parameter_by_length ( ) const
372{
373 // Parametrize the polygon by its length.
374 std::vector<float> lengths(points.size()+1, 0.);
375 for (size_t i = 1; i < points.size(); ++ i)
376 lengths[i] = lengths[i-1] + (points[i] - points[i-1]).cast<float>().norm();
377 lengths.back() = lengths[lengths.size()-2] + (points.front() - points.back()).cast<float>().norm();
378 return lengths;
379}

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
335{
336 Point proj = point;
337 double dmin = std::numeric_limits<double>::max();
338 if (! this->points.empty()) {
339 for (size_t i = 0; i < this->points.size(); ++ i) {
340 const Point &pt0 = this->points[i];
341 const Point &pt1 = this->points[(i + 1 == this->points.size()) ? 0 : i + 1];
342 double d = (point - pt0).cast<double>().norm();
343 if (d < dmin) {
344 dmin = d;
345 proj = pt0;
346 }
347 d = (point - pt1).cast<double>().norm();
348 if (d < dmin) {
349 dmin = d;
350 proj = pt1;
351 }
352 Vec2d v1(coordf_t(pt1(0) - pt0(0)), coordf_t(pt1(1) - pt0(1)));
353 coordf_t div = v1.squaredNorm();
354 if (div > 0.) {
355 Vec2d v2(coordf_t(point(0) - pt0(0)), coordf_t(point(1) - pt0(1)));
356 coordf_t t = v1.dot(v2) / div;
357 if (t > 0. && t < 1.) {
358 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)));
359 d = (point - foot).cast<double>().norm();
360 if (d < dmin) {
361 dmin = d;
362 proj = foot;
363 }
364 }
365 }
366 }
367 }
368 return proj;
369}
int64_t coord_t
Definition libslic3r.h:48
double coordf_t
Definition GUI_ObjectList.hpp:46

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

Referenced by on_boundary(), and Slic3r::ExPolygon::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
114{
115 size_t j = 0;
116 for (size_t i = 1; i < points.size(); ++i) {
117 if (points[j] == points[i]) {
118 // Just increase index i.
119 } else {
120 ++ j;
121 if (j < i)
122 points[j] = points[i];
123 }
124 }
125 if (++ j < points.size()) {
126 points.erase(points.begin() + j, points.end());
127 return true;
128 }
129 return false;
130}

References points.

Referenced by Slic3r::ExPolygonWithOffset::ExPolygonWithOffset(), libvgcode::convert_to_vertices(), libvgcode::convert_to_vertices(), libvgcode::convert_to_vertices(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::polylines_from_paths(), Slic3r::WipeTower::rib_section(), Slic3r::rounding_polygon(), Slic3r::WipeTower::rounding_polygon(), Slic3r::smooth_polyline_corners(), and Slic3r::traverse_graph_generate_polylines().

Here is the caller graph for this function:

◆ reverse()

void Slic3r::MultiPoint::reverse ( )
inlineinherited
43{ std::reverse(this->points.begin(), this->points.end()); }

Referenced by Slic3r::Polyline::append_before(), Slic3r::TreeSupport3D::calculateMachineBorderCollision(), anonymous_namespace{EmbossJob.cpp}::cut_surface_to_its(), Slic3r::Polygon::make_clockwise(), Slic3r::Polygon::make_counter_clockwise(), Slic3r::arrangement::process_arrangeable(), Slic3r::Polyline::reverse(), and Slic3r::sweep_ex().

Here is the caller graph for this function:

◆ rotate() [1/3]

void Slic3r::MultiPoint::rotate ( double angle)
inlineinherited
40{ this->rotate(cos(angle), sin(angle)); }
void rotate(double angle)
Definition MultiPoint.hpp:40
double angle(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:138

References Slic3r::angle(), and rotate().

Referenced by Slic3r::ExPolygonWithOffset::ExPolygonWithOffset(), Slic3r::ExPolygonWithOffset::ExPolygonWithOffset(), Slic3r::FillHoneycomb::_fill_surface_single(), Slic3r::Print::_make_wipe_tower(), Slic3r::GUI::PartPlate::estimate_wipe_tower_polygon(), Slic3r::get_arrange_poly(), Slic3r::GUI::PartPlate::imex_wipe_tower_hull(), Slic3r::layered_print_cleareance_valid(), anonymous_namespace{OrcaSlicer_profile_validator.cpp}::place_wipe_tower(), rotate(), 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
49{
50 double s = sin(angle);
51 double c = cos(angle);
52 for (Point &pt : points) {
53 Vec2crd v(pt - center);
54 pt(0) = (coord_t)round(double(center(0)) + c * v[0] - s * v[1]);
55 pt(1) = (coord_t)round(double(center(1)) + c * v[1] + s * v[0]);
56 }
57}
void center(ExPolygonsWithIds &e)
Definition Emboss.cpp:1382
Eigen::Matrix< coord_t, 2, 1, Eigen::DontAlign > Vec2crd
Definition Point.hpp:52

References Slic3r::angle(), Slic3r::center(), and points.

Here is the call graph for this function:

◆ rotate() [3/3]

void Slic3r::MultiPoint::rotate ( double cos_angle,
double sin_angle )
inherited
39{
40 for (Point &pt : this->points) {
41 double cur_x = double(pt(0));
42 double cur_y = double(pt(1));
43 pt(0) = coord_t(round(cos_angle * cur_x - sin_angle * cur_y));
44 pt(1) = coord_t(round(cos_angle * cur_y + sin_angle * cur_x));
45 }
46}

References points.

◆ scale() [1/2]

void Slic3r::MultiPoint::scale ( double factor)
inherited
18{
19 for (Point &pt : points)
20 pt *= factor;
21}

References points.

Referenced by Slic3r::TreeSupport3D::RichInterfacePlacer::add_points_along_lines(), 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
24{
25 for (Point &pt : points)
26 {
27 pt(0) = coord_t(pt(0) * factor_x);
28 pt(1) = coord_t(pt(1) * factor_y);
29 }
30}

References points.

◆ simplify()

Polygons Slic3r::Polygon::simplify ( double tolerance) const
121{
122 // Works on CCW polygons only, CW contour will be reoriented to CCW by Clipper's simplify_polygons()!
123 assert(this->is_counter_clockwise());
124
125 // repeat first point at the end in order to apply Douglas-Peucker
126 // on the whole polygon
127 Points points = this->points;
128 points.push_back(points.front());
130 p.points.pop_back();
131
132 Polygons pp;
133 pp.push_back(p);
134 return simplify_polygons(pp);
135}
Polygons simplify_polygons(const Polygons &subject)
Definition ClipperUtils.cpp:1303
std::vector< Polygon, PointsAllocator< Polygon > > Polygons
Definition Polygon.hpp:22

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

Referenced by Slic3r::PerimeterGenerator::process_no_bridge().

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

◆ size()

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

References points.

Referenced by Slic3r::BuildVolume::BuildVolume(), Slic3r::GCode::_do_export(), Slic3r::FillPlanePath::_fill_surface_single(), Slic3r::add_extra_point(), Slic3r::any_expolygon_contains(), Slic3r::Polyline::append_before(), Slic3r::PreciseSeam::detail::append_exact_fragment(), Slic3r::Polyline::append_fitting_result_after_append_polyline(), Slic3r::PreciseSeam::detail::append_fragment(), Slic3r::PreciseSeam::detail::append_projected_fragment(), Slic3r::PreciseSeam::detail::bind_fragment(), Slic3r::SeamPlacerImpl::calculate_polygon_angles_at_vertices(), Slic3r::Polyline::clip_end(), Slic3r::Fill::connect_base_support(), Slic3r::Fill::connect_infill(), Slic3r::FillAdaptive::connect_lines_using_hooks(), Slic3r::contour_distance(), Slic3r::Geometry::convex_polygons_intersect(), Slic3r::create_boundary_infill_graph(), Slic3r::GUI::ImGuiWrapper::draw(), Slic3r::TreeSupport3D::ensure_maximum_distance_polyline(), Slic3r::Polyline::equally_spaced_lines(), Slic3r::PreciseSeam::extract_perimeter_segments(), Slic3r::find_first_different_vertex(), Slic3r::generate_transform_pattern(), priv::get_closest_point_index(), Slic3r::ClipperUtils::interior_point(), Slic3r::PreciseSeam::detail::interval_on_edge(), anonymous_namespace{TextLines.cpp}::its_create_torus(), Slic3r::WipeTower::its_make_rib_brim(), Slic3r::WipeTower::its_make_rib_tower(), Slic3r::mark_boundary_segments_overlapping_infill(), Slic3r::move_inside_expoly(), Slic3r::nearest_clear_wipe_tower_anchor(), Slic3r::need_wipe(), anonymous_namespace{Emboss.cpp}::point_in_distance(), anonymous_namespace{Emboss.cpp}::point_in_distance(), anonymous_namespace{Emboss.cpp}::point_in_reverse_distance(), Slic3r::polygons_match(), Slic3r::precompute_polygon_distances(), Slic3r::PreciseSeam::prepare_weak_modifier_segments(), Slic3r::arrangement::process_arrangeable(), Slic3r::SeamPlacerImpl::process_perimeter_polygon(), Slic3r::GUI::MeshClipper::recalculate_triangles(), Slic3r::remove_duplicates(), Slic3r::remove_points_from_polygon(), Slic3r::Arachne::removeColinearEdges(), Slic3r::Arachne::removeDegenerateVerts(), Slic3r::FillLightning::Node::removeJunctionOverlap(), Slic3r::resample_polygon(), Slic3r::Polyline::reverse(), Slic3r::Arachne::simplify(), Slic3r::smooth_outward(), Slic3r::smooth_outward(), Slic3r::smooth_polyline_corners(), Slic3r::PreciseSeam::detail::snap_cuts_to_adjacent_vertices(), Slic3r::Polyline::split_at_index(), Slic3r::take(), Slic3r::take_limited(), priv::to_expoly(), Slic3r::to_polyline(), Slic3r::GCode::travel_to(), Slic3r::tree_supports_generate_paths(), Slic3r::triangulate_wall(), Slic3r::trim_loop(), and Slic3r::GUI::PartPlate::wipe_tower_obstacles().

◆ split_at_first_point()

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

References split_at_index().

Referenced by Slic3r::Print::_make_skirt(), Slic3r::ExtrusionLoop::as_polyline(), equally_spaced_points(), Slic3r::PerimeterGenerator::process_classic(), and Slic3r::traverse_loops().

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
52{
53 Polyline polyline;
54 if (this->points.empty())
55 return polyline;
56
57 polyline.points.reserve(this->points.size() + 1);
58 for (Points::const_iterator it = this->points.begin() + index; it != this->points.end(); ++it)
59 polyline.points.push_back(*it);
60 for (Points::const_iterator it = this->points.begin(); it != this->points.begin() + index + 1; ++it)
61 polyline.points.push_back(*it);
62 return polyline;
63}

References Slic3r::MultiPoint::points.

Referenced by Slic3r::open_loop(), Slic3r::remove_points_from_polygon(), 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
41{
42 // find index of point
43 for (const Point &pt : this->points)
44 if (pt == point)
45 return this->split_at_index(int(&pt - &this->points.front()));
46 throw Slic3r::InvalidArgument("Point not found");
47 return Polyline();
48}

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

Here is the call graph for this function:

◆ squaredDistanceToLineSegment()

double Slic3r::MultiPoint::squaredDistanceToLineSegment ( const Point & p,
const Point & v,
const Point & w )
staticprivateinherited

Calculates the squared distance between a point and a line segment defined by two points.

Parameters
pThe point.
vThe starting point of the line segment.
wThe ending point of the line segment.
Returns
double The squared distance between the point and the line segment.
393 {
394 // Calculate the squared length of the line segment
395 double l2 = (v - w).squaredNorm();
396 // If the segment is a single point, return the squared distance to that point
397 if (l2 == 0.0) return (p - v).squaredNorm();
398 // Project point p onto the line defined by v and w, and clamp the projection to the segment
399 double t = std::max(0.0, std::min(1.0, ((p - v).dot(w - v)) / l2));
400 // Compute the projection point
401 Point projection{v.x() + t * (w.x() - v.x()), v.y() + t * (w.y() - v.y())};
402 // Return the squared distance between the point and the projection
403 return (p - projection).squaredNorm();
404}
T l2(const boost::geometry::model::d2::point_xy< T > &v)
Definition ExtrusionSimulator.cpp:177
T dot(const boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
Definition ExtrusionSimulator.cpp:154

References Slic3r::dot(), and Slic3r::l2().

Referenced by minimumDistanceBetweenLinesDefinedByPoints().

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

◆ symmetric_y()

void Slic3r::MultiPoint::symmetric_y ( const coord_t & y_axis)
inherited
582{
583 for (Point &pt : points) {
584 pt(0) = 2 * x_axis - pt(0);
585 }
586}

References points.

◆ transform()

Polygon Slic3r::Polygon::transform ( const Transform3d & trafo) const
410{
411 unsigned int vertices_count = (unsigned int)points.size();
412 Polygon dstpoly;
413 dstpoly.points.resize(vertices_count);
414 if (vertices_count == 0)
415 return dstpoly;
416
417 unsigned int data_size = 3 * vertices_count * sizeof(float);
418
419 Eigen::MatrixXd src(3, vertices_count);
420 for (size_t i = 0; i < vertices_count; i++)
421 {
422 src.col(i) = Vec3d{ double(points[i].x()), double(points[i].y()),0. };
423 }
424
425 Eigen::MatrixXd dst(3, vertices_count);
426 dst = trafo * src.colwise().homogeneous();
427
428 for (size_t i = 0; i < vertices_count; i++)
429 {
430 dstpoly.points[i] = { dst(0,i),dst(1,i) };
431 }
432 return dstpoly;
433}
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68

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

Referenced by Slic3r::GUI::GLCanvas3D::get_empty_cells().

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

◆ translate() [1/2]

void Slic3r::MultiPoint::translate ( const Point & vector)
inherited
33{
34 for (Point &pt : points)
35 pt += v;
36}

References points.

◆ translate() [2/2]

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

References translate().

Referenced by Slic3r::Print::_make_wipe_tower(), Slic3r::TreeSupport3D::RichInterfacePlacer::add_points_along_lines(), Slic3r::anonymous_namespace{ExclusionVolumeGeometry.cpp}::append_active_footprints(), Slic3r::GCodeProcessor::check_multi_extruder_gcode_valid(), Slic3r::GUI::PartPlate::check_outside(), Slic3r::compacted_tower_print_instance_hull(), libvgcode::convert_to_vertices(), libvgcode::convert_to_vertices(), libvgcode::convert_to_vertices(), Slic3r::LinesBucket::curLines(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::_3DScene::extrusionentity_to_verts(), Slic3r::WipeTower::finish_layer_new(), Slic3r::TreeSupport3D::generate_support_areas(), Slic3r::generate_transform_pattern(), Slic3r::get_arrange_poly(), anonymous_namespace{Emboss.cpp}::heal_dupl_inter(), Slic3r::GUI::PartPlate::imex_wipe_tower_hull(), Slic3r::ExclusionVolumeTravelAvoidance::init(), Slic3r::layered_print_cleareance_valid(), Slic3r::make_gyroid_waves(), Slic3r::makeEndPoints(), Slic3r::makeZigZag(), Slic3r::GCode::needs_retraction(), translate(), Slic3r::AvoidCrossingPerimeters::travel_to(), Slic3r::GUI::PartPlate::update_exclusion_volume_preview_models(), and Slic3r::GUI::PartPlate::wipe_tower_obstacles().

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
139{
140 for (Points::const_iterator it = this->points.begin() + 2; it != this->points.end(); ++it) {
141 Polygon p;
142 p.points.reserve(3);
143 p.points.push_back(this->points.front());
144 p.points.push_back(*(it-1));
145 p.points.push_back(*it);
146
147 // this should be replaced with a more efficient call to a merge_collinear_segments() method
148 if (p.area() > 0) polygons->push_back(p);
149 }
150}

References Polygon(), 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
266{
267 // Make sure there's enough points in "pts" to bother with simplification.
268 assert(pts.size() >= 2);
269 // Result object
270 Points results;
271 // Lambda to calculate effective area spanned by a point and its immediate
272 // successor + predecessor.
273 auto effective_area = [pts](const size_t& curr_pt_idx, const size_t& prev_pt_idx, const size_t& next_pt_idx)->coordf_t {
274 const Point& curr = pts[curr_pt_idx];
275 const Point& prev = pts[prev_pt_idx];
276 const Point& next = pts[next_pt_idx];
277 // Use point objects as vector-distances
278 const Vec2d curr_to_next = (next - curr).cast<double>();
279 const Vec2d prev_to_next = (prev - curr).cast<double>();
280 // Take cross product of these two vector distances
281 return 0.50 * abs(cross2(curr_to_next, prev_to_next));
282 };
283 // We store the effective areas for each node
284 std::vector<coordf_t> areas;
285 areas.reserve(pts.size());
286 // Construct the initial set of nodes. We will make a heap out of the "heap" vector using
287 // std::make_heap. node_list is used later.
288 std::vector<vis_node*> node_list;
289 node_list.resize(pts.size());
290 std::vector<vis_node*> heap;
291 heap.reserve(pts.size());
292 for (size_t i = 1; i < pts.size() - 1; ++ i) {
293 // Get effective area of current node.
294 coordf_t area = effective_area(i, i - 1, i + 1);
295 // If area is greater than some arbitrarily small value, use it.
296 node_list[i] = new vis_node(i, i - 1, i + 1, area);
297 heap.push_back(node_list[i]);
298 }
299 // Call std::make_heap, which uses the < operator by default to make "heap" into
300 // a binheap, sorted by the < operator we defind in the vis_node struct
301 std::make_heap(heap.begin(), heap.end());
302 // Start comparing areas. Set min_area to an outrageous value initially.
303 double min_area = -std::numeric_limits<double>::max();
304 while (!heap.empty()) {
305 // Get current node.
306 vis_node* curr = heap.front();
307 // Pop node we just retrieved off the heap. pop_heap moves front element in vector
308 // to the back, so we can call pop_back()
309 std::pop_heap(heap.begin(), heap.end());
310 heap.pop_back();
311 // Sanity assert check
312 assert(curr == node_list[curr->pt_idx]);
313 // If the current pt'ss area is less than that of the previous pt's area
314 // use the last pt's area instead. This ensures we don't elimate the current
315 // point without eliminating the previous
316 min_area = std::max(min_area, curr->area);
317 // Update prev
318 vis_node* prev = node_list[curr->prev_idx];
319 if(prev != nullptr){
320 prev->next_idx = curr->next_idx;
321 prev->area = effective_area(prev->pt_idx, prev->prev_idx, prev->next_idx);
322 // For some reason, std::make_heap() is the fastest way to resort the heap. Probably needs testing.
323 std::make_heap(heap.begin(), heap.end());
324 }
325 // Update next
326 vis_node* next = node_list[curr->next_idx];
327 if(next != nullptr){
328 next->prev_idx = curr->prev_idx;
329 next->area = effective_area(next->pt_idx, next->prev_idx, next->next_idx);
330 std::make_heap(heap.begin(), heap.end());
331 }
332 areas[curr->pt_idx] = min_area;
333 node_list[curr->pt_idx] = nullptr;
334 delete curr;
335 }
336 // Clear node list and shrink_to_fit() (to free actual memory). Not necessary. Could be removed.
337 node_list.clear();
338 node_list.shrink_to_fit();
339 // This lambda is how we test whether or not to keep a point.
340 auto use_point = [areas, tolerance](const size_t& idx)->bool {
341 assert(idx < areas.size());
342 // Return true at front/back of path/areas
343 if(idx == 0 || idx == areas.size() - 1){
344 return true;
345 }
346 // Return true if area at idx is greater than minimum area to consider "valid"
347 else{
348 return areas[idx] > tolerance;
349 }
350 };
351 // Use previously defined lambda to build results.
352 for (size_t i = 0; i < pts.size(); ++i) {
353 if (use_point(i)){
354 results.push_back(pts[i]);
355 }
356 }
357 // Check that results has at least two points
358 assert(results.size() >= 2);
359 // Return simplified vector of points
360 return results;
361}
double area(const ExPolygon &poly)
Definition ExPolygon.hpp:511

References Slic3r::area(), Slic3r::vis_node::area, Slic3r::cast(), 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(), MultiPoint(), MultiPoint(), MultiPoint(), Slic3r::Polygon::Polygon(), Slic3r::Polygon::Polygon(), Slic3r::Polygon::Polygon(), Slic3r::Polyline::Polyline(), Slic3r::Polyline::Polyline(), Slic3r::Polyline::Polyline(), Slic3r::Polyline::Polyline(), Slic3r::GCode::_do_export(), Slic3r::FillConcentric::_fill_surface_single(), Slic3r::FillHoneycomb::_fill_surface_single(), Slic3r::FillPlanePath::_fill_surface_single(), Slic3r::Print::_make_skirt(), Slic3r::AreaMoments::add(), Slic3r::sla::ConcaveHull::add_connector_rectangles(), Slic3r::add_extra_point(), Slic3r::TreeSupport3D::RichInterfacePlacer::add_points_along_lines(), Slic3r::addTops(), Slic3r::any_expolygon_contains(), Slic3r::Polyline::append(), Slic3r::Polyline::append(), Slic3r::PreciseSeam::detail::append_exact_fragment(), Slic3r::Polyline::append_fitting_result_after_append_points(), Slic3r::anonymous_namespace{PrintConfig.cpp}::append_legacy_bed_exclude_regions(), Slic3r::append_path(), Slic3r::append_path_point(), Slic3r::append_path_point(), Slic3r::PreciseSeam::detail::append_projected_fragment(), Slic3r::WipeTowerIntegration::append_tcr(), Slic3r::WipeTowerIntegration::append_tcr2(), Slic3r::Feature::FuzzySkin::apply_fuzzy_skin(), Slic3r::Feature::FuzzySkin::apply_fuzzy_skin(), Slic3r::Polygon::area(), Slic3r::Polygon::area(), Slic3r::ExtrusionMultiPath::as_polyline(), Slic3r::MutablePolygon::assign(), Slic3r::bed_exclusion_arrange_polygon(), begin(), begin(), boost::polygon::polygon_traits< Slic3r::ExPolygon >::begin_points(), boost::polygon::polygon_traits< Slic3r::Polygon >::begin_points(), Slic3r::belt_brim_band_paths(), bounding_box(), Slic3r::Geometry::MedialAxis::build(), Slic3r::anonymous_namespace{ClipperUtils.cpp}::c2_attach_stray_holes(), Slic3r::anonymous_namespace{ClipperUtils.cpp}::c2_offset_expolygons(), Slic3r::SeamPlacerImpl::calculate_polygon_angles_at_vertices(), cbegin(), cend(), Slic3r::Polygon::centroid(), Slic3r::chain_lines(), Slic3r::chamfer_polygon(), Slic3r::ClipperUtils::clip_clipper_polygon_with_subject_bbox(), Slic3r::ClipperUtils::clip_clipper_polygon_with_subject_bbox(), Slic3r::Polyline::clip_end(), Slic3r::clip_inner_walls_over_top(), Slic3r::clip_path_end(), Slic3r::Polyline::clip_start(), Slic3r::colored_points_to_polygon(), Slic3r::compacted_tower_print_instance_hull(), Slic3r::Print::compacted_wipe_tower_clearance_valid(), Slic3r::compacted_wipe_tower_zone(), Slic3r::Polygon::concave_points(), Slic3r::WipeTower2::cone_base_polygon(), Slic3r::Fill::connect_base_support(), Slic3r::connect_brim_lines(), Slic3r::Fill::connect_infill(), Slic3r::Fill::connect_infill(), Slic3r::FillAdaptive::connect_lines_using_hooks(), Slic3r::TimelapsePosPicker::construct_printable_area_by_printer(), Slic3r::contains(), Slic3r::contour_distance(), Slic3r::anonymous_namespace{ExclusionVolumeTravelAvoidance.cpp}::contour_intersections(), Slic3r::contour_to_polygons(), Slic3r::Geometry::convex_hull(), Slic3r::ModelObject::convex_hull_2d(), Slic3r::Polygon::convex_points(), Slic3r::count_points(), Slic3r::EdgeGrid::Grid::create(), Slic3r::EdgeGrid::Grid::create(), Slic3r::create_boundary_infill_graph(), Slic3r::create_polyholes(), Slic3r::Polygon::densify(), Slic3r::diff(), Slic3r::diff_ex(), Slic3r::diff_ex(), Slic3r::diff_pl(), Slic3r::diff_pl(), Slic3r::Emboss::divide_segments_for_close_point(), Slic3r::Algorithm::do_split_line(), Slic3r::Polygon::douglas_peucker(), Slic3r::GUI::ImGuiWrapper::draw(), Slic3r::draw_perimeters(), Slic3r::emit_perimeter_prev_next_segment(), Slic3r::emit_perimeter_segment_on_vertical_line(), empty(), end(), end(), boost::polygon::polygon_traits< Slic3r::ExPolygon >::end_points(), boost::polygon::polygon_traits< Slic3r::Polygon >::end_points(), Slic3r::TreeSupport3D::ensure_maximum_distance_polyline(), Slic3r::Polyline::equally_spaced_lines(), Slic3r::Polyline::equally_spaced_points(), Slic3r::estimated_wipe_tower_footprint(), Slic3r::evaluate_support_arch_cost(), Slic3r::evaluate_support_arches(), Slic3r::executable_path_length(), Slic3r::ClipperZUtils::expolygons_to_zpaths(), Slic3r::Polyline::extend_end(), Slic3r::PreciseSeam::extract_perimeter_segments(), Slic3r::extrusion_polyline_extents(), priv::fill_polygon_distances(), priv::fill_shape_distances(), Slic3r::FillConcentricInternal::fill_surface_extrusion(), Slic3r::FillRectilinear::fill_surface_trapezoidal(), priv::find_close_point(), Slic3r::find_first_different_vertex(), find_point(), find_point(), Slic3r::find_spiral_start_corner(), Slic3r::Polygon::first_intersection(), Slic3r::from_json(), Slic3r::from_json(), Slic3r::WipeTowerIntegration::generate_path_to_wipe_tower(), Slic3r::GUI::GLGizmoBrimEars::generate_points(), Slic3r::generate_rectange_polygon(), Slic3r::generate_spiral_insets(), Slic3r::generate_transform_pattern(), Slic3r::generate_tree_support_3D(), Slic3r::get_arrange_poly(), Slic3r::get_bed_shape(), Slic3r::get_bed_shape(), Slic3r::get_bed_shape_with_excluded_area(), Slic3r::GUI::GLGizmoBrimEars::get_detection_radius_max(), Slic3r::get_extents(), Slic3r::get_extents_rotated(), anonymous_namespace{Emboss.cpp}::get_glyph(), Slic3r::SVG::get_path_d(), Slic3r::get_polygon_vertex_inward_normal(), Slic3r::get_polygon_vertex_offset(), Slic3r::GUI::GLGizmoPainterBase::get_projected_mouse_positions(), Slic3r::get_shared_poly(), Slic3r::get_svg_profile(), Slic3r::has_duplicate_points(), Slic3r::has_duplicate_points(), has_duplicate_points(), Slic3r::FillAdaptive::has_no_collinear_lines(), Slic3r::Wipe::has_path(), Slic3r::imex_hull_violates_zones(), Slic3r::GUI::PartPlate::imex_wipe_tower_hull(), Slic3r::ExclusionVolumeTravelAvoidance::init(), Slic3r::GUI::init_exclusion_volume_prism_model(), Slic3r::initial_connector_is_clear(), priv::insert_edges(), priv::insert_edges(), Slic3r::PreciseSeam::insert_point_into_perimeter(), Slic3r::ClipperUtils::interior_point(), Slic3r::intersection(), Slic3r::Polygon::intersection(), Slic3r::intersection_pl(), Slic3r::intersection_pl(), Slic3r::intersection_pl(), Slic3r::Polygon::intersections(), Slic3r::ModelInstance::intersects_bed_exclude_region(), Slic3r::PreciseSeam::detail::interval_on_edge(), Slic3r::Polyline::is_closed(), Slic3r::Polygon::is_valid(), Slic3r::SupportGridPattern::island_samples(), anonymous_namespace{TextLines.cpp}::its_create_torus(), Slic3r::WipeTower::its_make_rib_tower(), Slic3r::join_close_ends(), Slic3r::Polygon::last_point(), Slic3r::Polyline::last_point(), Slic3r::layered_print_cleareance_valid(), Slic3r::Polyline::leftmost_point(), Slic3r::Polygon::length(), Slic3r::length_off_reference(), Slic3r::Polyline::lines(), Slic3r::loop_clip_length(), Slic3r::make_adaptive_infill_shells(), Slic3r::make_adaptive_tpms(), Slic3r::make_brim_ears(), Slic3r::make_brim_ears_auto(), Slic3r::make_circle_num_segments(), Slic3r::GUI::GLGizmoBrimEars::make_polygon(), Slic3r::make_wave(), Slic3r::makeEndPoints(), Slic3r::makeZigZag(), Slic3r::mark_boundary_segments_overlapping_infill(), Slic3r::material_side_support_lines(), Slic3r::ExPolygon::medial_axis(), Slic3r::modulate_extrusion_by_overlapping_layers(), Slic3r::move_inside_expoly(), Slic3r::FillAdaptive::multiline_paths(), Slic3r::nearest_clear_wipe_tower_anchor(), Slic3r::GCode::needs_retraction(), Slic3r::Polygon::new_scale(), Slic3r::Polyline::new_scale(), Slic3r::offset(), Slic3r::offset(), Slic3r::offset(), Slic3r::offset_wipe_path(), Slic3r::offset_wipe_path_toward_support(), Slic3r::open_loop(), Slic3r::operator!=(), Slic3r::operator!=(), Slic3r::operator<<(), operator=(), operator=(), Slic3r::Polygon::operator=(), Slic3r::Polygon::operator=(), Slic3r::Polyline::operator=(), Slic3r::Polyline::operator=(), Slic3r::operator==(), Slic3r::operator==(), Slic3r::Polygon::operator[](), Slic3r::Polygon::operator[](), Slic3r::Polyline::operator[](), Slic3r::Polyline::operator[](), Slic3r::Polygon::parameter_by_length(), Slic3r::anonymous_namespace{PrintConfig.cpp}::parse_exclude_polygon_points(), Slic3r::anonymous_namespace{ClipperUtils.cpp}::path_encloses(), Slic3r::patternPoints(), Slic3r::Polygon::point_projection(), Slic3r::MutablePolygon::polygon(), Slic3r::WipeTowerWriter::polygon(), Slic3r::polygon_segment_append(), Slic3r::polygon_segment_append_reversed(), Slic3r::polygon_to_string(), Slic3r::polygons_match(), Slic3r::anonymous_namespace{ExclusionVolumeTravelAvoidance.cpp}::polyline_intersects_obstacles(), Slic3r::anonymous_namespace{ExclusionVolumeTravelAvoidance.cpp}::polyline_length(), Slic3r::polylines_from_paths(), Slic3r::precompute_polygon_distances(), Slic3r::PreciseSeam::prepare_weak_modifier_segments(), Slic3r::GUI::PartPlateList::preprocess_exclude_areas(), Slic3r::Geometry::MedialAxis::process_edge_neighbors(), Slic3r::SeamPlacerImpl::process_perimeter_polygon(), Slic3r::reconnect_polylines(), Slic3r::PreciseSeam::refine_at_vertex(), remove_duplicate_points(), Slic3r::remove_points_from_polygon(), Slic3r::remove_same_neighbor(), Slic3r::remove_same_neighbor(), anonymous_namespace{Emboss.cpp}::remove_spikes_in_duplicates(), anonymous_namespace{Emboss.cpp}::remove_when_spike(), Slic3r::Arachne::removeColinearEdges(), Slic3r::Arachne::removeDegenerateVerts(), Slic3r::FillLightning::Node::removeJunctionOverlap(), Slic3r::anonymous_namespace{ExclusionVolumeTravelAvoidance.cpp}::replace_segment(), Slic3r::anonymous_namespace{ExclusionVolumeTravelAvoidance.cpp}::replacement_matches_original_segment(), Slic3r::resample_polygon(), Slic3r::Polyline::reset_to_linear_move(), Slic3r::restore_source_path_order(), Slic3r::WipeTower::rib_section(), rotate(), rotate(), Slic3r::rounding_polygon(), Slic3r::WipeTower::rounding_polygon(), Slic3r::rounding_rectangle(), Slic3r::ExclusionVolumeTravelAvoidance::route(), Slic3r::anonymous_namespace{ExclusionVolumeTravelAvoidance.cpp}::routed_polyline_inside_bed(), Slic3r::sample_polyline_at_distance(), scale(), scale(), Slic3r::scale_polygon(), cereal::serialize(), boost::polygon::polygon_mutable_traits< Slic3r::ExPolygon >::set_points(), Slic3r::Model::setPrintSpeedTable(), Slic3r::Arachne::simplify(), Slic3r::Polygon::simplify(), Slic3r::Polyline::simplify(), Slic3r::Polyline::simplify_by_fitting_arc(), Slic3r::ExPolygon::simplify_p(), Slic3r::anonymous_namespace{ExclusionVolumeTravelAvoidance.cpp}::simplify_path(), Slic3r::Geometry::simplify_polygons(), boost::polygon::polygon_traits< Slic3r::ExPolygon >::size(), boost::polygon::polygon_traits< Slic3r::Polygon >::size(), size(), Slic3r::slice_region_by_vertical_lines(), Slic3r::smooth_polyline_corners(), Slic3r::PreciseSeam::detail::snap_cuts_to_adjacent_vertices(), Slic3r::solid_bodies(), Slic3r::Polyline::split_at(), Slic3r::Polygon::split_at_index(), Slic3r::Polyline::split_at_index(), Slic3r::Polyline::split_at_length(), Slic3r::Polygon::split_at_vertex(), Slic3r::Polyline::split_fitting_result_after_index(), Slic3r::Polyline::split_fitting_result_before_index(), Slic3r::ThickPolyline::start_at_index(), Slic3r::starts_by_backtracking(), Slic3r::store_wipe_path(), Slic3r::GUI::ImGuiWrapper::suggest_location(), Slic3r::support_offset_at_start(), Slic3r::sweep_ex(), symmetric_y(), 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::ThickPolyline::thicklines(), anonymous_namespace{NSVGUtils.cpp}::to_dashes(), Slic3r::to_json(), Slic3r::to_json(), Slic3r::to_linesf(), Slic3r::to_points(), Slic3r::to_points(), Slic3r::Arachne::to_polygon(), Slic3r::to_polygon(), Slic3r::Polyline3::to_polyline(), Slic3r::to_polyline(), Slic3r::to_polyline(), Slic3r::to_polylines(), Slic3r::to_polylines(), Slic3r::to_polylines(), Slic3r::to_polylines(), Slic3r::to_polylines(), Slic3r::Arachne::to_thick_polyline(), Slic3r::top_level_expolygons(), Slic3r::Arachne::ExtrusionLine::toPolygon(), Slic3r::Polygon::transform(), translate(), Slic3r::translated_wipe_path(), Slic3r::AvoidCrossingPerimeters::travel_to(), Slic3r::GCode::travel_to(), Slic3r::WipeTowerIntegration::travel_to_tower_gap(), Slic3r::traverse_graph_generate_polylines(), Slic3r::traverse_loops(), Slic3r::traverse_pt_outside_in(), Slic3r::tree_supports_generate_paths(), Slic3r::Triangulation::triangulate(), Slic3r::Polygon::triangulate_convex(), Slic3r::triangulate_wall(), Slic3r::anonymous_namespace{Model.cpp}::triangulated_prism_footprints(), Slic3r::trim_loop(), Slic3r::unscale_polygon(), Slic3r::GUI::GLCanvas3D::update_compacted_wipe_tower_clearance(), Slic3r::GUI::GLCanvas3D::update_sequential_clearance(), Slic3r::Print::validate_compacted_wipe_tower_clearance(), Slic3r::TreeSupport3D::validate_range(), Slic3r::variable_offset(), Slic3r::Wipe::wipe(), Slic3r::wipe_path_stays_on_material_side(), and Slic3r::wipe_path_support_score().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Polygon.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Polygon.cpp