Skip to content

Commit

Permalink
Also possible to exclude bottom from small skin behaviour.
Browse files Browse the repository at this point in the history
Small skin areas replace the normal fill pattern and use walls. Previously in this branch, the possibility was added to not do that to areas exposed to air. It turns out this means in general, not just on the buildplate (also, bottoms can happen away from the buildplate as well of course). As such, take skin bottoms into account of when to exclude areas for consideration when 'Small Top/Bottom On Surface' is off.

part of CURA-10829
  • Loading branch information
rburema committed Aug 15, 2023
1 parent ac86c03 commit f8818e1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions include/sliceDataStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ class SliceLayer
*/
TopSurface top_surface;

/*!
* \brief The parts of the model that are exposed at the bottom(s) of the model.
*
* Note: Filled only when needed.
*/
Polygons bottom_surface;

/*!
* Get the all outlines of all layer parts in this layer.
*
Expand Down
3 changes: 2 additions & 1 deletion src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2764,7 +2764,8 @@ void FffGcodeWriter::processSkinPrintFeature(
constexpr int zag_skip_count = 0;
constexpr coord_t pocket_size = 0;
const bool small_areas_on_surface = mesh.settings.get<bool>("small_skin_on_surface");
const auto& exposed_to_air = mesh.layers[gcode_layer.getLayerNr()].top_surface.areas;
const auto& current_layer = mesh.layers[gcode_layer.getLayerNr()];
const auto& exposed_to_air = current_layer.top_surface.areas.unionPolygons(current_layer.bottom_surface);

Infill infill_comp(
pattern,
Expand Down
10 changes: 10 additions & 0 deletions src/FffPolygonGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,16 @@ void FffPolygonGenerator::processSkinsAndInfill(SliceMeshStorage& mesh, const La
// Generate the top surface to iron over.
mesh.layers[layer_nr].top_surface.setAreasFromMeshAndLayerNumber(mesh, layer_nr);
}

if (layer_nr >= 0 && ! mesh.settings.get<bool>("small_skin_on_surface"))
{
// Generate the bottom surface.
mesh.layers[layer_nr].bottom_surface = mesh.layers[layer_nr].getOutlines();
if (layer_nr > 0)
{
mesh.layers[layer_nr].bottom_surface = mesh.layers[layer_nr].bottom_surface.difference(mesh.layers[layer_nr - 1].getOutlines());
}
}
}

void FffPolygonGenerator::computePrintHeightStatistics(SliceDataStorage& storage)
Expand Down

1 comment on commit f8818e1

@jellespijker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'CGcodeAnalyzer'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.10.

Benchmark suite Current: f8818e1 Previous: 80e0872 Ratio
All Distances 25 Percentile cee.gcode 0.10699999999999932 mm 0.14000000000000057 mm 1.31
Number Of Temperature Commands cee.gcode 17308 # 21016 # 1.21
Extrusion-Axis new_spikes_and_holes_2022.gcode 0.0027 mm 0.00544 mm 2.01

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.