mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 04:31: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,5 +1,4 @@
|
|||
package Slic3r::Layer::Region;
|
||||
use Moo;
|
||||
|
||||
use List::Util qw(sum first);
|
||||
use Slic3r::ExtrusionLoop ':roles';
|
||||
|
|
@ -11,42 +10,22 @@ use Slic3r::Geometry::Clipper qw(union_ex diff_ex intersection_ex
|
|||
union diff intersection_ppl diff_ppl);
|
||||
use Slic3r::Surface ':types';
|
||||
|
||||
has 'layer' => (
|
||||
is => 'ro',
|
||||
weak_ref => 1,
|
||||
required => 1,
|
||||
handles => [qw(id slice_z print_z height object print)],
|
||||
);
|
||||
has 'region' => (is => 'ro', required => 1, handles => [qw(config)]);
|
||||
has 'infill_area_threshold' => (is => 'lazy');
|
||||
|
||||
# collection of surfaces generated by slicing the original geometry
|
||||
# divided by type top/bottom/internal
|
||||
has 'slices' => (is => 'rw', default => sub { Slic3r::Surface::Collection->new });
|
||||
|
||||
# collection of extrusion paths/loops filling gaps
|
||||
has 'thin_fills' => (is => 'rw', default => sub { Slic3r::ExtrusionPath::Collection->new });
|
||||
|
||||
# collection of surfaces for infill generation
|
||||
has 'fill_surfaces' => (is => 'rw', default => sub { Slic3r::Surface::Collection->new });
|
||||
|
||||
# collection of expolygons representing the bridged areas (thus not needing support material)
|
||||
has 'bridged' => (is => 'rw', default => sub { Slic3r::ExPolygon::Collection->new });
|
||||
|
||||
# collection of polylines representing the unsupported bridge edges
|
||||
has 'unsupported_bridge_edges' => (is => 'rw', default => sub { Slic3r::Polyline::Collection->new });
|
||||
|
||||
# ordered collection of extrusion paths/loops to build all perimeters
|
||||
has 'perimeters' => (is => 'rw', default => sub { Slic3r::ExtrusionPath::Collection->new });
|
||||
|
||||
# ordered collection of extrusion paths to fill surfaces
|
||||
has 'fills' => (is => 'rw', default => sub { Slic3r::ExtrusionPath::Collection->new });
|
||||
|
||||
sub _build_infill_area_threshold {
|
||||
# TODO: lazy
|
||||
sub infill_area_threshold {
|
||||
my $self = shift;
|
||||
return $self->flow(FLOW_ROLE_SOLID_INFILL)->scaled_spacing ** 2;
|
||||
}
|
||||
|
||||
sub id { return $_[0]->layer->id; }
|
||||
sub slice_z { return $_[0]->layer->slice_z; }
|
||||
sub print_z { return $_[0]->layer->print_z; }
|
||||
sub height { return $_[0]->layer->height; }
|
||||
sub object { return $_[0]->layer->object; }
|
||||
sub print { return $_[0]->layer->print; }
|
||||
|
||||
sub config { return $_[0]->region->config; }
|
||||
|
||||
sub flow {
|
||||
my ($self, $role, $bridge, $width) = @_;
|
||||
return $self->region->flow(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue