mirror of https://github.com/vitalif/Slic3r
Fixed one typo in BridgeDetector and some improvements to support material
parent
edeb0a90dd
commit
4311f30739
|
@ -129,6 +129,10 @@ sub detect_angle {
|
||||||
# sum length of bridged lines
|
# sum length of bridged lines
|
||||||
$directions_coverage{$angle} = sum(@lengths) // 0;
|
$directions_coverage{$angle} = sum(@lengths) // 0;
|
||||||
|
|
||||||
|
### The following produces more correct results in some cases and more broken in others.
|
||||||
|
### TODO: investigate, as it looks more reliable than line clipping.
|
||||||
|
###$directions_coverage{$angle} = sum(map $_->area, @{$self->coverage($angle)}) // 0;
|
||||||
|
|
||||||
# max length of bridged lines
|
# max length of bridged lines
|
||||||
$directions_avg_length{$angle} = @lengths ? (max(@lengths)) : -1;
|
$directions_avg_length{$angle} = @lengths ? (max(@lengths)) : -1;
|
||||||
}
|
}
|
||||||
|
@ -241,13 +245,11 @@ sub unsupported_edges {
|
||||||
$grown_lower,
|
$grown_lower,
|
||||||
);
|
);
|
||||||
|
|
||||||
# filter out edges parallel to the bridging angle
|
# split into individual segments and filter out edges parallel to the bridging angle
|
||||||
for (my $i = 0; $i <= $#$unsupported; ++$i) {
|
@$unsupported = map $_->as_polyline,
|
||||||
if ($unsupported->[$i]->is_straight && abs($unsupported->[$i]->lines->[0]->direction < $angle) < epsilon) {
|
grep { abs($_->direction - $angle) < epsilon }
|
||||||
splice @$unsupported, $i, 1;
|
map @{$_->lines},
|
||||||
--$i;
|
@$unsupported;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
require "Slic3r/SVG.pm";
|
require "Slic3r/SVG.pm";
|
||||||
|
|
|
@ -146,8 +146,8 @@ sub contact_area {
|
||||||
) if $d > $fw/2;
|
) if $d > $fw/2;
|
||||||
} else {
|
} else {
|
||||||
$diff = diff(
|
$diff = diff(
|
||||||
offset([ map $_->p, @{$layerm->slices} ], -$fw/2),
|
[ map $_->p, @{$layerm->slices} ],
|
||||||
[ map @$_, @{$lower_layer->slices} ],
|
offset([ map @$_, @{$lower_layer->slices} ], +$fw*2),
|
||||||
);
|
);
|
||||||
|
|
||||||
# collapse very tiny spots
|
# collapse very tiny spots
|
||||||
|
|
Loading…
Reference in New Issue