Skip to content

Commit eb0d2d7

Browse files
authored
CURA-12335 Handle flooring settings on the same basis as roofing (#2202)
2 parents f387023 + 6984670 commit eb0d2d7

15 files changed

+336
-104
lines changed

include/FffGcodeWriter.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ class FffGcodeWriter : public NoCopy
144144
TimeKeeper::RegisteredTimes stages_times;
145145
};
146146

147+
struct RoofingFlooringSettingsNames
148+
{
149+
std::string extruder_nr;
150+
std::string pattern;
151+
std::string monotonic;
152+
};
153+
154+
static const RoofingFlooringSettingsNames roofing_settings_names;
155+
static const RoofingFlooringSettingsNames flooring_settings_names;
156+
147157
/*!
148158
* \brief Set the FffGcodeWriter::fan_speed_layer_time_settings by
149159
* retrieving all settings from the global/per-meshgroup settings.
@@ -501,7 +511,7 @@ class FffGcodeWriter : public NoCopy
501511
const SkinPart& skin_part) const;
502512

503513
/*!
504-
* Add the roofing which is the area inside the innermost skin inset which has air 'directly' above
514+
* Add the roofing/flooring which is the area inside the innermost skin inset which has air 'directly' above or below
505515
*
506516
* \param[in] storage where the slice data is stored.
507517
* \param gcode_layer The initial planning of the gcode of the layer.
@@ -511,13 +521,15 @@ class FffGcodeWriter : public NoCopy
511521
* \param skin_part The skin part for which to create gcode
512522
* \param[out] added_something Whether this function added anything to the layer plan
513523
*/
514-
void processRoofing(
524+
void processRoofingFlooring(
515525
const SliceDataStorage& storage,
516526
LayerPlan& gcode_layer,
517527
const SliceMeshStorage& mesh,
518528
const size_t extruder_nr,
519-
const MeshPathConfigs& mesh_config,
520-
const SkinPart& skin_part,
529+
const RoofingFlooringSettingsNames& settings_names,
530+
const Shape& fill,
531+
const GCodePathConfig& config,
532+
const std::vector<AngleDegrees>& angles,
521533
bool& added_something) const;
522534

523535
/*!

include/InsetOrderOptimizer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class InsetOrderOptimizer
4747
const GCodePathConfig& inset_X_default_config,
4848
const GCodePathConfig& inset_0_roofing_config,
4949
const GCodePathConfig& inset_X_roofing_config,
50+
const GCodePathConfig& inset_0_flooring_config,
51+
const GCodePathConfig& inset_X_flooring_config,
5052
const GCodePathConfig& inset_0_bridge_config,
5153
const GCodePathConfig& inset_X_bridge_config,
5254
const bool retract_before_outer_wall,
@@ -101,6 +103,8 @@ class InsetOrderOptimizer
101103
const GCodePathConfig& inset_X_default_config_;
102104
const GCodePathConfig& inset_0_roofing_config_;
103105
const GCodePathConfig& inset_X_roofing_config_;
106+
const GCodePathConfig& inset_0_flooring_config_;
107+
const GCodePathConfig& inset_X_flooring_config_;
104108
const GCodePathConfig& inset_0_bridge_config_;
105109
const GCodePathConfig& inset_X_bridge_config_;
106110
const bool retract_before_outer_wall_;

include/LayerPlan.h

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,14 @@ class LayerPlan : public NoCopy
124124
std::vector<OverhangMask> overhang_masks_; //!< The regions of a layer part where the walls overhang, calculated for multiple overhang angles. The latter is the most
125125
//!< overhanging. For a visual explanation of the result, see doc/gradual_overhang_speed.svg
126126
Shape seam_overhang_mask_; //!< The regions of a layer part where the walls overhang, specifically as defined for the seam
127+
128+
Shape roofing_mask_; //!< The regions of a layer part where the walls are exposed to the air above
129+
Shape flooring_mask_; //!< The regions of a layer part where the walls are exposed to the air below
130+
127131
bool currently_overhanging_{ false }; //!< Indicates whether the last extrusion move was overhanging
128132
coord_t current_overhang_length_{ 0 }; //!< When doing consecutive overhanging moves, this is the current accumulated overhanging length
129133
coord_t max_overhang_length_{ 0 }; //!< From all consecutive overhanging moves in the layer, this is the longest one
130134

131-
Shape roofing_mask_; //!< The regions of a layer part where the walls are exposed to the air
132-
133135
bool min_layer_time_used = false; //!< Wether or not the minimum layer time (cool_min_layer_time) was actually used in this layerplan.
134136

135137
const std::vector<FanSpeedLayerTimeSettings> fan_speed_layer_time_settings_per_extruder_;
@@ -331,6 +333,13 @@ class LayerPlan : public NoCopy
331333
*/
332334
void setRoofingMask(const Shape& polys);
333335

336+
/*!
337+
* Set flooring_mask.
338+
*
339+
* \param shape The areas of the part currently being processed that will require flooring.
340+
*/
341+
void setFlooringMask(const Shape& shape);
342+
334343
/*!
335344
* Travel to a certain point, with all of the procedures necessary to do so.
336345
*
@@ -495,6 +504,8 @@ class LayerPlan : public NoCopy
495504
* that are not spanning a bridge or are exposed to air.
496505
* \param roofing_config The config with which to print the wall lines
497506
* that are exposed to air.
507+
* \param flooring_config The config with which to print the wall lines
508+
* that are exposed to air below.
498509
* \param bridge_config The config with which to print the wall lines that
499510
* are spanning a bridge.
500511
* \param flow The ratio with which to multiply the extrusion amount.
@@ -513,6 +524,7 @@ class LayerPlan : public NoCopy
513524
const Settings& settings,
514525
const GCodePathConfig& default_config,
515526
const GCodePathConfig& roofing_config,
527+
const GCodePathConfig& flooring_config,
516528
const GCodePathConfig& bridge_config,
517529
double flow,
518530
const Ratio width_factor,
@@ -530,6 +542,8 @@ class LayerPlan : public NoCopy
530542
* that are not spanning a bridge or are exposed to air.
531543
* \param roofing_config The config with which to print the wall lines
532544
* that are exposed to air.
545+
* \param flooring_config The config with which to print the wall lines
546+
* that are exposed to air below.
533547
* \param wall_0_wipe_dist The distance to travel along the wall after it
534548
* has been laid down, in order to wipe the start and end of the wall
535549
* \param flow_ratio The ratio with which to multiply the extrusion amount.
@@ -542,6 +556,7 @@ class LayerPlan : public NoCopy
542556
const Settings& settings,
543557
const GCodePathConfig& default_config,
544558
const GCodePathConfig& roofing_config,
559+
const GCodePathConfig& flooring_config,
545560
const GCodePathConfig& bridge_config,
546561
coord_t wall_0_wipe_dist,
547562
double flow_ratio,
@@ -556,6 +571,8 @@ class LayerPlan : public NoCopy
556571
* that are not spanning a bridge or are exposed to air.
557572
* \param roofing_config The config with which to print the wall lines
558573
* that are exposed to air.
574+
* \param flooring_config The config with which to print the wall lines
575+
* that are exposed to air below.
559576
* \param bridge_config The config with which to print the wall lines that
560577
* are spanning a bridge
561578
* \param wall_0_wipe_dist The distance to travel along the wall after it
@@ -576,6 +593,7 @@ class LayerPlan : public NoCopy
576593
const Settings& settings,
577594
const GCodePathConfig& default_config,
578595
const GCodePathConfig& roofing_config,
596+
const GCodePathConfig& flooring_config,
579597
const GCodePathConfig& bridge_config,
580598
coord_t wall_0_wipe_dist,
581599
double flow_ratio,
@@ -601,7 +619,9 @@ class LayerPlan : public NoCopy
601619
* \param default_config The config with which to print the wall lines
602620
* that are not spanning a bridge or are exposed to air.
603621
* \param roofing_config The config with which to print the wall lines
604-
* that are exposed to air.
622+
* that are exposed to air above.
623+
* \param flooring_config The config with which to print the wall lines
624+
* that are exposed to air below.
605625
* \param bridge_config The config with which to print the wall lines that are spanning a bridge
606626
* \param z_seam_config Optional configuration for z-seam
607627
* \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
@@ -614,6 +634,7 @@ class LayerPlan : public NoCopy
614634
const Settings& settings,
615635
const GCodePathConfig& default_config,
616636
const GCodePathConfig& roofing_config,
637+
const GCodePathConfig& flooring_config,
617638
const GCodePathConfig& bridge_config,
618639
const ZSeamConfig& z_seam_config = ZSeamConfig(),
619640
coord_t wall_0_wipe_dist = 0,

include/settings/MeshPathConfigs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ struct MeshPathConfigs
1717
GCodePathConfig insetX_config{};
1818
GCodePathConfig inset0_roofing_config{};
1919
GCodePathConfig insetX_roofing_config{};
20+
GCodePathConfig inset0_flooring_config{};
21+
GCodePathConfig insetX_flooring_config{};
2022
GCodePathConfig bridge_inset0_config{};
2123
GCodePathConfig bridge_insetX_config{};
2224
GCodePathConfig skin_config{};
2325
GCodePathConfig bridge_skin_config{}; // used for first bridge layer
2426
GCodePathConfig bridge_skin_config2{}; // used for second bridge layer
2527
GCodePathConfig bridge_skin_config3{}; // used for third bridge layer
2628
GCodePathConfig roofing_config{};
29+
GCodePathConfig flooring_config{};
2730
std::vector<GCodePathConfig> infill_config{};
2831
GCodePathConfig ironing_config{};
2932

include/skin.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#ifndef SKIN_H
55
#define SKIN_H
66

7+
#include <optional>
8+
79
#include "settings/types/LayerIndex.h"
810
#include "utils/Coord_t.h"
911

@@ -127,12 +129,12 @@ class SkinInfillAreaComputation
127129
void generateInfill(SliceLayerPart& part);
128130

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

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

158161
protected:
159162
LayerIndex layer_nr_; //!< The index of the layer for which to generate the skins and infill.

include/sliceDataStorage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class SkinPart
4545
//!< roofing and non-roofing.
4646
Shape skin_fill; //!< The part of the skin which is not roofing.
4747
Shape roofing_fill; //!< The inner infill which has air directly above
48+
Shape flooring_fill; //!< The inner infill which has air directly below
4849
};
4950

5051
/*!
@@ -309,6 +310,7 @@ class SliceMeshStorage
309310

310311
std::vector<AngleDegrees> infill_angles; //!< a list of angle values which is cycled through to determine the infill angle of each layer
311312
std::vector<AngleDegrees> roofing_angles; //!< a list of angle values which is cycled through to determine the roofing angle of each layer
313+
std::vector<AngleDegrees> flooring_angles; //!< a list of angle values which is cycled through to determine the flooring angle of each layer
312314
std::vector<AngleDegrees> skin_angles; //!< a list of angle values which is cycled through to determine the skin angle of each layer
313315
std::vector<Shape> overhang_areas; //!< For each layer the areas that are classified as overhang on this mesh.
314316
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

0 commit comments

Comments
 (0)