Comparar commits

..

11 Commits

Autor SHA1 Mensagem Data
daid 22b0d0fe6a Add nozzle diameter parameter for UltiGCode in preperation for some things. 2015-10-08 11:44:54 +02:00
daid 7b2b9630c7 Merge pull request #161 from mosh1/infill_perimeter_ordering
Add option to change print order of infill vs perimeters. Default prints...
2015-03-03 11:37:04 +01:00
Moshen Chan 4621d77a17 Add option to change print order of infill vs perimeters. Default prints infill first as was changed in v15, but this can lead to surface quality issues where infill would show on surface. This adds the option to change the order. 2015-02-27 00:50:50 -08:00
daid 5a6ebd4156 Merge branch 'master' of github.com:Ultimaker/CuraEngine 2015-01-16 12:17:31 +01:00
daid 0fdec5246b CNC GCode needs P instead of S parameters. 2015-01-16 12:17:22 +01:00
daid bbed68e588 Merge pull request #153 from presslab-us/fixskintravel
Use retract on skins
2015-01-14 14:32:03 +01:00
Ryan Press 49d5a81d02 Add option to disable combing on skin surfaces
The existing enableCombing options 0, 1 work as before.  A new
option 2 disables combing on the skin surfaces.  This forces a
retract to reduce the unsightly scarring on flat surfaces.
2015-01-09 14:20:52 -08:00
Ryan Press 3e980a84fd slab-us presslab-us authored 5 days ago evert "Use retract on skins"
This reverts commit af14f82a7f.
Because this option should be configurable, change the implementation.
2015-01-09 10:06:39 -08:00
Ryan Press af14f82a7f Use retract on skins
Using combing on skins causes unsightly scarring on flat surfaces.
By forcing a retract between travel moves we can lift the head
above the surface to avoid this.
2015-01-04 14:19:50 -08:00
daid ff4fa3581e Fix the raft printing speed. 2014-12-18 11:02:18 +01:00
daid 2bef59e79b Seperate the skin and infill to give them different speeds. Also change the printing order of this to handle pressure differences better. Which should increase print quality on advanced profiles. 2014-12-16 15:54:55 +01:00
4 arquivos alterados com 121 adições e 65 exclusões
+97 -61
Ver Arquivo
@@ -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)
+4
Ver Arquivo
@@ -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
Ver Arquivo
@@ -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;
}
+13
Ver Arquivo
@@ -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;