mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
Bugfix: removed fatal error when generating SVG support material in some circumstances. #673
This commit is contained in:
@@ -242,6 +242,7 @@ sub polygon_lines {
|
|||||||
sub nearest_point {
|
sub nearest_point {
|
||||||
my ($point, $points) = @_;
|
my ($point, $points) = @_;
|
||||||
my $index = nearest_point_index(@_);
|
my $index = nearest_point_index(@_);
|
||||||
|
return undef if !defined $index;
|
||||||
return $points->[$index];
|
return $points->[$index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -462,7 +462,8 @@ EOF
|
|||||||
foreach my $expolygon (@unsupported_slices) {
|
foreach my $expolygon (@unsupported_slices) {
|
||||||
# look for the nearest point to this island among all
|
# look for the nearest point to this island among all
|
||||||
# supported points
|
# supported points
|
||||||
my $support_point = nearest_point($expolygon->contour->[0], \@supported_points);
|
my $support_point = nearest_point($expolygon->contour->[0], \@supported_points)
|
||||||
|
or next;
|
||||||
my $anchor_point = nearest_point($support_point, $expolygon->contour->[0]);
|
my $anchor_point = nearest_point($support_point, $expolygon->contour->[0]);
|
||||||
printf $fh qq{ <line x1="%s" y1="%s" x2="%s" y2="%s" style="stroke-width: 2; stroke: white" />\n},
|
printf $fh qq{ <line x1="%s" y1="%s" x2="%s" y2="%s" style="stroke-width: 2; stroke: white" />\n},
|
||||||
map @$_, $support_point, $anchor_point;
|
map @$_, $support_point, $anchor_point;
|
||||||
|
|||||||
Reference in New Issue
Block a user