New automatic detection of additional required perimeters for better quality with domes and sloping walls. #198

This commit is contained in:
Alessandro Ranellucci 2012-05-05 16:36:10 +02:00
parent 4b7e9fc284
commit edbdc5ec55
4 changed files with 68 additions and 4 deletions

View file

@ -6,13 +6,14 @@ use constant S_EXPOLYGON => 0;
use constant S_SURFACE_TYPE => 1;
use constant S_DEPTH_LAYERS => 2;
use constant S_BRIDGE_ANGLE => 3;
use constant S_ADDITIONAL_INNER_PERIMETERS => 4;
sub new {
my $class = shift;
my %args = @_;
my $self = [
map delete $args{$_}, qw(expolygon surface_type depth_layers bridge_angle),
map delete $args{$_}, qw(expolygon surface_type depth_layers bridge_angle additional_inner_perimeters),
];
$self->[S_DEPTH_LAYERS] //= 1; #/
@ -24,6 +25,7 @@ sub expolygon { $_[0][S_EXPOLYGON] }
sub surface_type { $_[0][S_SURFACE_TYPE] = $_[1] if $_[1]; $_[0][S_SURFACE_TYPE] }
sub depth_layers { $_[0][S_DEPTH_LAYERS] } # this integer represents the thickness of the surface expressed in layers
sub bridge_angle { $_[0][S_BRIDGE_ANGLE] }
sub additional_inner_perimeters { $_[0][S_ADDITIONAL_INNER_PERIMETERS] = $_[1] if $_[1]; $_[0][S_ADDITIONAL_INNER_PERIMETERS] }
# delegate handles
sub encloses_point { $_[0]->expolygon->encloses_point }