Comparar commits
8 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 7b2b9630c7 | |||
| 4621d77a17 | |||
| 5a6ebd4156 | |||
| 0fdec5246b | |||
| bbed68e588 | |||
| 49d5a81d02 | |||
| 3e980a84fd | |||
| af14f82a7f |
+81
-55
@@ -540,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)
|
||||
@@ -595,70 +595,31 @@ 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)
|
||||
|
||||
// Add either infill or perimeter first depending on option
|
||||
if (!config.perimeterBeforeInfill)
|
||||
{
|
||||
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)
|
||||
addInfillToGCode(part, gcodeLayer, layerNr, extrusionWidth, fillAngle);
|
||||
addInsetToGCode(part, gcodeLayer, layerNr);
|
||||
}else
|
||||
{
|
||||
if (config.spiralizeMode)
|
||||
{
|
||||
if (static_cast<int>(layerNr) >= config.downSkinCount)
|
||||
inset0Config.spiralize = true;
|
||||
if (static_cast<int>(layerNr) == config.downSkinCount && part->insets.size() > 0)
|
||||
gcodeLayer.addPolygonsByOptimizer(part->insets[0], &insetXConfig);
|
||||
}
|
||||
for(int insetNr=part->insets.size()-1; insetNr>-1; insetNr--)
|
||||
{
|
||||
if (insetNr == 0)
|
||||
gcodeLayer.addPolygonsByOptimizer(part->insets[insetNr], &inset0Config);
|
||||
else
|
||||
gcodeLayer.addPolygonsByOptimizer(part->insets[insetNr], &insetXConfig);
|
||||
}
|
||||
addInsetToGCode(part, gcodeLayer, layerNr);
|
||||
addInfillToGCode(part, gcodeLayer, layerNr, extrusionWidth, fillAngle);
|
||||
}
|
||||
|
||||
Polygons skinPolygons;
|
||||
@@ -669,6 +630,11 @@ private:
|
||||
bridge = bridgeAngle(outline, &storage.volumes[volumeIdx].layers[layerNr-1]);
|
||||
generateLineInfill(outline, skinPolygons, extrusionWidth, extrusionWidth, config.infillOverlap, (bridge > -1) ? bridge : fillAngle);
|
||||
}
|
||||
if (config.enableCombing == COMBING_NOSKIN)
|
||||
{
|
||||
gcodeLayer.setCombBoundary(nullptr);
|
||||
gcodeLayer.setAlwaysRetract(true);
|
||||
}
|
||||
gcodeLayer.addPolygonsByOptimizer(skinPolygons, &skinConfig);
|
||||
|
||||
|
||||
@@ -679,6 +645,66 @@ private:
|
||||
gcodeLayer.setCombBoundary(nullptr);
|
||||
}
|
||||
|
||||
void addInfillToGCode(SliceLayerPart* part, GCodePlanner& gcodeLayer, int layerNr, int extrusionWidth, int fillAngle)
|
||||
{
|
||||
Polygons infillPolygons;
|
||||
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);
|
||||
}
|
||||
|
||||
void addInsetToGCode(SliceLayerPart* part, GCodePlanner& gcodeLayer, int layerNr)
|
||||
{
|
||||
if (config.insetCount > 0)
|
||||
{
|
||||
if (config.spiralizeMode)
|
||||
{
|
||||
if (static_cast<int>(layerNr) >= config.downSkinCount)
|
||||
inset0Config.spiralize = true;
|
||||
if (static_cast<int>(layerNr) == config.downSkinCount && part->insets.size() > 0)
|
||||
gcodeLayer.addPolygonsByOptimizer(part->insets[0], &insetXConfig);
|
||||
}
|
||||
for(int insetNr=part->insets.size()-1; insetNr>-1; insetNr--)
|
||||
{
|
||||
if (insetNr == 0)
|
||||
gcodeLayer.addPolygonsByOptimizer(part->insets[insetNr], &inset0Config);
|
||||
else
|
||||
gcodeLayer.addPolygonsByOptimizer(part->insets[insetNr], &insetXConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void addSupportToGCode(SliceDataStorage& storage, GCodePlanner& gcodeLayer, int layerNr)
|
||||
{
|
||||
if (!storage.support.generated)
|
||||
|
||||
@@ -372,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);
|
||||
}
|
||||
@@ -379,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");
|
||||
}
|
||||
|
||||
+5
-4
@@ -44,6 +44,7 @@ ConfigSettings::ConfigSettings()
|
||||
SETTING(infillSpeed, 50);
|
||||
SETTING(infillPattern, INFILL_AUTOMATIC);
|
||||
SETTING(skinSpeed, 50);
|
||||
SETTING(perimeterBeforeInfill, 0);
|
||||
|
||||
SETTING(supportType, SUPPORT_TYPE_GRID);
|
||||
SETTING(supportAngle, -1);
|
||||
@@ -61,7 +62,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);
|
||||
@@ -199,7 +200,7 @@ bool ConfigSettings::readSettings(const char* path) {
|
||||
|
||||
if(!config.good()) return false;
|
||||
|
||||
while(config.good()) {
|
||||
while(config.good()) {
|
||||
bool multilineContent = false;
|
||||
size_t pos = std::string::npos;
|
||||
std::getline(config, line);
|
||||
@@ -223,7 +224,7 @@ bool ConfigSettings::readSettings(const char* path) {
|
||||
|
||||
// Are we about to read a multiline string?
|
||||
if(val == CONFIG_MULTILINE_SEPARATOR) {
|
||||
val = "";
|
||||
val = "";
|
||||
multilineContent = true;
|
||||
bool done_multiline = false;
|
||||
|
||||
@@ -245,7 +246,7 @@ bool ConfigSettings::readSettings(const char* path) {
|
||||
// to the parsed value
|
||||
RTRIM_STRING(val);
|
||||
}
|
||||
else {
|
||||
else {
|
||||
line += "\n";
|
||||
val += line;
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
@@ -157,6 +167,7 @@ public:
|
||||
int infillSpeed;
|
||||
int infillPattern;
|
||||
int skinSpeed;
|
||||
int perimeterBeforeInfill;
|
||||
|
||||
//Support material
|
||||
int supportType;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário