Skip to content

Commit

Permalink
fix broken overhangs, improved 'concentric with fill', add 'external …
Browse files Browse the repository at this point in the history
…seam gap'
  • Loading branch information
supermerill committed Mar 24, 2023
2 parents d02b16c + d6b8283 commit 603c301
Show file tree
Hide file tree
Showing 13 changed files with 321 additions and 167 deletions.
5 changes: 4 additions & 1 deletion resources/ui_layout/default/extruder.ui
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ group:General wipe
setting:idx:label$Depth:wipe_inside_depth
end_line
setting:idx:wipe_extra_perimeter
setting:idx:sidetext_width$5:seam_gap
line:Seam gap
setting:idx:label$_:sidetext_width$5:seam_gap
setting:idx:label$for external perimeters:sidetext_width$5:seam_gap_external
end_line
group:Retraction when tool is disabled (advanced settings for multi-extruder setups)
setting:label$Minimum retraction:idx:retract_length_toolchange
setting:label$Extra unretraction:idx:retract_restart_extra_toolchange
Expand Down
5 changes: 4 additions & 1 deletion resources/ui_layout/example/extruder.ui
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ group:General wipe
setting:idx:label$Depth:wipe_inside_depth
end_line
setting:idx:wipe_extra_perimeter
setting:idx:seam_gap
line:Seam gap
setting:idx:label$_:sidetext_width$5:seam_gap
setting:idx:label$for external perimeters:sidetext_width$5:seam_gap_external
end_line
group:Retraction when tool is disabled (advanced settings for multi-extruder setups)
setting:label$Minimum retraction:idx:retract_length_toolchange
setting:label$Extra unretraction:idx:retract_restart_extra_toolchange
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/ExtrusionEntity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ class ExtrusionMultiEntity : public ExtrusionEntity {

bool is_loop() const override { return false; }
ExtrusionRole role() const override { return this->paths.empty() ? erNone : this->paths.front().role(); }
virtual const Point& first_point() const override { return this->paths.front().as_polyline().front(); }
virtual const Point& last_point() const override { return this->paths.back().as_polyline().back(); }
virtual const Point& first_point() const override { return this->paths.front().polyline.as_polyline().front(); }
virtual const Point& last_point() const override { return this->paths.back().polyline.as_polyline().back(); }

virtual void reverse() override {
for (THING &entity : this->paths)
Expand Down
8 changes: 5 additions & 3 deletions src/libslic3r/ExtrusionEntityCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ void filter_by_extrusion_role_in_place(ExtrusionEntitiesPtr &extrusion_entities,
}

ExtrusionEntityCollection::ExtrusionEntityCollection(const ExtrusionPaths &paths)
: no_sort(false)
: m_no_sort(false), m_no_reverse(false)
{
this->append(paths);
}

ExtrusionEntityCollection& ExtrusionEntityCollection::operator= (const ExtrusionEntityCollection &other)
{
this->no_sort = other.no_sort;
this->m_no_sort = other.m_no_sort;
this->m_no_reverse = other.m_no_reverse;
clear();
this->append(other.m_entities);
return *this;
Expand All @@ -35,7 +36,8 @@ ExtrusionEntityCollection& ExtrusionEntityCollection::operator= (const Extrusion
void ExtrusionEntityCollection::swap(ExtrusionEntityCollection &c)
{
std::swap(this->m_entities, c.m_entities);
std::swap(this->no_sort, c.no_sort);
std::swap(this->m_no_sort, c.m_no_sort);
std::swap(this->m_no_reverse, c.m_no_reverse);
}

void ExtrusionEntityCollection::clear()
Expand Down
23 changes: 12 additions & 11 deletions src/libslic3r/ExtrusionEntityCollection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class ExtrusionEntityCollection : public ExtrusionEntity
{
private:
// set to tru to forbit to reorder and reverse all entities indie us.
bool no_sort;
bool m_no_sort;
// even if no_sort, allow to reverse() us (and our entities if they allow it, but they should)
bool no_reverse;
bool m_no_reverse;
ExtrusionEntitiesPtr m_entities; // we own these entities
public:
virtual ExtrusionEntityCollection* clone() const override { return new ExtrusionEntityCollection(*this); }
Expand All @@ -40,16 +40,17 @@ class ExtrusionEntityCollection : public ExtrusionEntity
/// Iterating over this needs to check each child to see if it, too is a collection.
const ExtrusionEntitiesPtr& entities() const { return m_entities; }
ExtrusionEntitiesPtr& set_entities() { return m_entities; }
ExtrusionEntityCollection(): no_sort(false), no_reverse(false) {}
ExtrusionEntityCollection(const ExtrusionEntityCollection &other) : no_sort(other.no_sort), no_reverse(other.no_reverse) { this->append(other.entities()); }
ExtrusionEntityCollection(ExtrusionEntityCollection &&other) : m_entities(std::move(other.m_entities)), no_sort(other.no_sort), no_reverse(other.no_reverse) {}
ExtrusionEntityCollection() : m_no_sort(false), m_no_reverse(false) {}
ExtrusionEntityCollection(bool no_sort, bool no_reverse) : m_no_sort(no_sort), m_no_reverse(no_reverse) {}
ExtrusionEntityCollection(const ExtrusionEntityCollection &other) : m_no_sort(other.m_no_sort), m_no_reverse(other.m_no_reverse) { this->append(other.entities()); }
ExtrusionEntityCollection(ExtrusionEntityCollection &&other) : m_entities(std::move(other.m_entities)), m_no_sort(other.m_no_sort), m_no_reverse(other.m_no_reverse) {}
explicit ExtrusionEntityCollection(const ExtrusionPaths &paths);
ExtrusionEntityCollection& operator=(const ExtrusionEntityCollection &other);
ExtrusionEntityCollection& operator=(ExtrusionEntityCollection &&other) {
this->clear();
this->m_entities = std::move(other.m_entities);
this->no_sort = other.no_sort;
this->no_reverse = other.no_reverse;
this->m_no_sort = other.m_no_sort;
this->m_no_reverse = other.m_no_reverse;
return *this;
}
~ExtrusionEntityCollection() override { clear(); }
Expand All @@ -66,9 +67,9 @@ class ExtrusionEntityCollection : public ExtrusionEntity
}
return out;
}
void set_can_sort_reverse(bool sort, bool reverse) { this->no_sort = !sort; this->no_reverse = !reverse; }
bool can_sort() const { return !this->no_sort; }
bool can_reverse() const override { return can_sort() || !this->no_reverse; }
void set_can_sort_reverse(bool sort, bool reverse) { this->m_no_sort = !sort; this->m_no_reverse = !reverse; }
bool can_sort() const { return !this->m_no_sort; }
bool can_reverse() const override { return can_sort() || !this->m_no_reverse; }
bool empty() const { return this->m_entities.empty(); }
void clear();
void swap (ExtrusionEntityCollection &c);
Expand Down Expand Up @@ -102,7 +103,7 @@ class ExtrusionEntityCollection : public ExtrusionEntity
static ExtrusionEntityCollection chained_path_from(const ExtrusionEntitiesPtr &extrusion_entities, const Point &start_near, ExtrusionRole role = erMixed);
ExtrusionEntityCollection chained_path_from(const Point &start_near, ExtrusionRole role = erNone) const {
if (role == erNone) role = this->role();
if( this->no_sort || (role == erMixed) )
if( this->m_no_sort || (role == erMixed) )
return *this;
else
return chained_path_from(this->m_entities, start_near, role);
Expand Down
Loading

0 comments on commit 603c301

Please sign in to comment.