Comparar commits

..

22 Commits

Autor SHA1 Mensagem Data
daid aca2c17eba Allow the engine to use dynamic acceleration settings to get better time estimates. 2016-03-22 16:29:32 +01:00
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
daid 2e5b72cfef Merge pull request #150 from presslab-us/fixpathstart
Reset start position for new layers
2014-12-15 09:59:11 +01:00
Ryan Press 3aa638ea42 Reset start position for new layers
Reset the start position of the path optimizer for each new layer
so that it doesn't double up on the layers, causing problems for
cooling.
2014-12-14 09:08:17 -08:00
daid edf2f897d1 Change how open polygons are saved. As std::vector never clears memory and the old implementation could mean a lot of memory was never freed. 2014-12-12 11:00:33 +01:00
daid cacffadc61 It looks like removing duplicate faces actually has a negative effect on "bad" model. 2014-12-10 08:54:38 +01:00
daid d7a26ab715 Improve skirt handling with support material 2014-12-03 15:39:30 +01:00
daid 65dc9fe64b Fix #144 for dos format files. 2014-11-26 15:08:09 +01:00
daid db6c9a05e0 Merge branch 'master' of github.com:Ultimaker/CuraEngine 2014-11-26 12:14:08 +01:00
daid 93e2cda988 Fix BFB support. 2014-11-26 12:12:57 +01:00
daid d49257d30c Merge pull request #141 from qbit/master
Add flags for OpenBSD
2014-11-24 07:25:31 +01:00
Aaron Bieber e53408dc52 Flags for OpenBSD 2014-11-20 18:06:06 -07:00
13 arquivos alterados com 234 adições e 109 exclusões
+3
Ver Arquivo
@@ -53,6 +53,9 @@ else
LDFLAGS += --static -flto
endif
endif
ifeq ($(UNAME), OpenBSD)
LDFLAGS += -lm -lpthread
endif
ifeq ($(UNAME), Darwin)
OPEN_HTML=open
#For MacOS force to build
+101 -63
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++)
@@ -106,6 +108,7 @@ private:
gcode.setSwitchExtruderCode(config.preSwitchExtruderCode, config.postSwitchExtruderCode);
gcode.setFlavor(config.gcodeFlavor);
gcode.setRetractionSettings(config.retractionAmount, config.retractionSpeed, config.retractionAmountExtruderSwitch, config.minimalExtrusionBeforeRetraction, config.retractionZHop, config.retractionAmountPrime);
gcode.applyAccelerationSettings(config);
}
bool prepareModel(SliceDataStorage& storage, const std::vector<std::string> &files)
@@ -190,7 +193,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());
@@ -342,6 +345,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 +373,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 +446,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 +478,7 @@ private:
}
}
gcode.setZ(z);
gcode.resetStartPosition();
bool printSupportFirst = (storage.support.generated && config.supportExtruder > 0 && config.supportExtruder == gcodeLayer.getExtruder());
if (printSupportFirst)
@@ -535,7 +543,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 +587,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,78 +598,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)
@@ -670,6 +648,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)
+41 -9
Ver Arquivo
@@ -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;
@@ -85,6 +85,7 @@ void GCodeExport::setFlavor(int flavor)
for(int n=0; n<MAX_EXTRUDERS; n++)
extruderCharacter[n] = 'E';
}
int GCodeExport::getFlavor()
{
return this->flavor;
@@ -119,6 +120,11 @@ void GCodeExport::setRetractionSettings(int retractionAmount, int retractionSpee
this->retractionZHop = zHop;
}
void GCodeExport::applyAccelerationSettings(ConfigSettings& config)
{
estimateCalculator.applyAccelerationSettings(config);
}
void GCodeExport::setZ(int z)
{
this->zPos = z;
@@ -129,6 +135,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;
@@ -163,7 +180,10 @@ void GCodeExport::writeComment(const char* comment, ...)
va_start(args, comment);
fprintf(f, ";");
vfprintf(f, comment, args);
fprintf(f, "\n");
if (flavor == GCODE_FLAVOR_BFB)
fprintf(f, "\r\n");
else
fprintf(f, "\n");
va_end(args);
}
@@ -172,7 +192,10 @@ void GCodeExport::writeLine(const char* line, ...)
va_list args;
va_start(args, line);
vfprintf(f, line, args);
fprintf(f, "\n");
if (flavor == GCODE_FLAVOR_BFB)
fprintf(f, "\r\n");
else
fprintf(f, "\n");
va_end(args);
}
@@ -212,10 +235,10 @@ void GCodeExport::writeMove(Point p, int speed, int lineWidth)
if (currentSpeed != int(rpm * 10))
{
//fprintf(f, "; %f e-per-mm %d mm-width %d mm/s\n", extrusionPerMM, lineWidth, speed);
fprintf(f, "M108 S%0.1f\n", rpm);
fprintf(f, "M108 S%0.1f\r\n", rpm);
currentSpeed = int(rpm * 10);
}
fprintf(f, "M%d01\n", extruderNr);
fprintf(f, "M%d01\r\n", extruderNr + 1);
isRetracted = false;
}
//Fix the speed by the actual RPM we are asking, because of rounding errors we cannot get all RPM values, but we have a lot more resolution in the feedrate value.
@@ -229,11 +252,11 @@ void GCodeExport::writeMove(Point p, int speed, int lineWidth)
//If we are not extruding, check if we still need to disable the extruder. This causes a retraction due to auto-retraction.
if (!isRetracted)
{
fprintf(f, "M103\n");
fprintf(f, "M103\r\n");
isRetracted = true;
}
}
fprintf(f, "G1 X%0.3f Y%0.3f Z%0.3f F%0.1f\n", INT2MM(p.X - extruderOffset[extruderNr].X), INT2MM(p.Y - extruderOffset[extruderNr].Y), INT2MM(zPos), fspeed);
fprintf(f, "G1 X%0.3f Y%0.3f Z%0.3f F%0.1f\r\n", INT2MM(p.X - extruderOffset[extruderNr].X), INT2MM(p.Y - extruderOffset[extruderNr].Y), INT2MM(zPos), fspeed);
}else{
//Normal E handling.
@@ -278,6 +301,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);
}
@@ -310,7 +334,7 @@ void GCodeExport::switchExtruder(int newExtruder)
if (flavor == GCODE_FLAVOR_BFB)
{
if (!isRetracted)
fprintf(f, "M103\n");
fprintf(f, "M103\r\n");
isRetracted = true;
return;
}
@@ -339,7 +363,11 @@ void GCodeExport::switchExtruder(int newExtruder)
void GCodeExport::writeCode(const char* str)
{
fprintf(f, "%s\n", str);
fprintf(f, "%s", str);
if (flavor == GCODE_FLAVOR_BFB)
fprintf(f, "\r\n");
else
fprintf(f, "\n");
}
void GCodeExport::writeFanCommand(int speed)
@@ -350,6 +378,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);
}
@@ -357,6 +387,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
Ver Arquivo
@@ -27,6 +27,7 @@ private:
double minimalExtrusionBeforeRetraction;
double extrusionAmountAtPreviousRetraction;
Point3 currentPosition;
Point3 startPosition;
Point extruderOffset[MAX_EXTRUDERS];
char extruderCharacter[MAX_EXTRUDERS];
int currentSpeed, retractionSpeed;
@@ -63,10 +64,16 @@ public:
void setRetractionSettings(int retractionAmount, int retractionSpeed, int extruderSwitchRetraction, int minimalExtrusionBeforeRetraction, int zHop, int retractionAmountPrime);
void applyAccelerationSettings(ConfigSettings& config);
void setZ(int z);
Point getPositionXY();
void resetStartPosition();
Point getStartPositionXY();
int getPositionZ();
int getExtruderNr();
+1 -1
Ver Arquivo
@@ -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)
{
+7 -5
Ver Arquivo
@@ -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));
+18 -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);
@@ -149,6 +152,17 @@ ConfigSettings::ConfigSettings()
"G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n"
"M84 ;steppers off\n"
"G90 ;absolute positioning\n";
//Time estimate settings
SETTING(acceleration, 3000 * 1000);
SETTING(max_acceleration[0], 9000 * 1000);
SETTING(max_acceleration[1], 9000 * 1000);
SETTING(max_acceleration[2], 100 * 1000);
SETTING(max_acceleration[3], 10000 * 1000);
SETTING(max_xy_jerk, 20.0 * 1000);
SETTING(max_z_jerk, 0.4 * 1000);
SETTING(max_e_jerk, 5.0 * 1000);
}
#undef STRINGIFY
@@ -198,7 +212,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 +236,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 +258,7 @@ bool ConfigSettings::readSettings(const char* path) {
// to the parsed value
RTRIM_STRING(val);
}
else {
else {
line += "\n";
val += line;
}
+20
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;
@@ -206,6 +219,13 @@ public:
std::string endCode;
std::string preSwitchExtruderCode;
std::string postSwitchExtruderCode;
//Time estimate settings
int acceleration;
int max_acceleration[4];
int max_xy_jerk;
int max_z_jerk;
int max_e_jerk;
ConfigSettings();
bool setSetting(const char* key, const char* value);
+6 -1
Ver Arquivo
@@ -11,6 +11,7 @@ void generateSkirt(SliceDataStorage& storage, int distance, int extrusionWidth,
{
int offsetDistance = distance + extrusionWidth * skirtNr + extrusionWidth / 2;
SupportPolyGenerator supportGenerator(storage.support, initialLayerHeight);
Polygons skirtPolygons(storage.wipeTower.offset(offsetDistance));
for(unsigned int volumeIdx = 0; volumeIdx < storage.volumes.size(); volumeIdx++)
{
@@ -26,10 +27,14 @@ void generateSkirt(SliceDataStorage& storage, int distance, int extrusionWidth,
}
else
skirtPolygons = skirtPolygons.unionPolygons(layer->parts[i].outline.offset(offsetDistance));
supportGenerator.polygons = supportGenerator.polygons.difference(layer->parts[i].outline);
}
}
SupportPolyGenerator supportGenerator(storage.support, initialLayerHeight);
//Contract and expand the suppory polygons so small sections are removed and the final polygon is smoothed a bit.
supportGenerator.polygons = supportGenerator.polygons.offset(-extrusionWidth * 3);
supportGenerator.polygons = supportGenerator.polygons.offset(extrusionWidth * 3);
skirtPolygons = skirtPolygons.unionPolygons(supportGenerator.polygons.offset(offsetDistance));
//Remove small inner skirt holes. Holes have a negative area, remove anything smaller then 100x extrusion "area"
+9 -18
Ver Arquivo
@@ -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
Ver Arquivo
@@ -44,7 +44,7 @@ public:
int z;
Polygons polygonList;
Polygons openPolygonList;
Polygons openPolygons;
void makePolygons(OptimizedVolume* ov, bool keepNoneClosed, bool extensiveStitching);
+17 -7
Ver Arquivo
@@ -6,16 +6,26 @@
#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
const double max_feedrate[TimeEstimateCalculator::NUM_AXIS] = {600, 600, 40, 25};
const double minimumfeedrate = 0.01;
const double acceleration = 3000;
const double max_acceleration[TimeEstimateCalculator::NUM_AXIS] = {9000,9000,100,10000};
const double max_xy_jerk = 20.0;
const double max_z_jerk = 0.4;
const double max_e_jerk = 5.0;
static double max_feedrate[TimeEstimateCalculator::NUM_AXIS] = {600, 600, 40, 25};
static double minimumfeedrate = 0.01;
static double acceleration = 3000;
static double max_acceleration[TimeEstimateCalculator::NUM_AXIS] = {9000,9000,100,10000};
static double max_xy_jerk = 20.0;
static double max_z_jerk = 0.4;
static double max_e_jerk = 5.0;
template<typename T> const T square(const T& a) { return a * a; }
void TimeEstimateCalculator::applyAccelerationSettings(ConfigSettings& config)
{
acceleration = float(config.acceleration) / 1000.0;
for(unsigned int n=0; n<TimeEstimateCalculator::NUM_AXIS; n++)
max_acceleration[n] = float(config.max_acceleration[n]) / 1000.0;
max_xy_jerk = float(config.max_xy_jerk) / 1000.0;
max_z_jerk = float(config.max_z_jerk) / 1000.0;
max_e_jerk = float(config.max_e_jerk) / 1000.0;
}
void TimeEstimateCalculator::setPosition(Position newPos)
{
currentPosition = newPos;
+3
Ver Arquivo
@@ -1,6 +1,7 @@
#ifndef TIME_ESTIMATE_H
#define TIME_ESTIMATE_H
#include "settings.h"
#include <stdint.h>
#include <vector>
@@ -58,6 +59,8 @@ private:
std::vector<Block> blocks;
public:
void applyAccelerationSettings(ConfigSettings& config);
void setPosition(Position newPos);
void plan(Position newPos, double feedRate);
void reset();