Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions benchmark/wall_benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class WallTestFixture : public benchmark::Fixture
settings.add("min_feature_size", "0");
settings.add("wall_0_extruder_nr", "0");
settings.add("wall_0_inset", "0");
settings.add("wall_line_count", "2");
settings.add("wall_line_width_0", "0.4");
settings.add("wall_line_width_x", "0.4");
settings.add("min_even_wall_line_width", "0.34");
Expand All @@ -82,6 +81,7 @@ class WallTestFixture : public benchmark::Fixture
settings.add("wall_line_count", std::to_string(state.range(0)));
outer_to_inner = false;
layer.parts.emplace_back();
layer.outer_wall_count = state.range(0);

SliceLayerPart& part = layer.parts.back();
part.outline.push_back(ff_holes);
Expand Down Expand Up @@ -128,7 +128,6 @@ class HolesWallTestFixture : public benchmark::Fixture
settings.add("min_feature_size", "0");
settings.add("wall_0_extruder_nr", "0");
settings.add("wall_0_inset", "0");
settings.add("wall_line_count", "2");
settings.add("wall_line_width_0", "0.4");
settings.add("wall_line_width_x", "0.4");
settings.add("min_even_wall_line_width", "0.34");
Expand All @@ -142,6 +141,7 @@ class HolesWallTestFixture : public benchmark::Fixture
settings.add("wall_line_count", std::to_string(state.range(0)));
outer_to_inner = false;
layer.parts.emplace_back();
layer.outer_wall_count = state.range(0);

