mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-08 14:38:58 +08:00
Additional check to return a friendly error when binary STL is not valid
This commit is contained in:
parent
eca6d0b6d0
commit
47bbe18de2
@ -391,7 +391,7 @@ sub validate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($Slic3r::flow_width >= ($Slic3r::nozzle_diameter + $Slic3r::layer_height)) {
|
if ($Slic3r::flow_width >= ($Slic3r::nozzle_diameter + $Slic3r::layer_height)) {
|
||||||
# rectangle with shrunk at the ends
|
# rectangle with semicircles at the ends
|
||||||
$Slic3r::min_flow_spacing = $Slic3r::flow_width - $Slic3r::layer_height * (1 - PI/4);
|
$Slic3r::min_flow_spacing = $Slic3r::flow_width - $Slic3r::layer_height * (1 - PI/4);
|
||||||
} else {
|
} else {
|
||||||
# rectangle with shrunk semicircles at the ends
|
# rectangle with shrunk semicircles at the ends
|
||||||
|
@ -22,6 +22,7 @@ sub read_file {
|
|||||||
seek $fh, 80, 0;
|
seek $fh, 80, 0;
|
||||||
read $fh, my $buf, 4;
|
read $fh, my $buf, 4;
|
||||||
my $triangle_count = unpack 'L', $buf;
|
my $triangle_count = unpack 'L', $buf;
|
||||||
|
die "STL file seems invalid, could not read facet count\n" if !defined $triangle_count;
|
||||||
my $expected_size =
|
my $expected_size =
|
||||||
+ 80 # header
|
+ 80 # header
|
||||||
+ 4 # count
|
+ 4 # count
|
||||||
|
Loading…
x
Reference in New Issue
Block a user