Merge branch 'master' into new-support2

new-support2
Alessandro Ranellucci 2013-06-20 14:36:33 +02:00
commit b5fac0c65f
3 changed files with 18 additions and 16 deletions

View File

@ -247,7 +247,9 @@ sub load_config_file {
$Slic3r::GUI::Settings->{recent}{config_directory} = dirname($file);
Slic3r::GUI->save_settings;
$last_config = $file;
$_->load_config_file($file) for values %{$self->{options_tabs}};
for my $tab (values %{$self->{options_tabs}}) {
$tab->load_config_file($file);
}
}
sub load_config {
@ -265,7 +267,9 @@ sub config_wizard {
return unless $self->check_unsaved_changes;
if (my $config = Slic3r::GUI::ConfigWizard->new($self)->run) {
if ($self->{mode} eq 'expert') {
$_->select_default_preset for values %{$self->{options_tabs}};
for my $tab (values %{$self->{options_tabs}}) {
$tab->select_default_preset;
}
}
$self->load_config($config);
}

View File

@ -266,7 +266,8 @@ sub make_perimeters {
$role = EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER;
}
if ($self->id > 0) {
### Disable overhang detection for now
if (0 && $self->id > 0) {
# A perimeter is considered overhang if its centerline exceeds the lower layer slices
my $is_overhang = $is_contour
? @{diff([$polygon], \@lower_slices)}

View File

@ -188,10 +188,16 @@ sub validate {
# check vertical clearance
{
my @obj_copies = $self->object_copies;
pop @obj_copies; # ignore the last copy: its height doesn't matter
my $scaled_clearance = scale $Slic3r::Config->extruder_clearance_height;
if (grep { +($_->size)[Z] > $scaled_clearance } map @{$self->objects->[$_->[0]]->meshes}, @obj_copies) {
my @object_height = ();
foreach my $object (@{$self->objects}) {
my $height = $object->size->[Z];
push @object_height, $height for @{$object->copies};
}
@object_height = sort { $a <=> $b } @object_height;
# ignore the tallest *copy* (this is why we repeat height for all of them):
# it will be printed as last one so its height doesn't matter
pop @object_height;
if (@object_height && max(@object_height) > scale $Slic3r::Config->extruder_clearance_height) {
die "Some objects are too tall and cannot be printed without extruder collisions.\n";
}
}
@ -265,15 +271,6 @@ sub init_extruders {
}
}
sub object_copies {
my $self = shift;
my @oc = ();
for my $obj_idx (0 .. $#{$self->objects}) {
push @oc, map [ $obj_idx, $_ ], @{$self->objects->[$obj_idx]->copies};
}
return @oc;
}
sub layer_count {
my $self = shift;
return max(map { scalar @{$_->layers} } @{$self->objects});