Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
feat: infill_wipe_dist
Browse files Browse the repository at this point in the history
  • Loading branch information
BagelOrb committed Jul 9, 2015
1 parent 9ba97a7 commit 941354c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
14 changes: 14 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Changelog CuraEngine
====================





- Feature: Draft Protection Screen. A shell similar to the ooze shield providing protection from gusts of wind and acting similar to a heated chamber


Release 15.06.01
-----

- [Not documented]
12 changes: 10 additions & 2 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,10 @@ void FffGcodeWriter::processSingleLayerInfill(GCodePlanner& gcodeLayer, SliceMes
//Combine the 1 layer thick infill with the top/bottom skin and print that as one thing.
Polygons infillPolygons;
Polygons infillLines;
EFillMethod pattern = getSettingAsFillMethod("fill_pattern");
if (sparse_infill_line_distance > 0 && part.sparse_outline.size() > 0)
{
switch(getSettingAsFillMethod("fill_pattern"))
switch(pattern)
{
case Fill_Grid:
generateGridInfill(part.sparse_outline[0], 0, infillLines, extrusionWidth, sparse_infill_line_distance * 2, infill_overlap, fillAngle);
Expand All @@ -589,7 +590,14 @@ void FffGcodeWriter::processSingleLayerInfill(GCodePlanner& gcodeLayer, SliceMes
}
}
gcodeLayer.addPolygonsByOptimizer(infillPolygons, &mesh->infill_config[0]);
gcodeLayer.addLinesByOptimizer(infillLines, &mesh->infill_config[0]);
if (pattern == Fill_Grid || pattern == Fill_Lines || pattern == Fill_Triangles)
{
gcodeLayer.addLinesByOptimizer(infillLines, &mesh->infill_config[0], getSettingInMicrons("infill_wipe_dist"));
}
else
{
gcodeLayer.addLinesByOptimizer(infillLines, &mesh->infill_config[0]);
}
}

void FffGcodeWriter::processInsets(GCodePlanner& gcodeLayer, SliceMeshStorage* mesh, SliceLayerPart& part, unsigned int layer_nr)
Expand Down
19 changes: 17 additions & 2 deletions src/gcodePlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void GCodePlanner::addPolygonsByOptimizer(Polygons& polygons, GCodePathConfig* c
addPolygon(polygons[nr], orderOptimizer.polyStart[nr], config, wall_overlap_computation);
}
}
void GCodePlanner::addLinesByOptimizer(Polygons& polygons, GCodePathConfig* config)
void GCodePlanner::addLinesByOptimizer(Polygons& polygons, GCodePathConfig* config, int wipe_dist)
{
LineOrderOptimizer orderOptimizer(lastPosition);
for(unsigned int i=0;i<polygons.size();i++)
Expand All @@ -168,7 +168,22 @@ void GCodePlanner::addLinesByOptimizer(Polygons& polygons, GCodePathConfig* conf
for(unsigned int i=0;i<orderOptimizer.polyOrder.size();i++)
{
int nr = orderOptimizer.polyOrder[i];
addPolygon(polygons[nr], orderOptimizer.polyStart[nr], config);
// addPolygon(polygons[nr], orderOptimizer.polyStart[nr], config);
PolygonRef polygon = polygons[nr];
int start = orderOptimizer.polyStart[nr];
int end = 1 - start;
Point& p0 = polygon[start];
addTravel(p0);
Point& p1 = polygon[end];
addExtrusionMove(p1, config);
if (wipe_dist != 0)
{
int line_width = config->getLineWidth();
if (vSize2(p1-p0) > line_width * line_width * 4)
{ // otherwise line will get optimized by combining multiple into a single extrusion move
addExtrusionMove(p1 + normal(p1-p0, wipe_dist), config, 0.0);
}
}
}
}

Expand Down
8 changes: 7 additions & 1 deletion src/gcodePlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ class GCodePlanner

void addPolygonsByOptimizer(Polygons& polygons, GCodePathConfig* config, WallOverlapComputation* wall_overlap_computation = nullptr);

void addLinesByOptimizer(Polygons& polygons, GCodePathConfig* config);
/*!
* Add lines to the gcode with optimized order.
* \param polygons The lines
* \param config The config of the lines
* \param wipe_dist (optional) the distance wiped without extruding after laying down a line.
*/
void addLinesByOptimizer(Polygons& polygons, GCodePathConfig* config, int wipe_dist = 0);

void forceMinimalLayerTime(double minTime, double minimalSpeed, double travelTime, double extrusionTime);

Expand Down

0 comments on commit 941354c

Please sign in to comment.