Bugfix: seam_position = random didn't work with a single perimeter. #2179
This commit is contained in:
parent
c3d401fb41
commit
67f1cdf76f
4 changed files with 9 additions and 8 deletions
|
@ -4,7 +4,7 @@ use warnings;
|
||||||
|
|
||||||
use parent qw(Exporter);
|
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);
|
EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER);
|
||||||
our %EXPORT_TAGS = (roles => \@EXPORT_OK);
|
our %EXPORT_TAGS = (roles => \@EXPORT_OK);
|
||||||
|
|
||||||
|
|
|
@ -271,15 +271,18 @@ sub make_perimeters {
|
||||||
my $no_children = !@{ $polynode->{children} };
|
my $no_children = !@{ $polynode->{children} };
|
||||||
my $is_external = $is_contour ? $root_level : $no_children;
|
my $is_external = $is_contour ? $root_level : $no_children;
|
||||||
my $is_internal = $is_contour ? $no_children : $root_level;
|
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) {
|
if ($is_external) {
|
||||||
# external perimeters are root level in case of contours
|
# external perimeters are root level in case of contours
|
||||||
# and items with no children in case of holes
|
# and items with no children in case of holes
|
||||||
$role = EXTR_ROLE_EXTERNAL_PERIMETER;
|
$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
|
# detect overhanging/bridging perimeters
|
||||||
|
|
|
@ -29,7 +29,6 @@ enum ExtrusionRole {
|
||||||
/* Special flags describing loop */
|
/* Special flags describing loop */
|
||||||
enum ExtrusionLoopRole {
|
enum ExtrusionLoopRole {
|
||||||
elrDefault,
|
elrDefault,
|
||||||
elrExternalPerimeter,
|
|
||||||
elrContourInternalPerimeter,
|
elrContourInternalPerimeter,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ IV
|
||||||
_constant()
|
_constant()
|
||||||
ALIAS:
|
ALIAS:
|
||||||
EXTRL_ROLE_DEFAULT = elrDefault
|
EXTRL_ROLE_DEFAULT = elrDefault
|
||||||
EXTRL_ROLE_EXTERNAL_PERIMETER = elrExternalPerimeter
|
|
||||||
EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER = elrContourInternalPerimeter
|
EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER = elrContourInternalPerimeter
|
||||||
PROTOTYPE:
|
PROTOTYPE:
|
||||||
CODE:
|
CODE:
|
||||||
|
|
Loading…
Reference in a new issue