mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
New option to only infill where strictly needed for supporting ceilings
This commit is contained in:
@@ -2,7 +2,7 @@ package Slic3r::Layer::Region;
|
||||
use Moo;
|
||||
|
||||
use Slic3r::ExtrusionPath ':roles';
|
||||
use Slic3r::Geometry qw(scale chained_path_items);
|
||||
use Slic3r::Geometry qw(PI scale chained_path_items);
|
||||
use Slic3r::Geometry::Clipper qw(safety_offset union_ex diff_ex intersection_ex);
|
||||
use Slic3r::Surface ':types';
|
||||
|
||||
@@ -16,6 +16,7 @@ has 'layer' => (
|
||||
has 'region' => (is => 'ro', required => 1);
|
||||
has 'perimeter_flow' => (is => 'rw');
|
||||
has 'infill_flow' => (is => 'rw');
|
||||
has 'overhang_width' => (is => 'lazy');
|
||||
|
||||
# collection of spare segments generated by slicing the original geometry;
|
||||
# these need to be merged in continuos (closed) polylines
|
||||
@@ -64,6 +65,12 @@ sub _update_flows {
|
||||
: $self->region->flows->{infill});
|
||||
}
|
||||
|
||||
sub _build_overhang_width {
|
||||
my $self = shift;
|
||||
my $threshold_rad = PI/2 - atan2($self->perimeter_flow->width / $self->height / 2, 1);
|
||||
return scale($self->height * ((cos $threshold_rad) / (sin $threshold_rad)));
|
||||
}
|
||||
|
||||
# build polylines from lines
|
||||
sub make_surfaces {
|
||||
my $self = shift;
|
||||
|
||||
Reference in New Issue
Block a user