diff options
author | bubnikv <bubnikv@gmail.com> | 2016-10-20 18:44:46 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2016-10-20 18:44:46 +0300 |
commit | 9e4edcd8ecdddc46002d612850fc15afa2b88801 (patch) | |
tree | 6c0e6e92b4c24fd350833ce7a8eef754fb220f51 /lib | |
parent | f788f50b5a7e1457cadf7a2cde82d93cf085652d (diff) |
Enabled the C++ fillers for all infills, not just the supports.
Made sure the C++ fillers are instantiated at the worker threads,
where there are being released.
Extended the FillRectilinear2 to calculate the contour / line intersection
with exact arithmetics, improved robustness and added error handling
and error reporting, if the contours to be filled are not correct.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Slic3r.pm | 4 | ||||
-rw-r--r-- | lib/Slic3r/Layer.pm | 4 | ||||
-rw-r--r-- | lib/Slic3r/Print/SupportMaterial.pm | 12 |
3 files changed, 13 insertions, 7 deletions
diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index ec0dae675..77e45688e 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -223,7 +223,9 @@ sub thread_cleanup { *Slic3r::ExtrusionPath::Collection::DESTROY = sub {}; *Slic3r::ExtrusionSimulator::DESTROY = sub {}; *Slic3r::Flow::DESTROY = sub {}; - *Slic3r::Filler::DESTROY = sub {}; +# Fillers are only being allocated in worker threads, which are not going to be forked. +# Therefore the Filler instances shall be released at the end of the thread. +# *Slic3r::Filler::DESTROY = sub {}; *Slic3r::GCode::DESTROY = sub {}; *Slic3r::GCode::AvoidCrossingPerimeters::DESTROY = sub {}; *Slic3r::GCode::OozePrevention::DESTROY = sub {}; diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index 59df3d28f..f1a3d7a57 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -36,7 +36,9 @@ sub make_fill { foreach my $layerm (@{$self->regions}) { $layerm->fills->clear; - $layerm->fills->append($_) for $self->object->fill_maker->make_fill($layerm); + # Fearlessly enable the C++ fillers. + $layerm->fills->append($_) for $self->object->fill_maker2->make_fill($layerm); +# $layerm->fills->append($_) for $self->object->fill_maker->make_fill($layerm); } } diff --git a/lib/Slic3r/Print/SupportMaterial.pm b/lib/Slic3r/Print/SupportMaterial.pm index d73677484..d1ef0e045 100644 --- a/lib/Slic3r/Print/SupportMaterial.pm +++ b/lib/Slic3r/Print/SupportMaterial.pm @@ -647,11 +647,6 @@ sub generate_toolpaths { $pattern = 'honeycomb'; } - my %fillers = ( - interface => $object->fill_maker2->filler('rectilinear'), - support => $object->fill_maker2->filler($pattern), - ); - my $interface_angle = $self->object_config->support_material_angle + 90; my $interface_spacing = $self->object_config->support_material_interface_spacing + $interface_flow->spacing; my $interface_density = $interface_spacing == 0 ? 1 : $interface_flow->spacing / $interface_spacing; @@ -762,6 +757,13 @@ sub generate_toolpaths { $layer->support_interface_fills->append(@loops); } + + # Allocate the fillers exclusively in the worker threads! Don't allocate them at the main thread, + # as Perl copies the C++ pointers by default, so then the C++ objects are shared between threads! + my %fillers = ( + interface => $object->fill_maker2->filler('rectilinear'), + support => $object->fill_maker2->filler($pattern), + ); # interface and contact infill if (@$interface || @$contact_infill) { |