Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURA-12335 Handle flooring settings on the same basis as roofing #2202

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
20 changes: 16 additions & 4 deletions include/FffGcodeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ class FffGcodeWriter : public NoCopy
TimeKeeper::RegisteredTimes stages_times;
};

struct RoofingFlooringSettingsNames
{
std::string extruder_nr;
std::string pattern;
std::string monotonic;
};

static const RoofingFlooringSettingsNames roofing_settings_names;
static const RoofingFlooringSettingsNames flooring_settings_names;

/*!
* \brief Set the FffGcodeWriter::fan_speed_layer_time_settings by
* retrieving all settings from the global/per-meshgroup settings.
Expand Down Expand Up @@ -501,7 +511,7 @@ class FffGcodeWriter : public NoCopy
const SkinPart& skin_part) const;

/*!
* Add the roofing which is the area inside the innermost skin inset which has air 'directly' above
* Add the roofing/flooring which is the area inside the innermost skin inset which has air 'directly' above or below
*
* \param[in] storage where the slice data is stored.
* \param gcode_layer The initial planning of the gcode of the layer.
Expand All @@ -511,13 +521,15 @@ class FffGcodeWriter : public NoCopy
* \param skin_part The skin part for which to create gcode
* \param[out] added_something Whether this function added anything to the layer plan
*/
void processRoofing(
void processRoofingFlooring(
const SliceDataStorage& storage,
LayerPlan& gcode_layer,
const SliceMeshStorage& mesh,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SkinPart& skin_part,
const RoofingFlooringSettingsNames& settings_names,
const Shape& fill,
const GCodePathConfig& config,
const std::vector<AngleDegrees>& angles,
bool& added_something) const;

/*!
Expand Down
4 changes: 4 additions & 0 deletions include/InsetOrderOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class InsetOrderOptimizer
const GCodePathConfig& inset_X_default_config,
const GCodePathConfig& inset_0_roofing_config,
const GCodePathConfig& inset_X_roofing_config,
const GCodePathConfig& inset_0_flooring_config,
const GCodePathConfig& inset_X_flooring_config,
const GCodePathConfig& inset_0_bridge_config,
const GCodePathConfig& inset_X_bridge_config,
const bool retract_before_outer_wall,
Expand Down Expand Up @@ -101,6 +103,8 @@ class InsetOrderOptimizer
const GCodePathConfig& inset_X_default_config_;
const GCodePathConfig& inset_0_roofing_config_;
const GCodePathConfig& inset_X_roofing_config_;
const GCodePathConfig& inset_0_flooring_config_;
const GCodePathConfig& inset_X_flooring_config_;
const GCodePathConfig& inset_0_bridge_config_;
const GCodePathConfig& inset_X_bridge_config_;
const bool retract_before_outer_wall_;
Expand Down
24 changes: 22 additions & 2 deletions include/LayerPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ class LayerPlan : public NoCopy
Shape bridge_wall_mask_; //!< The regions of a layer part that are not supported, used for bridging
Shape overhang_mask_; //!< The regions of a layer part where the walls overhang
Shape seam_overhang_mask_; //!< The regions of a layer part where the walls overhang, specifically as defined for the seam
Shape roofing_mask_; //!< The regions of a layer part where the walls are exposed to the air
Shape roofing_mask_; //!< The regions of a layer part where the walls are exposed to the air above
Shape flooring_mask_; //!< The regions of a layer part where the walls are exposed to the air below

bool min_layer_time_used = false; //!< Wether or not the minimum layer time (cool_min_layer_time) was actually used in this layerplan.

Expand Down Expand Up @@ -320,6 +321,13 @@ class LayerPlan : public NoCopy
*/
void setRoofingMask(const Shape& polys);

/*!
* Set flooring_mask.
*
* \param shape The areas of the part currently being processed that will require flooring.
*/
void setFlooringMask(const Shape& shape);

/*!
* Travel to a certain point, with all of the procedures necessary to do so.
*
Expand Down Expand Up @@ -473,6 +481,8 @@ class LayerPlan : public NoCopy
* that are not spanning a bridge or are exposed to air.
* \param roofing_config The config with which to print the wall lines
* that are exposed to air.
* \param flooring_config The config with which to print the wall lines
* that are exposed to air below.
* \param bridge_config The config with which to print the wall lines that
* are spanning a bridge.
* \param flow The ratio with which to multiply the extrusion amount.
Expand All @@ -491,6 +501,7 @@ class LayerPlan : public NoCopy
const Settings& settings,
const GCodePathConfig& default_config,
const GCodePathConfig& roofing_config,
const GCodePathConfig& flooring_config,
const GCodePathConfig& bridge_config,
double flow,
const Ratio width_factor,
Expand All @@ -508,6 +519,8 @@ class LayerPlan : public NoCopy
* that are not spanning a bridge or are exposed to air.
* \param roofing_config The config with which to print the wall lines
* that are exposed to air.
* \param flooring_config The config with which to print the wall lines
* that are exposed to air below.
* \param wall_0_wipe_dist The distance to travel along the wall after it
* has been laid down, in order to wipe the start and end of the wall
* \param flow_ratio The ratio with which to multiply the extrusion amount.
Expand All @@ -520,6 +533,7 @@ class LayerPlan : public NoCopy
const Settings& settings,
const GCodePathConfig& default_config,
const GCodePathConfig& roofing_config,
const GCodePathConfig& flooring_config,
const GCodePathConfig& bridge_config,
coord_t wall_0_wipe_dist,
double flow_ratio,
Expand All @@ -534,6 +548,8 @@ class LayerPlan : public NoCopy
* that are not spanning a bridge or are exposed to air.
* \param roofing_config The config with which to print the wall lines
* that are exposed to air.
* \param flooring_config The config with which to print the wall lines
* that are exposed to air below.
* \param bridge_config The config with which to print the wall lines that
* are spanning a bridge
* \param wall_0_wipe_dist The distance to travel along the wall after it
Expand All @@ -554,6 +570,7 @@ class LayerPlan : public NoCopy
const Settings& settings,
const GCodePathConfig& default_config,
const GCodePathConfig& roofing_config,
const GCodePathConfig& flooring_config,
const GCodePathConfig& bridge_config,
coord_t wall_0_wipe_dist,
double flow_ratio,
Expand All @@ -579,7 +596,9 @@ class LayerPlan : public NoCopy
* \param default_config The config with which to print the wall lines
* that are not spanning a bridge or are exposed to air.
* \param roofing_config The config with which to print the wall lines
* that are exposed to air.
* that are exposed to air above.
* \param flooring_config The config with which to print the wall lines
* that are exposed to air below.
* \param bridge_config The config with which to print the wall lines that are spanning a bridge
* \param z_seam_config Optional configuration for z-seam
* \param wall_0_wipe_dist The distance to travel along each wall after it has been laid down, in order to wipe the start and end of the wall together
Expand All @@ -592,6 +611,7 @@ class LayerPlan : public NoCopy
const Settings& settings,
const GCodePathConfig& default_config,
const GCodePathConfig& roofing_config,
const GCodePathConfig& flooring_config,
const GCodePathConfig& bridge_config,
const ZSeamConfig& z_seam_config = ZSeamConfig(),
coord_t wall_0_wipe_dist = 0,
Expand Down
3 changes: 3 additions & 0 deletions include/settings/MeshPathConfigs.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ struct MeshPathConfigs
GCodePathConfig insetX_config{};
GCodePathConfig inset0_roofing_config{};
GCodePathConfig insetX_roofing_config{};
GCodePathConfig inset0_flooring_config{};
GCodePathConfig insetX_flooring_config{};
GCodePathConfig bridge_inset0_config{};
GCodePathConfig bridge_insetX_config{};
GCodePathConfig skin_config{};
GCodePathConfig bridge_skin_config{}; // used for first bridge layer
GCodePathConfig bridge_skin_config2{}; // used for second bridge layer
GCodePathConfig bridge_skin_config3{}; // used for third bridge layer
GCodePathConfig roofing_config{};
GCodePathConfig flooring_config{};
std::vector<GCodePathConfig> infill_config{};
GCodePathConfig ironing_config{};

Expand Down
13 changes: 8 additions & 5 deletions include/skin.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#ifndef SKIN_H
#define SKIN_H

#include <optional>

#include "settings/types/LayerIndex.h"
#include "utils/Coord_t.h"

Expand Down Expand Up @@ -127,12 +129,12 @@ class SkinInfillAreaComputation
void generateInfill(SliceLayerPart& part);

/*!
* Remove the areas which are 'directly' under air from the \ref SkinPart::inner_infill and
* save them in the \ref SkinPart::roofing_fill of the \p part.
* Remove the areas which are 'directly' under/over air from the \ref SkinPart::inner_infill and
* save them in the \ref SkinPart::roofing_fill and \ref SkinPart::flooring_fill of the \p part.
*
* \param[in,out] part Where to get the SkinParts to get the outline info from and to store the roofing areas
* \param[in,out] part Where to get the SkinParts to get the outline info from and to store the roofing/flooring areas
*/
void generateRoofingFillAndSkinFill(SliceLayerPart& part);
void generateSkinRoofingFlooringFill(SliceLayerPart& part);

/*!
* Generate the top and bottom-most surfaces of the given \p part, i.e. the surfaces that have nothing above or below
Expand All @@ -152,8 +154,9 @@ class SkinInfillAreaComputation
*
* \param part Where to get the SkinParts to get the outline info from
* \param flooring_layer_count The number of layers below the layer which we are looking into
* \return The area that contains mesh parts below, or nullopt if the build plate is below, which actually means everything is considered supported
*/
Shape generateFilledAreaBelow(SliceLayerPart& part, size_t flooring_layer_count);
std::optional<Shape> generateFilledAreaBelow(SliceLayerPart& part, size_t flooring_layer_count);

protected:
LayerIndex layer_nr_; //!< The index of the layer for which to generate the skins and infill.
Expand Down
2 changes: 2 additions & 0 deletions include/sliceDataStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class SkinPart
//!< roofing and non-roofing.
Shape skin_fill; //!< The part of the skin which is not roofing.
Shape roofing_fill; //!< The inner infill which has air directly above
Shape flooring_fill; //!< The inner infill which has air directly below
};

/*!
Expand Down Expand Up @@ -309,6 +310,7 @@ class SliceMeshStorage

std::vector<AngleDegrees> infill_angles; //!< a list of angle values which is cycled through to determine the infill angle of each layer
std::vector<AngleDegrees> roofing_angles; //!< a list of angle values which is cycled through to determine the roofing angle of each layer
std::vector<AngleDegrees> flooring_angles; //!< a list of angle values which is cycled through to determine the flooring angle of each layer
std::vector<AngleDegrees> skin_angles; //!< a list of angle values which is cycled through to determine the skin angle of each layer
std::vector<Shape> overhang_areas; //!< For each layer the areas that are classified as overhang on this mesh.
std::vector<Shape> full_overhang_areas; //!< For each layer the full overhang without the tangent of the overhang angle removed, such that the overhang area adjoins the
Expand Down
Loading
Loading