diff --git a/xs/src/libslic3r/Point.cpp b/xs/src/libslic3r/Point.cpp index 9a4a71ac2..465f78db8 100644 --- a/xs/src/libslic3r/Point.cpp +++ b/xs/src/libslic3r/Point.cpp @@ -18,6 +18,11 @@ Point::operator==(const Point& rhs) const return this->coincides_with(rhs); } +Point +Point::new_scale(Pointf p) { + return Point(scale_(p.x), scale_(p.y)); +} + std::string Point::wkt() const { diff --git a/xs/src/libslic3r/Point.hpp b/xs/src/libslic3r/Point.hpp index 57a9ef7e8..3c0b5f299 100644 --- a/xs/src/libslic3r/Point.hpp +++ b/xs/src/libslic3r/Point.hpp @@ -36,6 +36,9 @@ class Point static Point new_scale(coordf_t x, coordf_t y) { return Point(scale_(x), scale_(y)); }; + + /// Scale and create a Point from a Pointf. + static Point new_scale(Pointf p); bool operator==(const Point& rhs) const; std::string wkt() const; std::string dump_perl() const;