Skip to content

Commit 7fa83d6

Browse files
committed
Set lightning generator as a member of infill generator
CURA-12250
1 parent 1832ec3 commit 7fa83d6

File tree

10 files changed

+55
-724
lines changed

10 files changed

+55
-724
lines changed

include/FffGcodeWriter.h

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -375,58 +375,6 @@ class FffGcodeWriter : public NoCopy
375375
const SliceLayerPart& part,
376376
LayerPlan& gcode_layer) const;
377377

378-
/*!
379-
* \brief Add infill for a given part in a layer plan.
380-
*
381-
* \param gcodeLayer The initial planning of the gcode of the layer.
382-
* \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
383-
* \param extruder_nr The extruder for which to print all features of the
384-
* mesh which should be printed with this extruder.
385-
* \param mesh_config the line config with which to print a print feature.
386-
* \param part The part for which to create gcode.
387-
* \return Whether this function added anything to the layer plan.
388-
*/
389-
bool processInfill(
390-
const SliceDataStorage& storage,
391-
LayerPlan& gcodeLayer,
392-
const SliceMeshStorage& mesh,
393-
const size_t extruder_nr,
394-
const MeshPathConfigs& mesh_config,
395-
const SliceLayerPart& part) const;
396-
397-
/*!
398-
* \brief Add thicker (multiple layers) sparse infill for a given part in a
399-
* layer plan.
400-
*
401-
* \param gcodeLayer The initial planning of the gcode of the layer.
402-
* \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
403-
* \param extruder_nr The extruder for which to print all features of the
404-
* mesh which should be printed with this extruder.
405-
* \param mesh_config The line config with which to print a print feature.
406-
* \param part The part for which to create gcode.
407-
* \return Whether this function added anything to the layer plan.
408-
*/
409-
bool processMultiLayerInfill(LayerPlan& gcodeLayer, const SliceMeshStorage& mesh, const size_t extruder_nr, const MeshPathConfigs& mesh_config, const SliceLayerPart& part)
410-
const;
411-
412-
/*!
413-
* \brief Add normal sparse infill for a given part in a layer.
414-
* \param gcodeLayer The initial planning of the gcode of the layer.
415-
* \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
416-
* \param extruder_nr The extruder for which to print all features of the
417-
* mesh which should be printed with this extruder
418-
* \param mesh_config The line config with which to print a print feature.
419-
* \param part The part for which to create gcode.
420-
* \return Whether this function added anything to the layer plan.
421-
*/
422-
bool processSingleLayerInfill(
423-
const SliceDataStorage& storage,
424-
LayerPlan& gcodeLayer,
425-
const SliceMeshStorage& mesh,
426-
const size_t extruder_nr,
427-
const MeshPathConfigs& mesh_config,
428-
const SliceLayerPart& part) const;
429-
430378
/*!
431379
* Generate the insets for the walls of a given layer part.
432380
* \param[in] storage where the slice data is stored.

include/feature_generation/FeatureGenerator.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class FeatureGenerator
2121

2222
virtual bool isActive() const = 0;
2323

24+
virtual void preCalculateData() {};
25+
2426
virtual void generateFeatures(const SliceDataStorage& storage, const LayerPlanPtr& layer_plan, const std::vector<ExtruderPlanPtr>& extruder_plans) const = 0;
2527
};
2628

include/feature_generation/MeshInfillGenerator.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010
namespace cura
1111
{
1212

13+
class LightningGenerator;
1314
class Shape;
1415

1516
class MeshInfillGenerator : public MeshFeatureGenerator
1617
{
1718
public:
1819
explicit MeshInfillGenerator(const std::shared_ptr<SliceMeshStorage>& mesh);
1920

21+
void preCalculateData() override;
22+
2023
bool isActive() const override;
2124

2225
protected:
@@ -55,6 +58,7 @@ class MeshInfillGenerator : public MeshFeatureGenerator
5558

5659
private:
5760
const coord_t infill_line_distance_;
61+
std::shared_ptr<LightningGenerator> lightning_generator_; //!< Pre-computed structure for Lightning type infill
5862
};
5963

6064
} // namespace cura

include/infill/LightningGenerator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class LightningGenerator // "Just like Nicola used to make!"
4343
* already be calculated at this point.
4444
* \param mesh The mesh to generate infill for.
4545
*/
46-
LightningGenerator(const SliceMeshStorage& mesh);
46+
LightningGenerator(const std::shared_ptr<SliceMeshStorage>& mesh);
4747

4848
/*!
4949
* Get a tree of paths generated for a certain layer of the mesh.
@@ -65,12 +65,12 @@ class LightningGenerator // "Just like Nicola used to make!"
6565
* only when support is generated. For this pattern, we also need to
6666
* generate overhang areas for the inside of the model.
6767
*/
68-
void generateInitialInternalOverhangs(const SliceMeshStorage& mesh);
68+
void generateInitialInternalOverhangs(const std::shared_ptr<SliceMeshStorage>& mesh);
6969

7070
/*!
7171
* Calculate the tree structure of all layers.
7272
*/
73-
void generateTrees(const SliceMeshStorage& mesh);
73+
void generateTrees(const std::shared_ptr<SliceMeshStorage>& mesh);
7474

7575
/*!
7676
* How far each piece of infill can support skin in the layer above.

include/sliceDataStorage.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ namespace cura
3030

3131
class Mesh;
3232
class SierpinskiFillProvider;
33-
class LightningGenerator;
3433
class PrimeTower;
3534

3635
/*!
@@ -321,8 +320,6 @@ class SliceMeshStorage
321320
std::shared_ptr<SubDivCube> base_subdiv_cube;
322321
std::shared_ptr<SierpinskiFillProvider> cross_fill_provider; //!< the fractal pattern for the cross (3d) filling pattern
323322

324-
std::shared_ptr<LightningGenerator> lightning_generator; //!< Pre-computed structure for Lightning type infill
325-
326323
RetractionAndWipeConfig retraction_wipe_config; //!< Per-Object retraction and wipe settings.
327324
std::shared_ptr<ZSeamConfig> seam_config;
328325

0 commit comments

Comments
 (0)