From 8e0d458d1d7e646e75d34d7fcb8c19d2215143e8 Mon Sep 17 00:00:00 2001 From: Vicious-one Date: Wed, 30 Sep 2015 16:22:49 +0300 Subject: [PATCH] Fix for #3069 --- xs/src/libslic3r/GCode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index 51093667a..f1fe42817 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -2,6 +2,7 @@ #include "ExtrusionEntity.hpp" #include #include +#include namespace Slic3r { @@ -400,7 +401,7 @@ GCode::extrude(ExtrusionLoop loop, std::string description, double speed) Polygon polygon = loop.polygon(); Point centroid = polygon.centroid(); last_pos = Point(polygon.bounding_box().max.x, centroid.y); - last_pos.rotate(rand() % 2*PI, centroid); + last_pos.rotate(fmod((float)rand()/16.0, 2.0*PI), centroid); } loop.split_at(last_pos); }