From 67d7658c59e66443a39d859d6c37bcfc1dc257ad Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 29 Dec 2014 14:42:41 +0100 Subject: [PATCH] Bugfix: random misalignment of the 3D Honeycomb pattern --- lib/Slic3r/Fill/3DHoneycomb.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/Fill/3DHoneycomb.pm b/lib/Slic3r/Fill/3DHoneycomb.pm index 2564377078..b24caf49ac 100644 --- a/lib/Slic3r/Fill/3DHoneycomb.pm +++ b/lib/Slic3r/Fill/3DHoneycomb.pm @@ -19,12 +19,14 @@ sub fill_surface { my $distance = scale($self->spacing) / $params{density}; - # align bounding box to a multiple of our honeycomb grid + # align bounding box to a multiple of our honeycomb grid module + # (a module is 2*$distance since one $distance half-module is + # growing while the other $distance half-module is shrinking) { my $min = $bb->min_point; $min->translate( - -($bb->x_min % $distance), - -($bb->y_min % $distance), + -($bb->x_min % (2*$distance)), + -($bb->y_min % (2*$distance)), ); $bb->merge_point($min); }