Put skirt outside brim to avoid conflicts. #2157

This commit is contained in:
Alessandro Ranellucci 2014-07-24 23:43:19 +02:00
parent 86bad17abb
commit 7aaf27c0c7
4 changed files with 6 additions and 11 deletions

View File

@ -47,7 +47,7 @@ sub new {
my ($parent) = @_;
my $self = $class->SUPER::new($parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
$self->{config} = Slic3r::Config->new_from_defaults(qw(
bed_shape complete_objects extruder_clearance_radius skirts skirt_distance
bed_shape complete_objects extruder_clearance_radius skirts skirt_distance brim_width
));
$self->{model} = Slic3r::Model->new;
$self->{print} = Slic3r::Print->new;

View File

@ -166,7 +166,7 @@ sub repaint {
if (@{$self->{objects}} && $self->{config}->skirts) {
my @points = map @{$_->contour}, map @$_, map @{$_->instance_thumbnails}, @{$self->{objects}};
if (@points >= 3) {
my ($convex_hull) = @{offset([convex_hull(\@points)], scale($self->{config}->skirt_distance), 1, JT_ROUND, scale(0.1))};
my ($convex_hull) = @{offset([convex_hull(\@points)], scale max($self->{config}->brim_width + $self->{config}->skirt_distance), 1, JT_ROUND, scale(0.1))};
$dc->SetPen($self->{skirt_pen});
$dc->SetBrush($self->{transparent_brush});
$dc->DrawPolygon($self->scaled_points_to_pixel($convex_hull, 1), 0, 0);

View File

@ -384,11 +384,11 @@ sub total_bounding_box {
if ($self->has_support_material) {
$extra = &Slic3r::Print::SupportMaterial::MARGIN;
}
$extra = max($extra, $self->config->brim_width);
if ($self->config->skirts > 0) {
my $skirt_flow = $self->skirt_flow;
$extra = max($extra, $self->config->skirt_distance + ($self->config->skirts * $skirt_flow->spacing));
$extra = max($extra, $self->config->brim_width + $self->config->skirt_distance + ($self->config->skirts * $skirt_flow->spacing));
}
$extra = max($extra, $self->config->brim_width);
if ($extra > 0) {
$bb->offset(scale $extra);
@ -638,7 +638,7 @@ sub make_skirt {
# draw outlines from outside to inside
# loop while we have less skirts than required or any extruder hasn't reached the min length if any
my $distance = scale $self->config->skirt_distance;
my $distance = scale max($self->config->skirt_distance, $self->config->brim_width);
for (my $i = $self->config->skirts; $i > 0; $i--) {
$distance += scale $spacing;
my $loop = offset([$convex_hull], $distance, 1, JT_ROUND, scale(0.1))->[0];
@ -723,12 +723,6 @@ sub make_brim {
}
}
# if brim touches skirt, make it around skirt too
# TODO: calculate actual skirt width (using each extruder's flow in multi-extruder setups)
if ($self->config->skirt_distance + (($self->config->skirts - 1) * $flow->spacing) <= $self->config->brim_width) {
push @islands, map @{$_->polygon->split_at_first_point->grow($grow_distance)}, @{$self->skirt};
}
my @loops = ();
my $num_loops = sprintf "%.0f", $self->config->brim_width / $flow->width;
for my $i (reverse 1 .. $num_loops) {

View File

@ -425,6 +425,7 @@ Print::invalidate_state_by_config_options(const std::vector<t_config_option_key>
steps.insert(psSkirt);
} else if (*opt_key == "brim_width") {
steps.insert(psBrim);
steps.insert(psSkirt);
} else if (*opt_key == "nozzle_diameter") {
steps.insert(psInitExtruders);
} else if (*opt_key == "avoid_crossing_perimeters"