Skip to content

Commit

Permalink
antiooze was not doing anything
Browse files Browse the repository at this point in the history
  • Loading branch information
hurzl committed Oct 7, 2012
1 parent 8955e9e commit 57be2dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/slicer/printlines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,9 @@ bool Printlines::find_nextmove(double minlength, uint startindex,
uint &tractstart, uint &pushend,
const vector<PLine> &lines) const
{
uint i = startindex;
uint i = startindex; // begin search here
// cerr << "FM " << i << " - " <<lines.size() << " : "
// << movestart << " - " <<moveend<< endl;
while (i < lines.size()-2) {
// find move start
while (i < lines.size() && !lines[i].is_move() ) {
Expand All @@ -991,7 +993,7 @@ bool Printlines::find_nextmove(double minlength, uint startindex,
if (!lines[movestart].is_move()) return false;
if (i == lines.size()-1) return false;
// find move end
while (i < lines.size() && !lines[i].is_move() ) {
while (i < lines.size() && lines[i].is_move() ) {
moveend = i; i++;
}
if (!lines[moveend].is_move()) return false;
Expand Down Expand Up @@ -1019,6 +1021,7 @@ bool Printlines::find_nextmove(double minlength, uint startindex,
}
// cerr << "found move " << tractstart << "..." <<movestart
// << "--"<<moveend<< "..."<< pushend << " length " << totaldistance << endl;

return true;
}
}
Expand Down Expand Up @@ -1137,9 +1140,10 @@ uint Printlines::makeAntioozeRetract(vector<PLine> &lines) const
uint
movestart = 0, moveend = 0,
tractstart = 0, pushend = 0;
while ( find_nextmove(AOmindistance, moveend+1,
movestart, moveend,
tractstart, pushend,
while ( find_nextmove(AOmindistance,
moveend+1, // set
movestart, moveend, // get
tractstart, pushend, // get
lines) ) {
double extrusionsum = 0;
uint added = 0;
Expand Down Expand Up @@ -1193,6 +1197,7 @@ uint Printlines::makeAntioozeRetract(vector<PLine> &lines) const
total_extrusionsum += extrusionsum;
}
if (abs(total_extrusionsum) > 0.01) cerr << "wrong total AO extr.: " << total_extrusionsum << endl;

return total_added;
}

Expand Down
2 changes: 1 addition & 1 deletion src/slicer/printlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class PLine
double time() const; // time in minutes
PLine3 getPrintline(double z) const;
bool is_noop() const;
bool is_move() const {return (feedrate==0.);}
bool is_move() const {return (abs(feedrate) < 0.0001);}
string info() const;
};

Expand Down

0 comments on commit 57be2dc

Please sign in to comment.