Fixed one typo in BridgeDetector and some improvements to support material

visilibity
Alessandro Ranellucci 2014-05-01 19:11:53 +02:00
parent edeb0a90dd
commit 4311f30739
2 changed files with 12 additions and 10 deletions

View File

@ -128,7 +128,11 @@ 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";

View File

@ -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