1+ // Copyright (c) 2024 UltiMaker
2+ // CuraEngine is released under the terms of the AGPLv3 or higher
3+
4+ #pragma once
5+
6+ #include < utils/Coord_t.h>
7+
8+ #include " feature_generation/MeshFeatureGenerator.h"
9+
10+ namespace cura
11+ {
12+
13+ class Shape ;
14+
15+ class MeshInfillGenerator : public MeshFeatureGenerator
16+ {
17+ public:
18+ explicit MeshInfillGenerator (const std::shared_ptr<SliceMeshStorage>& mesh);
19+
20+ bool isActive () const override ;
21+
22+ protected:
23+ void generateFeatures (const SliceDataStorage& storage, const LayerPlanPtr& layer_plan, const std::vector<ExtruderPlanPtr>& extruder_plans, const SliceLayerPart& part)
24+ const override ;
25+
26+ private:
27+ /* !
28+ * \brief Add thicker (multiple layers) sparse infill for a given part in a
29+ * layer plan.
30+ *
31+ * \param gcodeLayer The initial planning of the gcode of the layer.
32+ * \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
33+ * \param extruder_nr The extruder for which to print all features of the
34+ * mesh which should be printed with this extruder.
35+ * \param mesh_config The line config with which to print a print feature.
36+ * \param part The part for which to create gcode.
37+ * \return Whether this function added anything to the layer plan.
38+ */
39+ void processMultiLayerInfill (const LayerPlanPtr& layer_plan, const ExtruderPlanPtr& extruder_plan, const SliceLayerPart& part) const ;
40+
41+ /* !
42+ * \brief Add normal sparse infill for a given part in a layer.
43+ * \param gcodeLayer The initial planning of the gcode of the layer.
44+ * \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
45+ * \param extruder_nr The extruder for which to print all features of the
46+ * mesh which should be printed with this extruder
47+ * \param mesh_config The line config with which to print a print feature.
48+ * \param part The part for which to create gcode.
49+ * \return Whether this function added anything to the layer plan.
50+ */
51+ void processSingleLayerInfill (const SliceDataStorage& storage, const LayerPlanPtr& layer_plan, const ExtruderPlanPtr& extruder_plan, const SliceLayerPart& part) const ;
52+
53+ bool
54+ partitionInfillBySkinAbove (Shape& infill_below_skin, Shape& infill_not_below_skin, const LayerPlanPtr& layer_plan, const SliceLayerPart& part, coord_t infill_line_width) const ;
55+
56+ private:
57+ const coord_t infill_line_distance_;
58+ };
59+
60+ } // namespace cura
0 commit comments