Bugfix: seam_position = random didn't work with a single perimeter. #2179

This commit is contained in:
Alessandro Ranellucci 2014-11-07 23:53:18 +01:00
parent c3d401fb41
commit 67f1cdf76f
4 changed files with 9 additions and 8 deletions

View file

@ -4,7 +4,7 @@ use warnings;
use parent qw(Exporter);
our @EXPORT_OK = qw(EXTRL_ROLE_DEFAULT EXTRL_ROLE_EXTERNAL_PERIMETER
our @EXPORT_OK = qw(EXTRL_ROLE_DEFAULT
EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER);
our %EXPORT_TAGS = (roles => \@EXPORT_OK);

View file

@ -271,15 +271,18 @@ sub make_perimeters {
my $no_children = !@{ $polynode->{children} };
my $is_external = $is_contour ? $root_level : $no_children;
my $is_internal = $is_contour ? $no_children : $root_level;
if ($is_contour && $is_internal) {
# internal perimeters are root level in case of holes
# and items with no children in case of contours
# Note that we set loop role to ContourInternalPerimeter
# also when loop is both internal and external (i.e.
# there's only one contour loop).
$loop_role = EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER;
}
if ($is_external) {
# external perimeters are root level in case of contours
# and items with no children in case of holes
$role = EXTR_ROLE_EXTERNAL_PERIMETER;
$loop_role = EXTRL_ROLE_EXTERNAL_PERIMETER;
} elsif ($is_contour && $is_internal) {
# internal perimeters are root level in case of holes
# and items with no children in case of contours
$loop_role = EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER;
}
# detect overhanging/bridging perimeters

View file

@ -29,7 +29,6 @@ enum ExtrusionRole {
/* Special flags describing loop */
enum ExtrusionLoopRole {
elrDefault,
elrExternalPerimeter,
elrContourInternalPerimeter,
};

View file

@ -63,7 +63,6 @@ IV
_constant()
ALIAS:
EXTRL_ROLE_DEFAULT = elrDefault
EXTRL_ROLE_EXTERNAL_PERIMETER = elrExternalPerimeter
EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER = elrContourInternalPerimeter
PROTOTYPE:
CODE: