Workaround Clipper changing point coordinates while performing simplify_polygons(), thus causing a crash in Slic3r.

This commit is contained in:
Alessandro Ranellucci 2014-11-08 12:56:14 +01:00
parent a78be203aa
commit 9c93e52c8f
4 changed files with 14 additions and 7 deletions
lib/Slic3r

View file

@ -148,12 +148,19 @@ sub extrude_loop {
if ($self->config->seam_position eq 'nearest') {
@candidates = @$polygon if !@candidates;
$point = $last_pos->nearest_point(\@candidates);
$loop->split_at_vertex($point);
if (!$loop->split_at_vertex($point)) {
# On 32-bit Linux, Clipper will change some point coordinates by 1 unit
# while performing simplify_polygons(), thus split_at_vertex() won't
# find them anymore.
$loop->split_at($point);
}
} elsif (@candidates) {
my @non_overhang = grep !$loop->has_overhang_point($_), @candidates;
@candidates = @non_overhang if @non_overhang;
$point = $last_pos->nearest_point(\@candidates);
$loop->split_at_vertex($point);
if (!$loop->split_at_vertex($point)) {
$loop->split_at($point);
}
} else {
$point = $last_pos->projection_onto_polygon($polygon);
$loop->split_at($point);