From bc4b4a981b8dde757cc63b4416e4d7f029fbae75 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 29 May 2012 09:38:53 +0200 Subject: [PATCH] Take extruder clearance radius into account when autopositioning --- lib/Slic3r/Print.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 536753317..e6ef12db1 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -164,8 +164,14 @@ sub arrange_objects { $partx = $object->x_length if $object->x_length > $partx; $party = $object->y_length if $object->y_length > $party; } + + # object distance is max(duplicate_distance, clearance_radius) + my $distance = $Slic3r::complete_objects && $Slic3r::extruder_clearance_radius > $Slic3r::duplicate_distance + ? $Slic3r::extruder_clearance_radius + : $Slic3r::duplicate_distance; + my @positions = Slic3r::Geometry::arrange - ($total_parts, $partx, $party, (map scale $_, @$Slic3r::bed_size), scale $Slic3r::duplicate_distance); + ($total_parts, $partx, $party, (map scale $_, @$Slic3r::bed_size), scale $distance); for my $obj_idx (0..$#{$self->objects}) { @{$self->copies->[$obj_idx]} = splice @positions, 0, scalar @{$self->copies->[$obj_idx]};