mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-07 22:14:00 -06:00
Very large refactoring. Ditched Slic3r::Polyline::Closed and reorganized geometric classes.
This commit is contained in:
parent
2def6a9787
commit
8ed91a8ec4
20 changed files with 293 additions and 349 deletions
|
@ -51,7 +51,7 @@ sub fill_surface {
|
|||
($bounding_box->[X1] + $bounding_box->[X2]) / 2,
|
||||
($bounding_box->[Y1] + $bounding_box->[Y2]) / 2,
|
||||
);
|
||||
foreach my $loop (map Slic3r::ExtrusionLoop->cast($_, role => 'fill'), @loops) {
|
||||
foreach my $loop (map Slic3r::ExtrusionLoop->new(polygon => $_, role => 'fill'), @loops) {
|
||||
# find the point of the loop that is closest to the current extruder position
|
||||
$cur_pos = $loop->nearest_point_to($cur_pos);
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ sub fill_surface {
|
|||
my $path = "Math::PlanePath::$1"->new;
|
||||
my @n = $self->get_n($path, [map +($_ / $distance_between_lines), @$bounding_box]);
|
||||
|
||||
my $polyline = Slic3r::Polyline->cast([
|
||||
my $polyline = Slic3r::Polyline->new([
|
||||
map [ map {$_*$distance_between_lines} $path->n_to_xy($_) ], @n,
|
||||
]);
|
||||
return {} if !@{$polyline->points};
|
||||
|
|
|
@ -55,7 +55,7 @@ sub fill_surface {
|
|||
# connect lines
|
||||
{
|
||||
my $collection = Slic3r::ExtrusionPath::Collection->new(
|
||||
paths => [ map Slic3r::ExtrusionPath->cast([ @$_ ], role => 'bogus'), @paths ],
|
||||
paths => [ map Slic3r::ExtrusionPath->new(polyline => Slic3r::Polyline->new(@$_), role => 'bogus'), @paths ],
|
||||
);
|
||||
@paths = ();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue