本文整理汇总了C++中GCodeExport::setExtrusion方法的典型用法代码示例。如果您正苦于以下问题:C++ GCodeExport::setExtrusion方法的具体用法?C++ GCodeExport::setExtrusion怎么用?C++ GCodeExport::setExtrusion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GCodeExport
的用法示例。
在下文中一共展示了GCodeExport::setExtrusion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processFile
//.........这里部分代码省略.........
}
logProgress("skin",layerNr+1,totalLayers);
}
log("Generated up/down skin in %5.3fs\n", timeElapsed(t));
generateSkirt(storage, config.skirtDistance, config.extrusionWidth, config.skirtLineCount, config.skirtMinLength);
generateRaft(storage, config.raftMargin);
for(unsigned int volumeIdx=0; volumeIdx<storage.volumes.size(); volumeIdx++)
{
for(unsigned int layerNr=0; layerNr<totalLayers; layerNr++)
{
for(unsigned int partNr=0; partNr<storage.volumes[volumeIdx].layers[layerNr].parts.size(); partNr++)
{
if (layerNr > 0)
storage.volumes[volumeIdx].layers[layerNr].parts[partNr].bridgeAngle = bridgeAngle(&storage.volumes[volumeIdx].layers[layerNr].parts[partNr], &storage.volumes[volumeIdx].layers[layerNr-1]);
else
storage.volumes[volumeIdx].layers[layerNr].parts[partNr].bridgeAngle = -1;
}
}
}
gcode.setRetractionSettings(config.retractionAmount, config.retractionSpeed, config.retractionAmountExtruderSwitch, config.minimalExtrusionBeforeRetraction);
if (firstFile)
{
if (gcode.getFlavor() == GCODE_FLAVOR_ULTIGCODE)
{
gcode.addCode(";FLAVOR:UltiGCode");
gcode.addCode(";TIME:<__TIME__>");
gcode.addCode(";MATERIAL:<FILAMENT>");
}
gcode.addCode(config.startCode);
} else {
gcode.addFanCommand(0);
gcode.resetExtrusionValue();
gcode.addRetraction();
gcode.setZ(maxObjectHeight + 5000);
gcode.addMove(Point(storage.modelMin.x, storage.modelMin.y), config.moveSpeed, 0);
}
gcode.addComment("total_layers=%d",totalLayers);
GCodePathConfig skirtConfig(config.printSpeed, config.extrusionWidth, "SKIRT");
GCodePathConfig inset0Config(config.printSpeed, config.extrusionWidth, "WALL-OUTER");
GCodePathConfig inset1Config(config.printSpeed, config.extrusionWidth, "WALL-INNER");
GCodePathConfig fillConfig(config.infillSpeed, config.extrusionWidth, "FILL");
GCodePathConfig supportConfig(config.printSpeed, config.extrusionWidth, "SUPPORT");
if (config.raftBaseThickness > 0 && config.raftInterfaceThickness > 0)
{
GCodePathConfig raftBaseConfig(config.initialLayerSpeed, config.raftBaseLinewidth, "SUPPORT");
GCodePathConfig raftInterfaceConfig(config.initialLayerSpeed, config.raftInterfaceLinewidth, "SUPPORT");
{
gcode.addComment("LAYER:-2");
gcode.addComment("RAFT");
GCodePlanner gcodeLayer(gcode, config.moveSpeed, config.retractionMinimalDistance);
gcode.setZ(config.raftBaseThickness);
gcode.setExtrusion(config.raftBaseThickness, config.filamentDiameter, config.filamentFlow);
gcodeLayer.addPolygonsByOptimizer(storage.raftOutline, &raftBaseConfig);
Polygons raftLines;
generateLineInfill(storage.raftOutline, raftLines, config.raftBaseLinewidth, config.raftLineSpacing, config.infillOverlap, 0);
gcodeLayer.addPolygonsByOptimizer(raftLines, &raftBaseConfig);
gcodeLayer.writeGCode(false, config.raftBaseThickness);
}
{
示例2: processFile
//.........这里部分代码省略.........
for(unsigned int volumeIdx=0; volumeIdx<storage.volumes.size(); volumeIdx++)
{
generateSkins(layerNr, storage.volumes[volumeIdx], config.extrusionWidth, config.downSkinCount, config.upSkinCount, config.infillOverlap);
generateSparse(layerNr, storage.volumes[volumeIdx], config.extrusionWidth, config.downSkinCount, config.upSkinCount);
}
logProgress("skin",layerNr+1,totalLayers);
}
log("Generated up/down skin in %5.3fs\n", timeElapsed(t));
generateSkirt(storage, config.skirtDistance, config.extrusionWidth, config.skirtLineCount);
generateRaft(storage, config.raftMargin);
log("Generated skirt and raft in %5.3fs\n", timeElapsed(t));
for(unsigned int volumeIdx=0; volumeIdx<storage.volumes.size(); volumeIdx++)
{
for(unsigned int layerNr=0; layerNr<totalLayers; layerNr++)
{
for(unsigned int partNr=0; partNr<storage.volumes[volumeIdx].layers[layerNr].parts.size(); partNr++)
{
if (layerNr > 0)
storage.volumes[volumeIdx].layers[layerNr].parts[partNr].bridgeAngle = bridgeAngle(&storage.volumes[volumeIdx].layers[layerNr].parts[partNr], &storage.volumes[volumeIdx].layers[layerNr-1]);
else
storage.volumes[volumeIdx].layers[layerNr].parts[partNr].bridgeAngle = -1;
}
}
}
log("Stored volumes in %5.3fs\n", timeElapsed(t));
gcode.setRetractionSettings(config.retractionAmount, config.retractionSpeed, config.retractionAmountExtruderSwitch);
if (firstFile)
{
gcode.addCode(config.startCode);
}else{
gcode.resetExtrusionValue();
gcode.addRetraction();
gcode.setZ(maxObjectHeight + 5000);
gcode.addMove(config.objectPosition, config.moveSpeed, 0);
}
gcode.addComment("total_layers=%d",totalLayers);
log("Added general info to gcode in %5.3fs\n", timeElapsed(t));
GCodePathConfig skirtConfig(config.printSpeed, config.extrusionWidth, "SKIRT");
GCodePathConfig inset0Config(config.printSpeed, config.extrusionWidth, "WALL-OUTER");
GCodePathConfig inset1Config(config.printSpeed, config.extrusionWidth, "WALL-INNER");
GCodePathConfig fillConfig(config.infillSpeed, config.extrusionWidth, "FILL");
GCodePathConfig supportConfig(config.printSpeed, config.supportLineWidth, "SUPPORT");
if (config.raftBaseThickness > 0 && config.raftInterfaceThickness > 0)
{
GCodePathConfig raftBaseConfig(config.initialLayerSpeed, config.raftBaseLinewidth, "SUPPORT");
GCodePathConfig raftInterfaceConfig(config.initialLayerSpeed, config.raftInterfaceLinewidth, "SUPPORT");
{
gcode.addComment("LAYER:-2");
gcode.addComment("RAFT");
GCodePlanner gcodeLayer(gcode, config.moveSpeed);
gcode.setZ(config.raftBaseThickness);
gcode.setExtrusion(config.raftBaseThickness, config.filamentDiameter, config.filamentFlow);
gcodeLayer.addPolygonsByOptimizer(storage.raftOutline, &raftBaseConfig);
Polygons raftLines;
generateLineInfill(storage.raftOutline, raftLines, config.raftBaseLinewidth, config.raftLineSpacing, config.infillOverlap, 0);
gcodeLayer.addPolygonsByOptimizer(raftLines, &raftBaseConfig);
gcodeLayer.writeGCode(false);
}