SliceLayerPart& part = layer.parts.back();
part.outline.push_back(shape.front());
Expand Down
24 changes: 21 additions & 3 deletions include/FffGcodeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,15 @@ class FffGcodeWriter : public NoCopy
*
* \param[in] storage where the slice data is stored.
* \param mesh_ptr The mesh to add to the layer plan \p gcode_layer.
* \param slice_layer The layer currently being processed
* \param extruder_nr The extruder for which to print all features of the mesh which should be printed with this extruder
* \param mesh_config the line config with which to print a print feature
* \param gcode_layer The initial planning of the gcode of the layer.
*/
void addMeshLayerToGCode(
const SliceDataStorage& storage,
const std::shared_ptr<SliceMeshStorage>& mesh_ptr,
const SliceLayer& slice_layer,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
LayerPlan& gcode_layer) const;
Expand All @@ -340,6 +342,7 @@ class FffGcodeWriter : public NoCopy
* \param[in] storage where the slice data is stored.
* \param storage Storage to get global settings from.
* \param mesh The mesh to add to the layer plan \p gcode_layer.
* \param slice_layer The layer currently being processed
* \param extruder_nr The extruder for which to print all features of the mesh which should be printed with this extruder
* \param mesh_config the line config with which to print a print feature
* \param part The part to add
Expand All @@ -348,6 +351,7 @@ class FffGcodeWriter : public NoCopy
void addMeshPartToGCode(
const SliceDataStorage& storage,
const SliceMeshStorage& mesh,
const SliceLayer& slice_layer,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
SliceLayerPart& part,
Expand All @@ -358,6 +362,7 @@ class FffGcodeWriter : public NoCopy
*
* \param gcodeLayer The initial planning of the gcode of the layer.
* \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
* \param slice_layer The layer currently being processed
* \param extruder_nr The extruder for which to print all features of the
* mesh which should be printed with this extruder.
* \param mesh_config the line config with which to print a print feature.
Expand All @@ -369,6 +374,7 @@ class FffGcodeWriter : public NoCopy
const SliceDataStorage& storage,
LayerPlan& gcodeLayer,
const SliceMeshStorage& mesh,
const SliceLayer& slice_layer,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SliceLayerPart& part,
Expand All @@ -381,7 +387,8 @@ class FffGcodeWriter : public NoCopy
* \param gcodeLayer The initial planning of the gcode of the layer.
* \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
* \param extruder_nr The extruder for which to print all features of the
* mesh which should be printed with this extruder.
* \param mesh which should be printed with this extruder.
* \param slice_layer The layer currently being processed
* \param mesh_config The line config with which to print a print feature.
* \param part The part for which to create gcode.
* \param start_move_inwards_length The length of the extra inwards moves to be added at the start of each infill line
Expand All @@ -393,6 +400,7 @@ class FffGcodeWriter : public NoCopy
bool processMultiLayerInfill(
LayerPlan& gcodeLayer,
const SliceMeshStorage& mesh,
const SliceLayer& slice_layer,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SliceLayerPart& part,
Expand All @@ -406,7 +414,8 @@ class FffGcodeWriter : public NoCopy
* \param gcodeLayer The initial planning of the gcode of the layer.
* \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
* \param extruder_nr The extruder for which to print all features of the
* mesh which should be printed with this extruder
* \param mesh which should be printed with this extruder
* \param slice_layer The layer currently being processed
* \param mesh_config The line config with which to print a print feature.
* \param part The part for which to create gcode.
* \param start_move_inwards_length The length of the extra inwards moves to be added at the start of each infill line
Expand All @@ -419,6 +428,7 @@ class FffGcodeWriter : public NoCopy
const SliceDataStorage& storage,
LayerPlan& gcodeLayer,
const SliceMeshStorage& mesh,
const SliceLayer& slice_layer,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SliceLayerPart& part,
Expand Down Expand Up @@ -466,7 +476,7 @@ class FffGcodeWriter : public NoCopy
const SliceMeshStorage& mesh,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
SliceLayerPart& part,
const SliceLayerPart& part,
const bool infill_added) const;

/*!
Expand All @@ -487,6 +497,7 @@ class FffGcodeWriter : public NoCopy
* \param[in] storage where the slice data is stored.
* \param gcode_layer The initial planning of the gcode of the layer.
* \param mesh The mesh for which to add to the layer plan \p gcode_layer.
* \param slice_layer The layer currently being processed
* \param extruder_nr The extruder for which to print all features of the mesh which should be printed with this extruder
* \param mesh_config the line config with which to print a print feature
* \param part The part for which to create gcode
Expand All @@ -496,6 +507,7 @@ class FffGcodeWriter : public NoCopy
const SliceDataStorage& storage,
LayerPlan& gcode_layer,
const SliceMeshStorage& mesh,
const SliceLayer& slice_layer,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SliceLayerPart& part) const;
Expand All @@ -516,6 +528,7 @@ class FffGcodeWriter : public NoCopy
* \param[in] storage where the slice data is stored.
* \param gcode_layer The initial planning of the gcode of the layer.
* \param mesh The mesh for which to add to the layer plan \p gcode_layer.
* \param slice_layer The layer currently being processed
* \param extruder_nr The extruder for which to print all features of the mesh which should be printed with this extruder
* \param mesh_config the line config with which to print a print feature
* \param skin_part The skin part for which to create gcode
Expand All @@ -525,6 +538,7 @@ class FffGcodeWriter : public NoCopy
const SliceDataStorage& storage,
LayerPlan& gcode_layer,
const SliceMeshStorage& mesh,
const SliceLayer& slice_layer,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const SkinPart& skin_part) const;
Expand All @@ -546,6 +560,7 @@ class FffGcodeWriter : public NoCopy
const SliceMeshStorage& mesh,
const size_t extruder_nr,
const RoofingFlooringSettingsNames& settings_names,
const size_t wall_line_count,
const Shape& fill,
const GCodePathConfig& config,
const std::vector<AngleDegrees>& angles,
Expand All @@ -558,6 +573,7 @@ class FffGcodeWriter : public NoCopy
* \param[in] storage where the slice data is stored.
* \param gcode_layer The initial planning of the gcode of the layer.
* \param mesh The mesh for which to add to the layer plan \p gcode_layer.
* \param slice_layer The layer currently being processed
* \param extruder_nr The extruder for which to print all features of the mesh which should be printed with this extruder
* \param mesh_config the line config with which to print a print feature
* \param skin_fill The shape of the skin for which to create gcode
Expand All @@ -567,6 +583,7 @@ class FffGcodeWriter : public NoCopy
const SliceDataStorage& storage,
LayerPlan& gcode_layer,
const SliceMeshStorage& mesh,
const SliceLayer& slice_layer,
const size_t extruder_nr,
const MeshPathConfigs& mesh_config,
const Shape& skin_fill,
Expand Down Expand Up @@ -604,6 +621,7 @@ class FffGcodeWriter : public NoCopy
const coord_t skin_overlap,
const Ratio skin_density,
const LinesOrderingMethod ordering,
const size_t wall_line_count,
const bool is_roofing_flooring,
bool& added_something,
double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT,
Expand Down
2 changes: 2 additions & 0 deletions include/LayerPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ class LayerPlan : public NoCopy

LayerIndex getLayerNr() const;

bool isInitialLayer() const;

/*!
* Get the last planned position, or if no position has been planned yet, the user specified layer start position.
*
Expand Down
2 changes: 1 addition & 1 deletion include/WallsComputation.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class WallsComputation
*
* \param part The part for which to generate the insets.
*/
void generateWalls(SliceLayerPart* part, SectionType section);
void generateWalls(const SliceLayer* layer, SliceLayerPart* part, SectionType section);

/*!
* Generates the outer inset / perimeter used in spiralize mode for a single layer part. The spiral inset is
Expand Down
23 changes: 20 additions & 3 deletions include/infill/LightningGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace cura
{
class SliceMeshStorage;
class SupportStorage;
class SliceLayer;

/*!
* Generates the Lightning Infill pattern.
Expand Down Expand Up @@ -68,6 +69,22 @@ class LightningGenerator // "Just like Nicola used to make!"
const LightningLayer& getTreesForLayer(const size_t& layer_id) const;

protected:
/*! Helper structure to get the infill wall line count either from a fixed value or depending on the layer */
struct WallLineCount : std::variant<size_t, const std::vector<SliceLayer>*>
{
WallLineCount(const size_t fixed_count)
: std::variant<size_t, const std::vector<SliceLayer>*>(fixed_count)
{
}

WallLineCount(const std::vector<SliceLayer>* variable_count)
: std::variant<size_t, const std::vector<SliceLayer>*>(variable_count)
{
}

size_t getCountAt(const size_t layer_nr) const;
};

/*!
* Generate the lightning infill for the given areas with the given settings
* @param layer_thickness The actual layer thickness
Expand All @@ -82,7 +99,7 @@ class LightningGenerator // "Just like Nicola used to make!"
void generate(
const coord_t layer_thickness,
const coord_t line_width,
const coord_t wall_line_count,
const WallLineCount& wall_line_count,
const coord_t line_distance,
const AngleRadians& overhang_angle,
const AngleRadians& prune_angle,
Expand All @@ -97,12 +114,12 @@ class LightningGenerator // "Just like Nicola used to make!"
* only when support is generated. For this pattern, we also need to
* generate overhang areas for the inside of the model.
*/
void generateInitialInternalOverhangs(const coord_t infill_line_width, const coord_t infill_wall_line_count, const std::vector<Shape>& areas_per_layer);
void generateInitialInternalOverhangs(const coord_t infill_line_width, const WallLineCount& infill_wall_line_count, const std::vector<Shape>& areas_per_layer);

/*!
* Calculate the tree structure of all layers.
*/
void generateTrees(const coord_t infill_line_width, const coord_t infill_wall_line_count, const std::vector<Shape>& areas_per_layer);
void generateTrees(const coord_t infill_line_width, const WallLineCount& infill_wall_line_count, const std::vector<Shape>& areas_per_layer);

/*!
* How far each piece of infill can support skin in the layer above.
Expand Down
6 changes: 6 additions & 0 deletions include/sliceDataStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ class SliceLayer
*/
Shape bottom_surface;

size_t outer_wall_count{ 0 }; //!< The number of walls printed on the outer contour of the model, common to all areas
size_t extra_wall_count_infill{ 0 }; //!< The extra number of walls printed around infill areas
size_t extra_wall_count_skin{ 0 }; //!< The extra number of walls printed around skin areas
size_t extra_wall_count_flooring{ 0 }; //!< The extra number of walls printed around flooring areas
size_t extra_wall_count_roofing{ 0 }; //!< The extra number of walls printed around roofing areas

/*!
* Get the all outlines of all layer parts in this layer.
*
Expand Down
Loading
Loading