Comparar commits
3 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 22b0d0fe6a | |||
| 7b2b9630c7 | |||
| 4621d77a17 |
+70
-51
@@ -344,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)
|
||||
@@ -604,65 +606,22 @@ private:
|
||||
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;
|
||||
@@ -688,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)
|
||||
|
||||
+5
-3
@@ -18,6 +18,7 @@ ConfigSettings *ConfigSettings::config = NULL;
|
||||
ConfigSettings::ConfigSettings()
|
||||
{
|
||||
config = this;
|
||||
SETTING(nozzleSize, 400);
|
||||
SETTING(layerThickness, 100);
|
||||
SETTING(initialLayerThickness, 300);
|
||||
SETTING(filamentDiameter, 2890);
|
||||
@@ -44,6 +45,7 @@ ConfigSettings::ConfigSettings()
|
||||
SETTING(infillSpeed, 50);
|
||||
SETTING(infillPattern, INFILL_AUTOMATIC);
|
||||
SETTING(skinSpeed, 50);
|
||||
SETTING(perimeterBeforeInfill, 0);
|
||||
|
||||
SETTING(supportType, SUPPORT_TYPE_GRID);
|
||||
SETTING(supportAngle, -1);
|
||||
@@ -199,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);
|
||||
@@ -223,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;
|
||||
|
||||
@@ -245,7 +247,7 @@ bool ConfigSettings::readSettings(const char* path) {
|
||||
// to the parsed value
|
||||
RTRIM_STRING(val);
|
||||
}
|
||||
else {
|
||||
else {
|
||||
line += "\n";
|
||||
val += line;
|
||||
}
|
||||
|
||||
@@ -126,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;
|
||||
@@ -167,6 +168,7 @@ public:
|
||||
int infillSpeed;
|
||||
int infillPattern;
|
||||
int skinSpeed;
|
||||
int perimeterBeforeInfill;
|
||||
|
||||
//Support material
|
||||
int supportType;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário