void FffPolygonGenerator::slices2polygons(SliceDataStorage& storage, TimeKeeper& time_keeper) { if (commandSocket) commandSocket->beginSendSlicedObject(); // const unsigned int total_layers = storage.meshes.at(0).layers.size(); //layerparts2HTML(storage, "output/output.html"); for(unsigned int layer_number = 0; layer_number < total_layers; layer_number++) { processInsets(storage, layer_number); Progress::messageProgress(Progress::Stage::INSET, layer_number+1, total_layers, commandSocket); } removeEmptyFirstLayers(storage, getSettingInMicrons("layer_height"), total_layers); if (total_layers < 1) { log("Stopping process because there are no layers.\n"); return; } processOozeShield(storage, total_layers); Progress::messageProgressStage(Progress::Stage::SUPPORT, &time_keeper, commandSocket); for(SliceMeshStorage& mesh : storage.meshes) { generateSupportAreas(storage, &mesh, total_layers, commandSocket); for (unsigned int layer_idx = 0; layer_idx < total_layers; layer_idx++) { Polygons& support = storage.support.supportLayers[layer_idx].supportAreas; sendPolygons(SupportType, layer_idx, support, getSettingInMicrons("support_line_width")); } } if (getSettingBoolean("support_roof_enable")) { generateSupportRoofs(storage, commandSocket, getSettingInMicrons("layer_height"), getSettingInMicrons("support_roof_height")); } Progress::messageProgressStage(Progress::Stage::SKIN, &time_keeper, commandSocket); for(unsigned int layer_number = 0; layer_number < total_layers; layer_number++) { if (!getSettingBoolean("magic_spiralize") || static_cast<int>(layer_number) < getSettingAsCount("bottom_layers")) //Only generate up/downskin and infill for the first X layers when spiralize is choosen. { processSkins(storage, layer_number); } Progress::messageProgress(Progress::Stage::SKIN, layer_number+1, total_layers, commandSocket); } for(unsigned int layer_number = total_layers-1; layer_number > 0; layer_number--) { for(SliceMeshStorage& mesh : storage.meshes) combineSparseLayers(layer_number, mesh, mesh.settings->getSettingAsCount("fill_sparse_combine")); } processWipeTower(storage, total_layers); processDraftShield(storage, total_layers); processPlatformAdhesion(storage); }
void FffPolygonGenerator::slices2polygons(SliceDataStorage& storage, TimeKeeper& time_keeper) { size_t total_layers = 0; for (SliceMeshStorage& mesh : storage.meshes) { total_layers = std::max<unsigned int>(total_layers, mesh.layers.size()); } //layerparts2HTML(storage, "output/output.html"); for(unsigned int layer_number = 0; layer_number < total_layers; layer_number++) { processInsets(storage, layer_number); Progress::messageProgress(Progress::Stage::INSET, layer_number+1, total_layers, commandSocket); } removeEmptyFirstLayers(storage, getSettingInMicrons("layer_height"), total_layers); if (total_layers < 1) { log("Stopping process because there are no layers.\n"); return; } Progress::messageProgressStage(Progress::Stage::SUPPORT, &time_keeper, commandSocket); AreaSupport::generateSupportAreas(storage, total_layers, commandSocket); /* if (storage.support.generated) { for (unsigned int layer_idx = 0; layer_idx < total_layers; layer_idx++) { Polygons& support = storage.support.supportLayers[layer_idx].supportAreas; sendPolygons(SupportType, layer_idx, support, getSettingInMicrons("support_line_width")); } } */ Progress::messageProgressStage(Progress::Stage::SKIN, &time_keeper, commandSocket); int mesh_max_bottom_layer_count = 0; if (getSettingBoolean("magic_spiralize")) { for(SliceMeshStorage& mesh : storage.meshes) { mesh_max_bottom_layer_count = std::max(mesh_max_bottom_layer_count, mesh.getSettingAsCount("bottom_layers")); } } for(unsigned int layer_number = 0; layer_number < total_layers; layer_number++) { if (!getSettingBoolean("magic_spiralize") || static_cast<int>(layer_number) < mesh_max_bottom_layer_count) //Only generate up/downskin and infill for the first X layers when spiralize is choosen. { processSkins(storage, layer_number); } Progress::messageProgress(Progress::Stage::SKIN, layer_number+1, total_layers, commandSocket); } for(unsigned int layer_number = total_layers-1; layer_number > 0; layer_number--) { for(SliceMeshStorage& mesh : storage.meshes) combineInfillLayers(layer_number, mesh, mesh.getSettingAsCount("infill_sparse_combine")); } storage.primeTower.computePrimeTowerMax(storage); storage.primeTower.generatePaths(storage, total_layers); processOozeShield(storage, total_layers); processDraftShield(storage, total_layers); processPlatformAdhesion(storage); for(SliceMeshStorage& mesh : storage.meshes) { if (mesh.getSettingBoolean("magic_fuzzy_skin_enabled")) { processFuzzyWalls(mesh); } else { // only send polygon data for (unsigned int layer_nr = 0; layer_nr < total_layers; layer_nr++) { SliceLayer* layer = &mesh.layers[layer_nr]; for(SliceLayerPart& part : layer->parts) { sendPolygons(Inset0Type, layer_nr, (mesh.getSettingAsSurfaceMode("magic_mesh_surface_mode") == ESurfaceMode::SURFACE)? part.outline : part.insets[0], mesh.getSettingInMicrons("wall_line_width_0")); } } } } }