Skip to content

Commit

Permalink
Bugfix: seam_position = random didn't work with a single perimeter. #…
Browse files Browse the repository at this point in the history
  • Loading branch information
alranel committed Nov 7, 2014
1 parent c3d401f commit 67f1cdf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/Slic3r/ExtrusionLoop.pm
Expand Up @@ -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);

Expand Down
13 changes: 8 additions & 5 deletions lib/Slic3r/Layer/Region.pm
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion xs/src/libslic3r/ExtrusionEntity.hpp
Expand Up @@ -29,7 +29,6 @@ enum ExtrusionRole {
/* Special flags describing loop */
enum ExtrusionLoopRole {
elrDefault,
elrExternalPerimeter,
elrContourInternalPerimeter,
};

Expand Down
1 change: 0 additions & 1 deletion xs/xsp/ExtrusionLoop.xsp
Expand Up @@ -63,7 +63,6 @@ IV
_constant()
ALIAS:
EXTRL_ROLE_DEFAULT = elrDefault
EXTRL_ROLE_EXTERNAL_PERIMETER = elrExternalPerimeter
EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER = elrContourInternalPerimeter
PROTOTYPE:
CODE:
Expand Down

0 comments on commit 67f1cdf

Please sign in to comment.