Comparar commits
12 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 5a6ebd4156 | |||
| 0fdec5246b | |||
| bbed68e588 | |||
| 49d5a81d02 | |||
| 3e980a84fd | |||
| af14f82a7f | |||
| ff4fa3581e | |||
| 2bef59e79b | |||
| 2e5b72cfef | |||
| 3aa638ea42 | |||
| edf2f897d1 | |||
| cacffadc61 |
+71
-53
@@ -25,7 +25,8 @@ private:
|
||||
GCodePathConfig skirtConfig;
|
||||
GCodePathConfig inset0Config;
|
||||
GCodePathConfig insetXConfig;
|
||||
GCodePathConfig fillConfig;
|
||||
GCodePathConfig infillConfig;
|
||||
GCodePathConfig skinConfig;
|
||||
GCodePathConfig supportConfig;
|
||||
public:
|
||||
fffProcessor(ConfigSettings& config)
|
||||
@@ -98,7 +99,8 @@ private:
|
||||
skirtConfig.setData(config.printSpeed, config.extrusionWidth, "SKIRT");
|
||||
inset0Config.setData(config.inset0Speed, config.extrusionWidth, "WALL-OUTER");
|
||||
insetXConfig.setData(config.insetXSpeed, config.extrusionWidth, "WALL-INNER");
|
||||
fillConfig.setData(config.infillSpeed, config.extrusionWidth, "FILL");
|
||||
infillConfig.setData(config.infillSpeed, config.extrusionWidth, "FILL");
|
||||
skinConfig.setData(config.skinSpeed, config.extrusionWidth, "FILL");
|
||||
supportConfig.setData(config.printSpeed, config.extrusionWidth, "SUPPORT");
|
||||
|
||||
for(unsigned int n=1; n<MAX_EXTRUDERS;n++)
|
||||
@@ -190,7 +192,7 @@ private:
|
||||
{
|
||||
//Reporting the outline here slows down the engine quite a bit, so only do so when debugging.
|
||||
//sendPolygonsToGui("outline", layerNr, slicer->layers[layerNr].z, slicer->layers[layerNr].polygonList);
|
||||
sendPolygonsToGui("openoutline", layerNr, slicer->layers[layerNr].z, slicer->layers[layerNr].openPolygonList);
|
||||
sendPolygonsToGui("openoutline", layerNr, slicer->layers[layerNr].z, slicer->layers[layerNr].openPolygons);
|
||||
}
|
||||
}
|
||||
cura::log("Sliced model in %5.3fs\n", timeKeeper.restart());
|
||||
@@ -368,8 +370,8 @@ private:
|
||||
sendPolygonsToGui("support", 0, config.raftBaseThickness + config.raftInterfaceThickness, storage.raftOutline);
|
||||
|
||||
GCodePathConfig raftBaseConfig((config.raftBaseSpeed <= 0) ? config.initialLayerSpeed : config.raftBaseSpeed, config.raftBaseLinewidth, "SUPPORT");
|
||||
GCodePathConfig raftMiddleConfig(config.printSpeed, config.raftInterfaceLinewidth, "SUPPORT");
|
||||
GCodePathConfig raftInterfaceConfig(config.printSpeed, config.raftInterfaceLinewidth, "SUPPORT");
|
||||
GCodePathConfig raftMiddleConfig((config.raftBaseSpeed <= 0) ? config.initialLayerSpeed : config.raftBaseSpeed, config.raftInterfaceLinewidth, "SUPPORT");
|
||||
GCodePathConfig raftInterfaceConfig((config.raftBaseSpeed <= 0) ? config.initialLayerSpeed : config.raftBaseSpeed, config.raftInterfaceLinewidth, "SUPPORT");
|
||||
GCodePathConfig raftSurfaceConfig((config.raftSurfaceSpeed > 0) ? config.raftSurfaceSpeed : config.printSpeed, config.raftSurfaceLinewidth, "SUPPORT");
|
||||
|
||||
{
|
||||
@@ -441,14 +443,16 @@ private:
|
||||
skirtConfig.setData(SPEED_SMOOTH(config.printSpeed), extrusionWidth, "SKIRT");
|
||||
inset0Config.setData(SPEED_SMOOTH(config.inset0Speed), extrusionWidth, "WALL-OUTER");
|
||||
insetXConfig.setData(SPEED_SMOOTH(config.insetXSpeed), extrusionWidth, "WALL-INNER");
|
||||
fillConfig.setData(SPEED_SMOOTH(config.infillSpeed), extrusionWidth, "FILL");
|
||||
infillConfig.setData(SPEED_SMOOTH(config.infillSpeed), extrusionWidth, "FILL");
|
||||
skinConfig.setData(SPEED_SMOOTH(config.skinSpeed), extrusionWidth, "SKIN");
|
||||
supportConfig.setData(SPEED_SMOOTH(config.printSpeed), extrusionWidth, "SUPPORT");
|
||||
#undef SPEED_SMOOTH
|
||||
}else{
|
||||
skirtConfig.setData(config.printSpeed, extrusionWidth, "SKIRT");
|
||||
inset0Config.setData(config.inset0Speed, extrusionWidth, "WALL-OUTER");
|
||||
insetXConfig.setData(config.insetXSpeed, extrusionWidth, "WALL-INNER");
|
||||
fillConfig.setData(config.infillSpeed, extrusionWidth, "FILL");
|
||||
infillConfig.setData(config.infillSpeed, extrusionWidth, "FILL");
|
||||
skinConfig.setData(config.skinSpeed, extrusionWidth, "SKIN");
|
||||
supportConfig.setData(config.printSpeed, extrusionWidth, "SUPPORT");
|
||||
}
|
||||
|
||||
@@ -471,6 +475,7 @@ private:
|
||||
}
|
||||
}
|
||||
gcode.setZ(z);
|
||||
gcode.resetStartPosition();
|
||||
|
||||
bool printSupportFirst = (storage.support.generated && config.supportExtruder > 0 && config.supportExtruder == gcodeLayer.getExtruder());
|
||||
if (printSupportFirst)
|
||||
@@ -535,7 +540,7 @@ private:
|
||||
gcodeLayer.setAlwaysRetract(true);
|
||||
gcodeLayer.addPolygonsByOptimizer(storage.oozeShield[layerNr], &skirtConfig);
|
||||
sendPolygonsToGui("oozeshield", layerNr, layer->printZ, storage.oozeShield[layerNr]);
|
||||
gcodeLayer.setAlwaysRetract(!config.enableCombing);
|
||||
gcodeLayer.setAlwaysRetract(config.enableCombing == COMBING_OFF);
|
||||
}
|
||||
|
||||
if (config.simpleMode)
|
||||
@@ -579,7 +584,7 @@ private:
|
||||
}
|
||||
|
||||
|
||||
PathOrderOptimizer partOrderOptimizer(gcode.getPositionXY());
|
||||
PathOrderOptimizer partOrderOptimizer(gcode.getStartPositionXY());
|
||||
for(unsigned int partNr=0; partNr<layer->parts.size(); partNr++)
|
||||
{
|
||||
partOrderOptimizer.addPolygon(layer->parts[partNr].insets[0][0]);
|
||||
@@ -590,10 +595,57 @@ private:
|
||||
{
|
||||
SliceLayerPart* part = &layer->parts[partOrderOptimizer.polyOrder[partCounter]];
|
||||
|
||||
if (config.enableCombing)
|
||||
gcodeLayer.setCombBoundary(&part->combBoundery);
|
||||
else
|
||||
if (config.enableCombing == COMBING_OFF)
|
||||
{
|
||||
gcodeLayer.setAlwaysRetract(true);
|
||||
}else
|
||||
{
|
||||
gcodeLayer.setCombBoundary(&part->combBoundery);
|
||||
gcodeLayer.setAlwaysRetract(false);
|
||||
}
|
||||
|
||||
Polygons infillPolygons;
|
||||
int fillAngle = 45;
|
||||
if (layerNr & 1)
|
||||
fillAngle += 90;
|
||||
int extrusionWidth = config.extrusionWidth;
|
||||
if (layerNr == 0)
|
||||
extrusionWidth = config.layer0extrusionWidth;
|
||||
if (config.sparseInfillLineDistance > 0)
|
||||
{
|
||||
switch (config.infillPattern)
|
||||
{
|
||||
case INFILL_AUTOMATIC:
|
||||
generateAutomaticInfill(
|
||||
part->sparseOutline, infillPolygons, extrusionWidth,
|
||||
config.sparseInfillLineDistance,
|
||||
config.infillOverlap, fillAngle);
|
||||
break;
|
||||
|
||||
case INFILL_GRID:
|
||||
generateGridInfill(part->sparseOutline, infillPolygons,
|
||||
extrusionWidth,
|
||||
config.sparseInfillLineDistance,
|
||||
config.infillOverlap, fillAngle);
|
||||
break;
|
||||
|
||||
case INFILL_LINES:
|
||||
generateLineInfill(part->sparseOutline, infillPolygons,
|
||||
extrusionWidth,
|
||||
config.sparseInfillLineDistance,
|
||||
config.infillOverlap, fillAngle);
|
||||
break;
|
||||
|
||||
case INFILL_CONCENTRIC:
|
||||
generateConcentricInfill(
|
||||
part->sparseOutline, infillPolygons,
|
||||
config.sparseInfillLineDistance);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gcodeLayer.addPolygonsByOptimizer(infillPolygons, &infillConfig);
|
||||
//sendPolygonsToGui("infill", layerNr, layer->z, fillPolygons);
|
||||
|
||||
if (config.insetCount > 0)
|
||||
{
|
||||
@@ -612,56 +664,22 @@ private:
|
||||
gcodeLayer.addPolygonsByOptimizer(part->insets[insetNr], &insetXConfig);
|
||||
}
|
||||
}
|
||||
|
||||
Polygons fillPolygons;
|
||||
int fillAngle = 45;
|
||||
if (layerNr & 1)
|
||||
fillAngle += 90;
|
||||
int extrusionWidth = config.extrusionWidth;
|
||||
if (layerNr == 0)
|
||||
extrusionWidth = config.layer0extrusionWidth;
|
||||
|
||||
Polygons skinPolygons;
|
||||
for(Polygons outline : part->skinOutline.splitIntoParts())
|
||||
{
|
||||
int bridge = -1;
|
||||
if (layerNr > 0)
|
||||
bridge = bridgeAngle(outline, &storage.volumes[volumeIdx].layers[layerNr-1]);
|
||||
generateLineInfill(outline, fillPolygons, extrusionWidth, extrusionWidth, config.infillOverlap, (bridge > -1) ? bridge : fillAngle);
|
||||
generateLineInfill(outline, skinPolygons, extrusionWidth, extrusionWidth, config.infillOverlap, (bridge > -1) ? bridge : fillAngle);
|
||||
}
|
||||
if (config.sparseInfillLineDistance > 0)
|
||||
if (config.enableCombing == COMBING_NOSKIN)
|
||||
{
|
||||
switch (config.infillPattern)
|
||||
{
|
||||
case INFILL_AUTOMATIC:
|
||||
generateAutomaticInfill(
|
||||
part->sparseOutline, fillPolygons, extrusionWidth,
|
||||
config.sparseInfillLineDistance,
|
||||
config.infillOverlap, fillAngle);
|
||||
break;
|
||||
|
||||
case INFILL_GRID:
|
||||
generateGridInfill(part->sparseOutline, fillPolygons,
|
||||
extrusionWidth,
|
||||
config.sparseInfillLineDistance,
|
||||
config.infillOverlap, fillAngle);
|
||||
break;
|
||||
|
||||
case INFILL_LINES:
|
||||
generateLineInfill(part->sparseOutline, fillPolygons,
|
||||
extrusionWidth,
|
||||
config.sparseInfillLineDistance,
|
||||
config.infillOverlap, fillAngle);
|
||||
break;
|
||||
|
||||
case INFILL_CONCENTRIC:
|
||||
generateConcentricInfill(
|
||||
part->sparseOutline, fillPolygons,
|
||||
config.sparseInfillLineDistance);
|
||||
break;
|
||||
}
|
||||
gcodeLayer.setCombBoundary(nullptr);
|
||||
gcodeLayer.setAlwaysRetract(true);
|
||||
}
|
||||
gcodeLayer.addPolygonsByOptimizer(skinPolygons, &skinConfig);
|
||||
|
||||
gcodeLayer.addPolygonsByOptimizer(fillPolygons, &fillConfig);
|
||||
//sendPolygonsToGui("infill", layerNr, layer->z, fillPolygons);
|
||||
|
||||
//After a layer part, make sure the nozzle is inside the comb boundary, so we do not retract on the perimeter.
|
||||
if (!config.spiralizeMode || static_cast<int>(layerNr) < config.downSkinCount)
|
||||
|
||||
+17
-1
@@ -11,7 +11,7 @@
|
||||
namespace cura {
|
||||
|
||||
GCodeExport::GCodeExport()
|
||||
: currentPosition(0,0,0)
|
||||
: currentPosition(0,0,0), startPosition(INT32_MIN,INT32_MIN,0)
|
||||
{
|
||||
extrusionAmount = 0;
|
||||
extrusionPerMM = 0;
|
||||
@@ -129,6 +129,17 @@ Point GCodeExport::getPositionXY()
|
||||
return Point(currentPosition.x, currentPosition.y);
|
||||
}
|
||||
|
||||
void GCodeExport::resetStartPosition()
|
||||
{
|
||||
startPosition.x = INT32_MIN;
|
||||
startPosition.y = INT32_MIN;
|
||||
}
|
||||
|
||||
Point GCodeExport::getStartPositionXY()
|
||||
{
|
||||
return Point(startPosition.x, startPosition.y);
|
||||
}
|
||||
|
||||
int GCodeExport::getPositionZ()
|
||||
{
|
||||
return currentPosition.z;
|
||||
@@ -284,6 +295,7 @@ void GCodeExport::writeMove(Point p, int speed, int lineWidth)
|
||||
}
|
||||
|
||||
currentPosition = Point3(p.X, p.Y, zPos);
|
||||
startPosition = currentPosition;
|
||||
estimateCalculator.plan(TimeEstimateCalculator::Position(INT2MM(currentPosition.x), INT2MM(currentPosition.y), INT2MM(currentPosition.z), extrusionAmount), speed);
|
||||
}
|
||||
|
||||
@@ -360,6 +372,8 @@ void GCodeExport::writeFanCommand(int speed)
|
||||
{
|
||||
if (flavor == GCODE_FLAVOR_MAKERBOT)
|
||||
fprintf(f, "M126 T0 ; value = %d\n", speed * 255 / 100);
|
||||
else if (flavor == GCODE_FLAVOR_MACH3)
|
||||
fprintf(f, "M106 P%d\n", speed * 255 / 100);
|
||||
else
|
||||
fprintf(f, "M106 S%d\n", speed * 255 / 100);
|
||||
}
|
||||
@@ -367,6 +381,8 @@ void GCodeExport::writeFanCommand(int speed)
|
||||
{
|
||||
if (flavor == GCODE_FLAVOR_MAKERBOT)
|
||||
fprintf(f, "M127 T0\n");
|
||||
else if (flavor == GCODE_FLAVOR_MACH3)
|
||||
fprintf(f, "M106 P%d\n", 0);
|
||||
else
|
||||
fprintf(f, "M107\n");
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ private:
|
||||
double minimalExtrusionBeforeRetraction;
|
||||
double extrusionAmountAtPreviousRetraction;
|
||||
Point3 currentPosition;
|
||||
Point3 startPosition;
|
||||
Point extruderOffset[MAX_EXTRUDERS];
|
||||
char extruderCharacter[MAX_EXTRUDERS];
|
||||
int currentSpeed, retractionSpeed;
|
||||
@@ -67,6 +68,10 @@ public:
|
||||
|
||||
Point getPositionXY();
|
||||
|
||||
void resetStartPosition();
|
||||
|
||||
Point getStartPositionXY();
|
||||
|
||||
int getPositionZ();
|
||||
|
||||
int getExtruderNr();
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ namespace cura {
|
||||
|
||||
void createLayerWithParts(SliceLayer& storageLayer, SlicerLayer* layer, int unionAllType)
|
||||
{
|
||||
storageLayer.openLines = layer->openPolygonList;
|
||||
storageLayer.openLines = layer->openPolygons;
|
||||
|
||||
if (unionAllType & FIX_HORRIBLE_UNION_ALL_TYPE_B)
|
||||
{
|
||||
|
||||
@@ -44,6 +44,7 @@ OptimizedVolume::OptimizedVolume(SimpleVolume* volume, OptimizedModel* model)
|
||||
}
|
||||
if (f.index[0] != f.index[1] && f.index[0] != f.index[2] && f.index[1] != f.index[2])
|
||||
{
|
||||
/*
|
||||
//Check if there is a face with the same points
|
||||
bool duplicate = false;
|
||||
for(unsigned int _idx0 = 0; _idx0 < points[f.index[0]].faceIndexList.size(); _idx0++)
|
||||
@@ -59,11 +60,12 @@ OptimizedVolume::OptimizedVolume(SimpleVolume* volume, OptimizedModel* model)
|
||||
}
|
||||
if (!duplicate)
|
||||
{
|
||||
points[f.index[0]].faceIndexList.push_back(faces.size());
|
||||
points[f.index[1]].faceIndexList.push_back(faces.size());
|
||||
points[f.index[2]].faceIndexList.push_back(faces.size());
|
||||
faces.push_back(f);
|
||||
}
|
||||
*/
|
||||
points[f.index[0]].faceIndexList.push_back(faces.size());
|
||||
points[f.index[1]].faceIndexList.push_back(faces.size());
|
||||
points[f.index[2]].faceIndexList.push_back(faces.size());
|
||||
faces.push_back(f);
|
||||
//}
|
||||
}
|
||||
}
|
||||
//fprintf(stdout, "\rAll faces are optimized in %5.1fs.\n",timeElapsed(t));
|
||||
|
||||
+2
-1
@@ -43,6 +43,7 @@ ConfigSettings::ConfigSettings()
|
||||
SETTING(infillOverlap, 15);
|
||||
SETTING(infillSpeed, 50);
|
||||
SETTING(infillPattern, INFILL_AUTOMATIC);
|
||||
SETTING(skinSpeed, 50);
|
||||
|
||||
SETTING(supportType, SUPPORT_TYPE_GRID);
|
||||
SETTING(supportAngle, -1);
|
||||
@@ -60,7 +61,7 @@ ConfigSettings::ConfigSettings()
|
||||
SETTING(minimalExtrusionBeforeRetraction, 100);
|
||||
SETTING(retractionZHop, 0);
|
||||
|
||||
SETTING(enableCombing, 1);
|
||||
SETTING(enableCombing, COMBING_ALL);
|
||||
SETTING(enableOozeShield, 0);
|
||||
SETTING(wipeTowerSize, 0);
|
||||
SETTING(multiVolumeOverlap, 0);
|
||||
|
||||
@@ -101,6 +101,16 @@ enum Infill_Pattern
|
||||
INFILL_CONCENTRIC = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* Where to use the combing feature
|
||||
*/
|
||||
enum Combing_Feature
|
||||
{
|
||||
COMBING_OFF = 0,
|
||||
COMBING_ALL = 1,
|
||||
COMBING_NOSKIN = 2,
|
||||
};
|
||||
|
||||
class _ConfigSettingIndex
|
||||
{
|
||||
public:
|
||||
@@ -156,6 +166,7 @@ public:
|
||||
int infillOverlap;
|
||||
int infillSpeed;
|
||||
int infillPattern;
|
||||
int skinSpeed;
|
||||
|
||||
//Support material
|
||||
int supportType;
|
||||
|
||||
+9
-18
@@ -11,6 +11,8 @@ namespace cura {
|
||||
|
||||
void SlicerLayer::makePolygons(OptimizedVolume* ov, bool keepNoneClosed, bool extensiveStitching)
|
||||
{
|
||||
Polygons openPolygonList;
|
||||
|
||||
for(unsigned int startSegment=0; startSegment < segmentList.size(); startSegment++)
|
||||
{
|
||||
if (segmentList[startSegment].addedToPolygon)
|
||||
@@ -261,19 +263,6 @@ void SlicerLayer::makePolygons(OptimizedVolume* ov, bool keepNoneClosed, bool ex
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
int q=0;
|
||||
for(unsigned int i=0;i<openPolygonList.size();i++)
|
||||
{
|
||||
if (openPolygonList[i].size() < 2) continue;
|
||||
if (!q) log("***\n");
|
||||
log("S: %f %f\n", float(openPolygonList[i][0].X), float(openPolygonList[i][0].Y));
|
||||
log("E: %f %f\n", float(openPolygonList[i][openPolygonList[i].size()-1].X), float(openPolygonList[i][openPolygonList[i].size()-1].Y));
|
||||
q = 1;
|
||||
}
|
||||
*/
|
||||
//if (q) exit(1);
|
||||
|
||||
if (keepNoneClosed)
|
||||
{
|
||||
for(unsigned int n=0; n<openPolygonList.size(); n++)
|
||||
@@ -282,8 +271,11 @@ void SlicerLayer::makePolygons(OptimizedVolume* ov, bool keepNoneClosed, bool ex
|
||||
polygonList.add(openPolygonList[n]);
|
||||
}
|
||||
}
|
||||
//Clear the openPolygonList to save memory, the only reason to keep it after this is for debugging.
|
||||
//openPolygonList.clear();
|
||||
for(unsigned int i=0;i<openPolygonList.size();i++)
|
||||
{
|
||||
if (openPolygonList[i].size() > 0)
|
||||
openPolygons.newPoly() = openPolygonList[i];
|
||||
}
|
||||
|
||||
//Remove all the tiny polygons, or polygons that are not closed. As they do not contribute to the actual print.
|
||||
int snapDistance = MM2INT(1.0);
|
||||
@@ -403,10 +395,9 @@ void Slicer::dumpSegmentsToHTML(const char* filename)
|
||||
}
|
||||
fprintf(f, "\"/>");
|
||||
fprintf(f, "</g>\n");
|
||||
for(unsigned int j=0; j<layers[i].openPolygonList.size(); j++)
|
||||
for(unsigned int j=0; j<layers[i].openPolygons.size(); j++)
|
||||
{
|
||||
PolygonRef p = layers[i].openPolygonList[j];
|
||||
if (p.size() < 1) continue;
|
||||
PolygonRef p = layers[i].openPolygons[j];
|
||||
fprintf(f, "<polyline marker-mid='url(#MidMarker)' points=\"");
|
||||
for(unsigned int n=0; n<p.size(); n++)
|
||||
{
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
int z;
|
||||
Polygons polygonList;
|
||||
Polygons openPolygonList;
|
||||
Polygons openPolygons;
|
||||
|
||||
void makePolygons(OptimizedVolume* ov, bool keepNoneClosed, bool extensiveStitching);
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário