Bugfix: fatal error when medial axis produced poor results. #178

This commit is contained in:
Alessandro Ranellucci 2012-02-19 17:11:18 +01:00
parent 94a2585b97
commit 27a6b3a851

View File

@ -253,6 +253,7 @@ sub medial_axis {
Slic3r::Geometry::polyline_remove_parallel_continuous_edges($polyline); Slic3r::Geometry::polyline_remove_parallel_continuous_edges($polyline);
if (Slic3r::Geometry::same_point($polyline->[0], $polyline->[-1])) { if (Slic3r::Geometry::same_point($polyline->[0], $polyline->[-1])) {
return undef if @$polyline == 2;
return Slic3r::Polygon->new(@$polyline[0..$#$polyline-1]); return Slic3r::Polygon->new(@$polyline[0..$#$polyline-1]);
} else { } else {
return Slic3r::Polyline->new($polyline); return Slic3r::Polyline->new($polyline);