Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6ef4e96
Split up parts into top/bottom/side if the wall-count is different.
rburema Apr 30, 2025
694cb2b
Small refactor: DRY up getting top/bottom layer outline diffs.
rburema Apr 30, 2025
fd1c224
Use the previously re-split parts to get the correct wall-count.
rburema Apr 30, 2025
10d773d
Apply clang-format
rburema Apr 30, 2025
b21f96c
Make the previously 'bottom' wall line count only apply to initial.
rburema May 6, 2025
d06800f
Clean up function that was only used class-internally.
rburema May 6, 2025
0229ab2
Fix top/initial wall count issues w.r.t. sloped walls.
rburema May 6, 2025
39faff4
Apply clang-format
rburema May 6, 2025
65d65e4
Better variable/enum names (code review comments).
rburema May 7, 2025
0d0c936
Apply code-review suggestions.
rburema May 7, 2025
4dd0c87
Apply clang-format
rburema May 7, 2025
8d5e5aa
Merge branch 'main' into CURA-12446_top_bottom_wall_count_new
HellAholic May 9, 2025
86e8778
Apply roofing area extension
wawanbreton Jun 5, 2025
aed8b18
Merge branch 'main' into CURA-12446_top_bottom_wall_count_new
HellAholic Jun 19, 2025
017c433
Merge remote-tracking branch 'origin/5.11' into CURA-12446_top_bottom…
wawanbreton Oct 9, 2025
08633e2
Revert "Apply roofing area extension"
wawanbreton Oct 10, 2025
5b3d989
Apply roofing extension differently
wawanbreton Oct 10, 2025
d93c09c
Apply roofing extension only when enabled
wawanbreton Oct 10, 2025
a461db3
Apply roofing extension in a safer way
wawanbreton Oct 10, 2025
8cefcfc
Really disable small skin on surface when it is disabled
wawanbreton Oct 10, 2025
97d783f
Set proper method definition
wawanbreton Oct 10, 2025
458cd00
Avoid top surfaces to grow from the outside of the model
wawanbreton Oct 13, 2025
c04a924
Optimize function by moving fixed calculations out of the loop
wawanbreton Oct 13, 2025
2c66ce4
Add documentation image
wawanbreton Oct 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 211 additions & 0 deletions doc/skin_parts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions include/FffGcodeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ class FffGcodeWriter : public NoCopy
* \param skin_overlap The amount by which to expand the \p area
* \param skin density Sets the density of the the skin lines by adjusting the distance between them (normal skin is 1.0)
* \param monotonic Whether to order lines monotonically (``true``) or to
* \param is_roofing_flooring Indicates whether we are currently processing a top/bottom layer, or a skin layer
* minimise travel moves (``false``).
* \param[out] added_something Whether this function added anything to the layer plan
* \param fan_speed fan speed override for this skin area
Expand All @@ -591,6 +592,7 @@ class FffGcodeWriter : public NoCopy
const coord_t skin_overlap,
const Ratio skin_density,
const bool monotonic,
const bool is_roofing_flooring,
bool& added_something,
double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT) const;

Expand Down
20 changes: 4 additions & 16 deletions include/layerPart.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
// Copyright (c) 2025 UltiMaker
// CuraEngine is released under the terms of the AGPLv3 or higher.

#ifndef LAYERPART_H
#define LAYERPART_H
Expand All @@ -19,28 +19,16 @@ It's also the first step that stores the result in the "data storage" so all oth
namespace cura
{

class Settings;
class SliceLayer;
class Slicer;
class SlicerLayer;
class SliceMeshStorage;

/*!
* \brief Split a layer into parts.
* \param settings The settings to get the settings from (whether to union or
* not).
* \param storageLayer Where to store the parts.
* \param layer The layer to split.
*/
void createLayerWithParts(const Settings& settings, SliceLayer& storageLayer, SlicerLayer* layer);

/*!
* \brief Split all layers into parts.
* \param mesh The mesh of which to split the layers into parts.
* \param slicer The slicer to get the layers from.
*/
void createLayerParts(SliceMeshStorage& mesh, Slicer* slicer);

}//namespace cura
} // namespace cura

#endif//LAYERPART_H
#endif // LAYERPART_H
13 changes: 13 additions & 0 deletions include/sliceDataStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ class SkinPart
class SliceLayerPart
{
public:
enum class WallExposedType
{
LAYER_0,
ROOFING,
SIDE_ONLY,
};
WallExposedType wall_exposed = WallExposedType::SIDE_ONLY;

AABB boundaryBox; //!< The boundaryBox is an axis-aligned boundary box which is used to quickly check for possible
//!< collision between different parts on different layers. It's an optimization used during
//!< skin calculations.
Expand Down Expand Up @@ -461,6 +469,11 @@ class SliceDataStorage : public NoCopy
*/
Shape getMachineBorder(int extruder_nr = -1) const;

/*!
* @return The raw outer build plate shape without any disallowed area
*/
Shape getRawMachineBorder() const;

void initializePrimeTower();

private:
Expand Down
21 changes: 19 additions & 2 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3473,7 +3473,21 @@ void FffGcodeWriter::processRoofingFlooring(
const Ratio skin_density = 1.0;
const coord_t skin_overlap = 0; // skinfill already expanded over the roofing areas; don't overlap with perimeters
const bool monotonic = mesh.settings.get<bool>(settings_names.monotonic);
processSkinPrintFeature(storage, gcode_layer, mesh, extruder_nr, fill, config, pattern, roofing_angle, skin_overlap, skin_density, monotonic, added_something);
constexpr bool is_roofing_flooring = true;
processSkinPrintFeature(
storage,
gcode_layer,
mesh,
extruder_nr,
fill,
config,
pattern,
roofing_angle,
skin_overlap,
skin_density,
monotonic,
is_roofing_flooring,
added_something);
}

void FffGcodeWriter::processTopBottom(
Expand Down Expand Up @@ -3641,6 +3655,7 @@ void FffGcodeWriter::processTopBottom(
}
}
const bool monotonic = mesh.settings.get<bool>("skin_monotonic");
constexpr bool is_roofing_flooring = false;
processSkinPrintFeature(
storage,
gcode_layer,
Expand All @@ -3653,6 +3668,7 @@ void FffGcodeWriter::processTopBottom(
skin_overlap,
skin_density,
monotonic,
is_roofing_flooring,
added_something,
fan_speed);
}
Expand All @@ -3669,6 +3685,7 @@ void FffGcodeWriter::processSkinPrintFeature(
const coord_t skin_overlap,
const Ratio skin_density,
const bool monotonic,
const bool is_roofing_flooring,
bool& added_something,
double fan_speed) const
{
Expand All @@ -3679,7 +3696,6 @@ void FffGcodeWriter::processSkinPrintFeature(
constexpr int infill_multiplier = 1;
constexpr int extra_infill_shift = 0;
const size_t wall_line_count = mesh.settings.get<size_t>("skin_outline_count");
const coord_t small_area_width = mesh.settings.get<coord_t>("small_skin_width");
const bool zig_zaggify_infill = pattern == EFillMethod::ZIG_ZAG;
const bool connect_polygons = mesh.settings.get<bool>("connect_skin_polygons");
coord_t max_resolution = mesh.settings.get<coord_t>("meshfix_maximum_resolution");
Expand All @@ -3693,6 +3709,7 @@ 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 coord_t small_area_width = (small_areas_on_surface || ! is_roofing_flooring) ? mesh.settings.get<coord_t>("small_skin_width") : 0;
const auto& current_layer = mesh.layers[gcode_layer.getLayerNr()];
const auto& exposed_to_air = current_layer.top_surface.areas.unionPolygons(current_layer.bottom_surface);

Expand Down
5 changes: 4 additions & 1 deletion src/WallsComputation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ WallsComputation::WallsComputation(const Settings& settings, const LayerIndex la
*/
void WallsComputation::generateWalls(SliceLayerPart* part, SectionType section_type)
{
size_t wall_count = settings_.get<size_t>("wall_line_count");
const std::map<SliceLayerPart::WallExposedType, std::string> wall_count_setting_names({ { SliceLayerPart::WallExposedType::LAYER_0, "wall_line_count_layer_0" },
{ SliceLayerPart::WallExposedType::ROOFING, "wall_line_count_roofing" },
{ SliceLayerPart::WallExposedType::SIDE_ONLY, "wall_line_count" } });
size_t wall_count = settings_.get<size_t>(wall_count_setting_names.at(part->wall_exposed));
if (wall_count == 0) // Early out if no walls are to be generated
{
part->print_outline = part->outline;
Expand Down
Loading
Loading