mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-11 16:00:17 -07:00
Merge branch 'printcpp' of github.com:sapir/Slic3r into sapir-printcpp
Conflicts: lib/Slic3r/GCode.pm lib/Slic3r/Print.pm lib/Slic3r/Print/Object.pm lib/Slic3r/Print/Region.pm
This commit is contained in:
commit
ba8148f4ad
26 changed files with 1293 additions and 266 deletions
|
|
@ -1,24 +1,19 @@
|
|||
package Slic3r::Layer;
|
||||
use Moo;
|
||||
|
||||
use List::Util qw(first);
|
||||
use Slic3r::Geometry qw(scale chained_path);
|
||||
use Slic3r::Geometry::Clipper qw(union_ex);
|
||||
|
||||
has 'id' => (is => 'rw', required => 1); # sequential number of layer, 0-based
|
||||
has 'object' => (is => 'ro', weak_ref => 1, required => 1, handles => [qw(print config)]);
|
||||
has 'upper_layer' => (is => 'rw', weak_ref => 1);
|
||||
has 'lower_layer' => (is => 'rw', weak_ref => 1);
|
||||
has 'regions' => (is => 'ro', default => sub { [] });
|
||||
has 'slicing_errors' => (is => 'rw');
|
||||
# the following two were previously generated by Moo
|
||||
sub print {
|
||||
my $self = shift;
|
||||
return $self->object->print;
|
||||
}
|
||||
|
||||
has 'slice_z' => (is => 'ro', required => 1); # Z used for slicing in unscaled coordinates
|
||||
has 'print_z' => (is => 'ro', required => 1); # Z used for printing in unscaled coordinates
|
||||
has 'height' => (is => 'ro', required => 1); # layer height in unscaled coordinates
|
||||
|
||||
# collection of expolygons generated by slicing the original geometry;
|
||||
# also known as 'islands' (all regions and surface types are merged here)
|
||||
has 'slices' => (is => 'rw', default => sub { Slic3r::ExPolygon::Collection->new });
|
||||
sub config {
|
||||
my $self = shift;
|
||||
return $self->object->config;
|
||||
}
|
||||
|
||||
# the purpose of this method is to be overridden for ::Support layers
|
||||
sub islands {
|
||||
|
|
@ -30,14 +25,16 @@ sub region {
|
|||
my $self = shift;
|
||||
my ($region_id) = @_;
|
||||
|
||||
for (my $i = @{$self->regions}; $i <= $region_id; $i++) {
|
||||
$self->regions->[$i] //= Slic3r::Layer::Region->new(
|
||||
layer => $self,
|
||||
region => $self->object->print->regions->[$i],
|
||||
);
|
||||
while ($self->region_count <= $region_id) {
|
||||
$self->add_region($self->object->print->get_region($self->region_count));
|
||||
}
|
||||
|
||||
return $self->regions->[$region_id];
|
||||
return $self->get_region($region_id);
|
||||
}
|
||||
|
||||
sub regions {
|
||||
my ($self) = @_;
|
||||
return [ map $self->get_region($_), 0..($self->region_count-1) ];
|
||||
}
|
||||
|
||||
# merge all regions' slices to get islands
|
||||
|
|
@ -65,13 +62,8 @@ sub make_perimeters {
|
|||
}
|
||||
|
||||
package Slic3r::Layer::Support;
|
||||
use Moo;
|
||||
extends 'Slic3r::Layer';
|
||||
|
||||
# ordered collection of extrusion paths to fill surfaces for support material
|
||||
has 'support_islands' => (is => 'rw', default => sub { Slic3r::ExPolygon::Collection->new });
|
||||
has 'support_fills' => (is => 'rw', default => sub { Slic3r::ExtrusionPath::Collection->new });
|
||||
has 'support_interface_fills' => (is => 'rw', default => sub { Slic3r::ExtrusionPath::Collection->new });
|
||||
our @ISA = qw(Slic3r::Layer);
|
||||
|
||||
sub islands {
|
||||
my $self = shift;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue