Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'xs/src/PolylineCollection.cpp')
-rw-r--r--xs/src/PolylineCollection.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/xs/src/PolylineCollection.cpp b/xs/src/PolylineCollection.cpp
index 34eebf580..6cd9175c3 100644
--- a/xs/src/PolylineCollection.cpp
+++ b/xs/src/PolylineCollection.cpp
@@ -41,4 +41,15 @@ PolylineCollection::chained_path_from(const Point* start_near, bool no_reverse)
return retval;
}
+Point*
+PolylineCollection::leftmost_point() const
+{
+ const Point* p = NULL;
+ for (Polylines::const_iterator it = this->polylines.begin(); it != this->polylines.end(); ++it) {
+ if (p == NULL || it->points.front().x < p->x)
+ p = &(it->points.front());
+ }
+ return new Point (*p);
+}
+
}