Comparar commits
11 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 22b0d0fe6a | |||
| 7b2b9630c7 | |||
| 4621d77a17 | |||
| 5a6ebd4156 | |||
| 0fdec5246b | |||
| bbed68e588 | |||
| 49d5a81d02 | |||
| 3e980a84fd | |||
| af14f82a7f | |||
| ff4fa3581e | |||
| 2bef59e79b |
+97
-61
@@ -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++)
|
||||
@@ -342,6 +344,8 @@ private:
|
||||
gcode.writeComment("TIME:<__TIME__>");
|
||||
gcode.writeComment("MATERIAL:<FILAMENT>");
|
||||
gcode.writeComment("MATERIAL2:<FILAMEN2>");
|
||||
gcode.writeComment("NOZZLE_DIAMETER:%f", float(config.nozzleSize) / 1000);
|
||||
gcode.writeComment("NOZZLE_DIAMETER2:%f", float(config.nozzleSize) / 1000);
|
||||
}
|
||||
gcode.writeCode(config.startCode.c_str());
|
||||
if (gcode.getFlavor() == GCODE_FLAVOR_BFB)
|
||||
@@ -368,8 +372,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 +445,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");
|
||||
}
|
||||
|
||||
@@ -536,7 +542,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)
|
||||
@@ -591,78 +597,48 @@ private:
|
||||
{
|
||||
SliceLayerPart* part = &layer->parts[partOrderOptimizer.polyOrder[partCounter]];
|
||||
|
||||
if (config.enableCombing)
|
||||
gcodeLayer.setCombBoundary(&part->combBoundery);
|
||||
else
|
||||
gcodeLayer.setAlwaysRetract(true);
|
||||
|
||||
if (config.insetCount > 0)
|
||||
if (config.enableCombing == COMBING_OFF)
|
||||
{
|
||||
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);
|
||||
}
|
||||
gcodeLayer.setAlwaysRetract(true);
|
||||
}else
|
||||
{
|
||||
gcodeLayer.setCombBoundary(&part->combBoundery);
|
||||
gcodeLayer.setAlwaysRetract(false);
|
||||
}
|
||||
|
||||
Polygons fillPolygons;
|
||||
int fillAngle = 45;
|
||||
if (layerNr & 1)
|
||||
fillAngle += 90;
|
||||
int extrusionWidth = config.extrusionWidth;
|
||||
if (layerNr == 0)
|
||||
extrusionWidth = config.layer0extrusionWidth;
|
||||
|
||||
// Add either infill or perimeter first depending on option
|
||||
if (!config.perimeterBeforeInfill)
|
||||
{
|
||||
addInfillToGCode(part, gcodeLayer, layerNr, extrusionWidth, fillAngle);
|
||||
addInsetToGCode(part, gcodeLayer, layerNr);
|
||||
}else
|
||||
{
|
||||
addInsetToGCode(part, gcodeLayer, layerNr);
|
||||
addInfillToGCode(part, gcodeLayer, layerNr, extrusionWidth, fillAngle);
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -671,6 +647,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");
|
||||
}
|
||||
|
||||
+7
-4
@@ -18,6 +18,7 @@ ConfigSettings *ConfigSettings::config = NULL;
|
||||
ConfigSettings::ConfigSettings()
|
||||
{
|
||||
config = this;
|
||||
SETTING(nozzleSize, 400);
|
||||
SETTING(layerThickness, 100);
|
||||
SETTING(initialLayerThickness, 300);
|
||||
SETTING(filamentDiameter, 2890);
|
||||
@@ -43,6 +44,8 @@ ConfigSettings::ConfigSettings()
|
||||
SETTING(infillOverlap, 15);
|
||||
SETTING(infillSpeed, 50);
|
||||
SETTING(infillPattern, INFILL_AUTOMATIC);
|
||||
SETTING(skinSpeed, 50);
|
||||
SETTING(perimeterBeforeInfill, 0);
|
||||
|
||||
SETTING(supportType, SUPPORT_TYPE_GRID);
|
||||
SETTING(supportAngle, -1);
|
||||
@@ -60,7 +63,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);
|
||||
@@ -198,7 +201,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);
|
||||
@@ -222,7 +225,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;
|
||||
|
||||
@@ -244,7 +247,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:
|
||||
@@ -116,6 +126,7 @@ private:
|
||||
std::vector<_ConfigSettingIndex> _index;
|
||||
public:
|
||||
static ConfigSettings *config; // allow access to config settings from everywhere
|
||||
int nozzleSize;
|
||||
int layerThickness;
|
||||
int initialLayerThickness;
|
||||
int filamentDiameter;
|
||||
@@ -156,6 +167,8 @@ public:
|
||||
int infillOverlap;
|
||||
int infillSpeed;
|
||||
int infillPattern;
|
||||
int skinSpeed;
|
||||
int perimeterBeforeInfill;
|
||||
|
||||
//Support material
|
||||
int supportType;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário