mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-06 13:34:05 -06:00
Merged with dev
This commit is contained in:
commit
0235f1a821
1491 changed files with 514153 additions and 29226 deletions
|
@ -35,7 +35,12 @@ sub run_post_process_scripts {
|
|||
die "The configured post-processing script is not executable: check permissions. ($script)\n";
|
||||
}
|
||||
if ($^O eq 'MSWin32' && $script =~ /\.[pP][lL]/) {
|
||||
system($^X, $script, $output_file);
|
||||
# The current process (^X) may be slic3r.exe or slic3r-console.exe.
|
||||
# Replace it with the current perl interpreter.
|
||||
my($filename, $directories, $suffix) = fileparse($^X);
|
||||
$filename =~ s/^slic3r.*$/perl5\.24\.0\.exe/;
|
||||
my $interpreter = $directories . $filename;
|
||||
system($interpreter, $script, $output_file);
|
||||
} else {
|
||||
system($script, $output_file);
|
||||
}
|
||||
|
@ -43,13 +48,37 @@ sub run_post_process_scripts {
|
|||
}
|
||||
}
|
||||
|
||||
sub export_png {
|
||||
my $self = shift;
|
||||
my %params = @_;
|
||||
|
||||
my @sobjects = @{$self->objects};
|
||||
my $objnum = scalar @sobjects;
|
||||
for(my $oi = 0; $oi < $objnum; $oi++)
|
||||
{
|
||||
$sobjects[$oi]->slice;
|
||||
$self->status_cb->(($oi + 1)*100/$objnum - 1, "Slicing...");
|
||||
}
|
||||
|
||||
my $fh = $params{output_file};
|
||||
$self->status_cb->(90, "Exporting zipped archive...");
|
||||
$self->print_to_png($fh);
|
||||
$self->status_cb->(100, "Done.");
|
||||
}
|
||||
|
||||
# Export SVG slices for the offline SLA printing.
|
||||
# The export_svg is expected to be executed inside an eval block.
|
||||
sub export_svg {
|
||||
my $self = shift;
|
||||
my %params = @_;
|
||||
|
||||
$_->slice for @{$self->objects};
|
||||
my @sobjects = @{$self->objects};
|
||||
my $objnum = scalar @sobjects;
|
||||
for(my $oi = 0; $oi < $objnum; $oi++)
|
||||
{
|
||||
$sobjects[$oi]->slice;
|
||||
$self->status_cb->(($oi + 1)*100/$objnum - 1, "Slicing...");
|
||||
}
|
||||
|
||||
my $fh = $params{output_fh};
|
||||
if (!$fh) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue