diff --git a/t/support.t b/t/support.t index 0fadc1d14..72749915b 100644 --- a/t/support.t +++ b/t/support.t @@ -67,12 +67,12 @@ use Slic3r::Test; { my $config = Slic3r::Config->new_from_defaults; $config->set('raft_layers', 3); - $config->set('brim_width', 6); + $config->set('brim_width', 0); $config->set('skirts', 0); $config->set('support_material_extruder', 2); $config->set('support_material_interface_extruder', 2); $config->set('layer_height', 0.4); - $config->set('first_layer_height', '100%'); + $config->set('first_layer_height', 0.4); my $print = Slic3r::Test::init_print('overhang', config => $config); ok my $gcode = Slic3r::Test::gcode($print), 'no conflict between raft/support and brim'; @@ -84,7 +84,7 @@ use Slic3r::Test; $tool = $1; } elsif ($info->{extruding}) { if ($self->Z <= ($config->raft_layers * $config->layer_height)) { - fail 'not extruding raft/brim with support material extruder' + fail 'not extruding raft with support material extruder' if $tool != ($config->support_material_extruder-1); } else { fail 'support material exceeds raft layers' diff --git a/xs/src/libslic3r/ExtrusionEntity.cpp b/xs/src/libslic3r/ExtrusionEntity.cpp index 7901317a3..c84b08489 100644 --- a/xs/src/libslic3r/ExtrusionEntity.cpp +++ b/xs/src/libslic3r/ExtrusionEntity.cpp @@ -341,6 +341,31 @@ ExtrusionLoop::has_overhang_point(const Point &point) const return false; } +bool +ExtrusionLoop::is_perimeter() const +{ + return this->paths.front().role == erPerimeter + || this->paths.front().role == erExternalPerimeter + || this->paths.front().role == erOverhangPerimeter; +} + +bool +ExtrusionLoop::is_infill() const +{ + return this->paths.front().role == erBridgeInfill + || this->paths.front().role == erInternalInfill + || this->paths.front().role == erSolidInfill + || this->paths.front().role == erTopSolidInfill; +} + +bool +ExtrusionLoop::is_solid_infill() const +{ + return this->paths.front().role == erBridgeInfill + || this->paths.front().role == erSolidInfill + || this->paths.front().role == erTopSolidInfill; +} + #ifdef SLIC3RXS REGISTER_CLASS(ExtrusionLoop, "ExtrusionLoop"); #endif diff --git a/xs/src/libslic3r/ExtrusionEntity.hpp b/xs/src/libslic3r/ExtrusionEntity.hpp index da7658b76..65a1aba59 100644 --- a/xs/src/libslic3r/ExtrusionEntity.hpp +++ b/xs/src/libslic3r/ExtrusionEntity.hpp @@ -97,6 +97,9 @@ class ExtrusionLoop : public ExtrusionEntity void split_at(const Point &point); void clip_end(double distance, ExtrusionPaths* paths) const; bool has_overhang_point(const Point &point) const; + bool is_perimeter() const; + bool is_infill() const; + bool is_solid_infill() const; }; } diff --git a/xs/xsp/ExtrusionLoop.xsp b/xs/xsp/ExtrusionLoop.xsp index 6767c7d3b..2a8d1f9f4 100644 --- a/xs/xsp/ExtrusionLoop.xsp +++ b/xs/xsp/ExtrusionLoop.xsp @@ -28,6 +28,9 @@ %code{% THIS->clip_end(distance, &RETVAL); %}; bool has_overhang_point(Point* point) %code{% RETVAL = THIS->has_overhang_point(*point); %}; + bool is_perimeter(); + bool is_infill(); + bool is_solid_infill(); %{ SV*