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/libslic3r/MultiPoint.cpp')
-rw-r--r--xs/src/libslic3r/MultiPoint.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/xs/src/libslic3r/MultiPoint.cpp b/xs/src/libslic3r/MultiPoint.cpp
index ff2771cff..1e1895634 100644
--- a/xs/src/libslic3r/MultiPoint.cpp
+++ b/xs/src/libslic3r/MultiPoint.cpp
@@ -31,6 +31,20 @@ MultiPoint::translate(const Point &vector)
}
void
+MultiPoint::rotate(double angle)
+{
+ double s = sin(angle);
+ double c = cos(angle);
+ for (Points::iterator it = points.begin(); it != points.end(); ++it) {
+ (*it).rotate(angle);
+ double cur_x = (double)it->x;
+ double cur_y = (double)it->y;
+ it->x = (coord_t)round(c * cur_x - s * cur_y);
+ it->y = (coord_t)round(c * cur_y + s * cur_x);
+ }
+}
+
+void
MultiPoint::rotate(double angle, const Point &center)
{
for (Points::iterator it = points.begin(); it != points.end(); ++it) {