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
|
||||
$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
|
||||
$directions_avg_length{$angle} = @lengths ? (max(@lengths)) : -1;
|
||||
}
|
||||
|
@ -241,13 +245,11 @@ sub unsupported_edges {
|
|||
$grown_lower,
|
||||
);
|
||||
|
||||
# filter out edges parallel to the bridging angle
|
||||
for (my $i = 0; $i <= $#$unsupported; ++$i) {
|
||||
if ($unsupported->[$i]->is_straight && abs($unsupported->[$i]->lines->[0]->direction < $angle) < epsilon) {
|
||||
splice @$unsupported, $i, 1;
|
||||
--$i;
|
||||
}
|
||||
}
|
||||
# split into individual segments and filter out edges parallel to the bridging angle
|
||||
@$unsupported = map $_->as_polyline,
|
||||
grep { abs($_->direction - $angle) < epsilon }
|
||||
map @{$_->lines},
|
||||
@$unsupported;
|
||||
|
||||
if (0) {
|
||||
require "Slic3r/SVG.pm";
|
||||
|
|
|
@ -146,8 +146,8 @@ sub contact_area {
|
|||
) if $d > $fw/2;
|
||||
} else {
|
||||
$diff = diff(
|
||||
offset([ map $_->p, @{$layerm->slices} ], -$fw/2),
|
||||
[ map @$_, @{$lower_layer->slices} ],
|
||||
[ map $_->p, @{$layerm->slices} ],
|
||||
offset([ map @$_, @{$lower_layer->slices} ], +$fw*2),
|
||||
);
|
||||
|
||||
# collapse very tiny spots
|
||||
|
|
Loading…
Reference in New Issue