Scale bounding_box by sqrt(2) in honeycomb too to ensure it will cover the object even after rotation, like we already did for Rectilinear

This commit is contained in:
Alessandro Ranellucci 2013-05-19 11:25:18 +02:00
parent b5b0c2cc89
commit 627debf284

View File

@ -38,10 +38,12 @@ sub fill_surface {
# adjust actual bounding box to the nearest multiple of our hex pattern
# and align it so that it matches across layers
my $bounding_box = [ @{$self->bounding_box} ]; # clone
$bounding_box->[$_] = 0 for X1, Y1;
{
my $bb_polygon = Slic3r::Polygon->new_from_bounding_box($bounding_box);
$bb_polygon->scale(sqrt 2);
$bb_polygon->rotate($rotate_vector->[0][0], $hex_center);
$bounding_box = [ Slic3r::Geometry::bounding_box($bb_polygon) ];
# $bounding_box->[X1] and [Y1] represent the displacement between new bounding box offset and old one