mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 23:23:59 -06:00
Large refactoring to allow processing multimaterial files
This commit is contained in:
parent
04be94023b
commit
02356fd613
13 changed files with 982 additions and 891 deletions
|
@ -43,6 +43,7 @@ use Slic3r::Format::STL;
|
|||
use Slic3r::GCode;
|
||||
use Slic3r::Geometry qw(PI);
|
||||
use Slic3r::Layer;
|
||||
use Slic3r::Layer::Material;
|
||||
use Slic3r::Line;
|
||||
use Slic3r::Model;
|
||||
use Slic3r::Point;
|
||||
|
@ -70,8 +71,9 @@ sub parallelize {
|
|||
my %params = @_;
|
||||
|
||||
if (!$params{disable} && $Slic3r::have_threads && $Config->threads > 1) {
|
||||
my @items = (ref $params{items} eq 'CODE') ? $params{items}->() : @{$params{items}};
|
||||
my $q = Thread::Queue->new;
|
||||
$q->enqueue(@{ $params{items} }, (map undef, 1..$Config->threads));
|
||||
$q->enqueue(@items, (map undef, 1..$Config->threads));
|
||||
|
||||
my $thread_cb = sub { $params{thread_cb}->($q) };
|
||||
foreach my $th (map threads->create($thread_cb), 1..$Config->threads) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue