mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 19:12:38 -07:00
Ported Slic3r::GCode::OozePrevention storage to XS
This commit is contained in:
@@ -195,6 +195,7 @@ sub thread_cleanup {
|
||||
*Slic3r::ExtrusionPath::Collection::DESTROY = sub {};
|
||||
*Slic3r::Flow::DESTROY = sub {};
|
||||
*Slic3r::GCode::AvoidCrossingPerimeters::DESTROY = sub {};
|
||||
*Slic3r::GCode::OozePrevention::DESTROY = sub {};
|
||||
*Slic3r::GCode::PlaceholderParser::DESTROY = sub {};
|
||||
*Slic3r::GCode::Wipe::DESTROY = sub {};
|
||||
*Slic3r::GCode::Writer::DESTROY = sub {};
|
||||
|
||||
@@ -504,13 +504,11 @@ sub set_extruder {
|
||||
}
|
||||
|
||||
package Slic3r::GCode::OozePrevention;
|
||||
use Moo;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::Geometry qw(scale);
|
||||
|
||||
has 'enable' => (is => 'rw', default => sub { 0 });
|
||||
has 'standby_points' => (is => 'rw');
|
||||
|
||||
sub pre_toolchange {
|
||||
my ($self, $gcodegen) = @_;
|
||||
|
||||
|
||||
@@ -212,8 +212,8 @@ sub export {
|
||||
}
|
||||
my $convex_hull = convex_hull([ map @$_, @skirts ]);
|
||||
|
||||
$gcodegen->ooze_prevention->enable(1);
|
||||
$gcodegen->ooze_prevention->standby_points(
|
||||
$gcodegen->ooze_prevention->set_enable(1);
|
||||
$gcodegen->ooze_prevention->set_standby_points(
|
||||
[ map @{$_->equally_spaced_points(scale 10)}, @{offset([$convex_hull], scale 3)} ]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user