mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 23:23:59 -06:00
Merge branch 'master' into xsdata
Conflicts: lib/Slic3r.pm lib/Slic3r/ExPolygon.pm lib/Slic3r/Fill.pm lib/Slic3r/Fill/Rectilinear.pm lib/Slic3r/GCode.pm lib/Slic3r/GUI/Plater.pm lib/Slic3r/Geometry/Clipper.pm lib/Slic3r/Layer/Region.pm lib/Slic3r/Print.pm lib/Slic3r/Print/Object.pm lib/Slic3r/TriangleMesh.pm t/shells.t xs/MANIFEST
This commit is contained in:
commit
b38cc2c244
60 changed files with 1432 additions and 798 deletions
|
@ -11,49 +11,18 @@ has 'regions' => (is => 'ro', default => sub { [] });
|
|||
has 'slicing_errors' => (is => 'rw');
|
||||
|
||||
has 'slice_z' => (is => 'ro', required => 1); # Z used for slicing in scaled coordinates
|
||||
has 'print_z' => (is => 'ro', required => 1); # Z used for printing in scaled 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 });
|
||||
|
||||
# ordered collection of extrusion paths to fill surfaces for support material
|
||||
has 'support_islands' => (is => 'rw');
|
||||
has 'support_fills' => (is => 'rw');
|
||||
has 'support_contact_fills' => (is => 'rw');
|
||||
|
||||
sub _trigger_id {
|
||||
my $self = shift;
|
||||
$_->_trigger_layer for @{$self->regions || []};
|
||||
}
|
||||
|
||||
# layer height of contact paths in unscaled coordinates
|
||||
sub support_material_contact_height {
|
||||
my $self = shift;
|
||||
|
||||
return $self->height if $self->id == 0;
|
||||
|
||||
# TODO: check what upper region applies instead of considering the first one
|
||||
my $upper_layer = $self->object->layers->[ $self->id + 1 ] // $self;
|
||||
my $h = ($self->height + $upper_layer->height) - $upper_layer->regions->[0]->extruders->{infill}->bridge_flow->width;
|
||||
|
||||
# If layer height is less than half the bridge width then we'll get a negative height for contact area.
|
||||
# The optimal solution would be to skip some layers during support material generation, but for now
|
||||
# we'll apply a (dirty) workaround that should still work.
|
||||
if ($h <= 0) {
|
||||
$h = $self->height;
|
||||
}
|
||||
|
||||
return $h;
|
||||
}
|
||||
|
||||
# Z used for printing support material contact in scaled coordinates
|
||||
sub support_material_contact_z {
|
||||
my $self = shift;
|
||||
return $self->print_z - ($self->height - $self->support_material_contact_height) / &Slic3r::SCALING_FACTOR;
|
||||
}
|
||||
|
||||
sub upper_layer_slices {
|
||||
my $self = shift;
|
||||
|
||||
|
@ -81,7 +50,7 @@ sub make_slices {
|
|||
|
||||
my $slices = union_ex([ map $_->p, map @{$_->slices}, @{$self->regions} ]);
|
||||
$self->slices->clear;
|
||||
$self->slices->append(map Slic3r::ExPolygon->new(@$_), @$slices);
|
||||
$self->slices->append(@$slices);
|
||||
}
|
||||
|
||||
sub make_perimeters {
|
||||
|
@ -97,4 +66,13 @@ sub support_islands_enclose_line {
|
|||
return (first { $_->encloses_line($line) } @{$self->support_islands}) ? 1 : 0;
|
||||
}
|
||||
|
||||
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');
|
||||
has 'support_fills' => (is => 'rw');
|
||||
has 'support_interface_fills' => (is => 'rw');
|
||||
|
||||
1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue