mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-07 22:14:00 -06:00
Optimization in Polyline instantiation
This commit is contained in:
parent
27c421c27f
commit
8061cc6e30
14 changed files with 40 additions and 45 deletions
|
@ -71,7 +71,7 @@ sub fill_surface {
|
|||
$x += $m->{distance};
|
||||
}
|
||||
|
||||
push @polygons, Slic3r::Polygon->new($p);
|
||||
push @polygons, Slic3r::Polygon->new(@$p);
|
||||
}
|
||||
|
||||
$_->rotate(-$rotate_vector->[0][0], $m->{hex_center}) for @polygons;
|
||||
|
@ -88,7 +88,7 @@ sub fill_surface {
|
|||
# consider polygons as polylines without re-appending the initial point:
|
||||
# this cuts the last segment on purpose, so that the jump to the next
|
||||
# path is more straight
|
||||
@paths = map Slic3r::Polyline->new($_),
|
||||
@paths = map Slic3r::Polyline->new(@$_),
|
||||
@{ Boost::Geometry::Utils::polygon_multi_linestring_intersection(
|
||||
$surface->expolygon,
|
||||
\@polygons,
|
||||
|
@ -113,7 +113,7 @@ sub fill_surface {
|
|||
}
|
||||
|
||||
# clip paths again to prevent connection segments from crossing the expolygon boundaries
|
||||
@paths = map Slic3r::Polyline->new($_),
|
||||
@paths = map Slic3r::Polyline->new(@$_),
|
||||
@{ Boost::Geometry::Utils::multi_polygon_multi_linestring_intersection(
|
||||
[ $surface->expolygon->offset_ex(scaled_epsilon) ],
|
||||
[ @paths ],
|
||||
|
|
|
@ -33,9 +33,9 @@ sub fill_surface {
|
|||
my $path = "Math::PlanePath::$1"->new;
|
||||
my @n = $self->get_n($path, [ map +($_ / $distance_between_lines), @{$bounding_box->bb} ]);
|
||||
|
||||
my $polyline = Slic3r::Polyline->new([
|
||||
my $polyline = Slic3r::Polyline->new(
|
||||
map [ map {$_*$distance_between_lines} $path->n_to_xy($_) ], @n,
|
||||
]);
|
||||
);
|
||||
return {} if !@$polyline;
|
||||
|
||||
$self->process_polyline($polyline, $bounding_box);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue