New option for vertical distance between object and support material, with special handling of the 0 case that disabled bridge flow/speed in order to allow for soluble material. #2491 #2272 #2069 #1942 #2435 #1703

This commit is contained in:
Alessandro Ranellucci 2015-01-19 09:52:24 +01:00
parent fc5437f6d3
commit 7b980c1dc9
10 changed files with 57 additions and 16 deletions

View file

@ -55,13 +55,14 @@ sub slice {
# raise first object layer Z by the thickness of the raft itself
# plus the extra distance required by the support material logic
$print_z += $self->config->get_value('first_layer_height');
my $first_layer_height = $self->config->get_value('first_layer_height');
$print_z += $first_layer_height;
$print_z += $self->config->layer_height * ($self->config->raft_layers - 1);
# at this stage we don't know which nozzles are actually used for the first layer
# so we compute the average of all of them
my $nozzle_diameter = sum(@{$self->print->config->nozzle_diameter})/@{$self->print->config->nozzle_diameter};
my $distance = Slic3r::Print::SupportMaterial::contact_distance($nozzle_diameter);
my $distance = $self->_support_material->contact_distance($first_layer_height, $nozzle_diameter);
# force first layer print_z according to the contact distance
# (the loop below will raise print_z by such height)
@ -537,6 +538,14 @@ sub generate_support_material {
}
$self->print->status_cb->(85, "Generating support material");
$self->_support_material->generate($self);
$self->set_step_done(STEP_SUPPORTMATERIAL);
}
sub _support_material {
my ($self) = @_;
my $first_layer_flow = Slic3r::Flow->new_from_width(
width => ($self->config->first_layer_extrusion_width || $self->config->support_material_extrusion_width),
role => FLOW_ROLE_SUPPORT_MATERIAL,
@ -546,16 +555,13 @@ sub generate_support_material {
bridge_flow_ratio => 0,
);
my $s = Slic3r::Print::SupportMaterial->new(
return Slic3r::Print::SupportMaterial->new(
print_config => $self->print->config,
object_config => $self->config,
first_layer_flow => $first_layer_flow,
flow => $self->support_material_flow,
interface_flow => $self->support_material_flow(FLOW_ROLE_SUPPORT_MATERIAL_INTERFACE),
);
$s->generate($self);
$self->set_step_done(STEP_SUPPORTMATERIAL);
}
sub detect_surfaces_type {
@ -616,6 +622,11 @@ sub detect_surfaces_type {
S_TYPE_BOTTOMBRIDGE,
);
# if we have soluble support material, don't bridge
if ($self->config->support_material && $self->config->support_material_contact_distance == 0) {
$_->surface_type(S_TYPE_BOTTOM) for @bottom;
}
# if user requested internal shells, we need to identify surfaces
# lying on other slices not belonging to this region
if ($self->config->interface_shells) {

View file

@ -270,8 +270,7 @@ sub contact_area {
@{$layer->regions};
my $nozzle_diameter = sum(@nozzle_diameters)/@nozzle_diameters;
my $contact_z = $layer->print_z - contact_distance($nozzle_diameter);
###$contact_z = $layer->print_z - $layer->height;
my $contact_z = $layer->print_z - $self->contact_distance($layer->height, $nozzle_diameter);
# ignore this contact area if it's too low
next if $contact_z < $self->object_config->get_value('first_layer_height');
@ -339,12 +338,13 @@ sub support_layers_z {
# layer_height > nozzle_diameter * 0.75
my $nozzle_diameter = $self->print_config->get_at('nozzle_diameter', $self->object_config->support_material_extruder-1);
my $support_material_height = max($max_object_layer_height, $nozzle_diameter * 0.75);
my $contact_distance = $self->contact_distance($support_material_height, $nozzle_diameter);
# initialize known, fixed, support layers
my @z = sort { $a <=> $b }
@$contact_z,
@$top_z, # TODO: why we have this?
(map $_ + contact_distance($nozzle_diameter), @$top_z);
(map $_ + $contact_distance, @$top_z);
# enforce first layer height
my $first_layer_height = $self->object_config->get_value('first_layer_height');
@ -906,10 +906,15 @@ sub overlapping_layers {
} 0..$#$support_z;
}
# class method
sub contact_distance {
my ($nozzle_diameter) = @_;
return $nozzle_diameter * 1.5;
my ($self, $layer_height, $nozzle_diameter) = @_;
my $extra = $self->object_config->support_material_contact_distance;
if ($extra == 0) {
return $layer_height;
} else {
return $nozzle_diameter + $extra;
}
}
1;