Honeycomb infill. #300

This commit is contained in:
Alessandro Ranellucci 2012-04-16 11:55:14 +02:00
parent 0faebad4da
commit cb182b8bc2
8 changed files with 126 additions and 20 deletions

View file

@ -3,11 +3,14 @@ use Moo;
use XXX;
has 'print' => (is => 'rw');
has 'layer' => (is => 'rw');
has 'max_print_dimension' => (is => 'rw');
use constant PI => 4 * atan2(1, 1);
sub angles () { [0, PI/2] }
sub infill_direction {
my $self = shift;
my ($surface) = @_;
@ -20,9 +23,9 @@ sub infill_direction {
if ($self->layer) {
# alternate fill direction
if (($self->layer->id / $surface->depth_layers) % 2) {
$rotate[0] = Slic3r::Geometry::deg2rad($Slic3r::fill_angle) + PI/2;
}
my $layer_num = $self->layer->id / $surface->depth_layers;
my $angle = $self->angles->[$layer_num % @{$self->angles}];
$rotate[0] = Slic3r::Geometry::deg2rad($Slic3r::fill_angle) + $angle if $angle;
}
# use bridge angle