Speed boost for new infill patterns. #20
This commit is contained in:
parent
86f3e4fcd2
commit
12b06b0ab0
@ -3,7 +3,7 @@ use Moo;
|
|||||||
|
|
||||||
extends 'Slic3r::Fill::Base';
|
extends 'Slic3r::Fill::Base';
|
||||||
|
|
||||||
use Slic3r::Geometry qw(bounding_box);
|
use Slic3r::Geometry qw(bounding_box X1 Y1 X2 Y2);
|
||||||
use XXX;
|
use XXX;
|
||||||
|
|
||||||
sub multiplier () { 1 }
|
sub multiplier () { 1 }
|
||||||
@ -29,6 +29,12 @@ sub fill_surface {
|
|||||||
|
|
||||||
my $distance_between_lines = $params{flow_width} / $Slic3r::resolution / $params{density} * $self->multiplier;
|
my $distance_between_lines = $params{flow_width} / $Slic3r::resolution / $params{density} * $self->multiplier;
|
||||||
my $bounding_box = [ bounding_box(map @$_, $expolygon) ];
|
my $bounding_box = [ bounding_box(map @$_, $expolygon) ];
|
||||||
|
my $bounding_box_polygon = Slic3r::Polygon->new([
|
||||||
|
[ $bounding_box->[X1], $bounding_box->[Y1] ],
|
||||||
|
[ $bounding_box->[X2], $bounding_box->[Y1] ],
|
||||||
|
[ $bounding_box->[X2], $bounding_box->[Y2] ],
|
||||||
|
[ $bounding_box->[X1], $bounding_box->[Y2] ],
|
||||||
|
]);
|
||||||
|
|
||||||
(ref $self) =~ /::([^:]+)$/;
|
(ref $self) =~ /::([^:]+)$/;
|
||||||
my $path = "Math::PlanePath::$1"->new;
|
my $path = "Math::PlanePath::$1"->new;
|
||||||
@ -41,7 +47,8 @@ sub fill_surface {
|
|||||||
|
|
||||||
$self->process_polyline($polyline, $bounding_box);
|
$self->process_polyline($polyline, $bounding_box);
|
||||||
|
|
||||||
my @paths = ($polyline->clip_with_expolygon($expolygon));
|
my @paths = map $_->clip_with_expolygon($expolygon),
|
||||||
|
$polyline->clip_with_polygon($bounding_box_polygon);
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
require "Slic3r/SVG.pm";
|
require "Slic3r/SVG.pm";
|
||||||
|
@ -118,6 +118,13 @@ sub has_segment {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub clip_with_polygon {
|
||||||
|
my $self = shift;
|
||||||
|
my ($polygon) = @_;
|
||||||
|
|
||||||
|
return $self->clip_with_expolygon(Slic3r::ExPolygon->new($polygon));
|
||||||
|
}
|
||||||
|
|
||||||
sub clip_with_expolygon {
|
sub clip_with_expolygon {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($expolygon) = @_;
|
my ($expolygon) = @_;
|
||||||
|
Loading…
Reference in New Issue
Block a user