Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/CURA-12250_refactor-the-post-pro…
Browse files Browse the repository at this point in the history
…cessing-like-algorithms' into CURA-12250_refactor-the-post-processing-like-algorithms
  • Loading branch information
wawanbreton committed Dec 20, 2024
2 parents b6af8b8 + f7f2527 commit 7c08efa
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion include/PathOrderOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#include <range/v3/view/reverse.hpp>
#include <spdlog/spdlog.h>

#include "path_ordering.h"
#include "path_planning/CombPath.h" //To calculate the combing distance if we want to use combing.
#include "path_planning/LinePolygonsCrossings.h" //To prevent calculating combing distances if we don't cross the combing borders.
#include "path_ordering.h"
#include "settings/EnumSettings.h" //To get the seam settings.
#include "settings/ZSeamConfig.h" //To read the seam configuration.
#include "utils/linearAlg2D.h" //To find the angle of corners to hide seams.
Expand Down
2 changes: 1 addition & 1 deletion include/infill.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class Infill
const Shape& prevent_small_exposed_to_air = Shape());

void generate(
GeneratedPatterns &patterns,
GeneratedPatterns& patterns,
const Settings& settings,
int layer_idx,
SectionType section_type,
Expand Down
16 changes: 13 additions & 3 deletions include/print_operation/InfillFeatureExtrusion.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ namespace cura
class InfillFeatureExtrusion : public MeshFeatureExtrusion
{
public:
explicit InfillFeatureExtrusion(const PrintFeatureType type, const coord_t nominal_line_width, const std::shared_ptr<const SliceMeshStorage>& mesh, const AngleDegrees &infill_angle);

static std::shared_ptr<InfillFeatureExtrusion> makeFrom(const Infill::GeneratedPatterns& patterns, PrintFeatureType type, const coord_t line_width, const std::shared_ptr<const SliceMeshStorage>& mesh,const AngleDegrees& infill_angle, const Velocity &speed);
explicit InfillFeatureExtrusion(
const PrintFeatureType type,
const coord_t nominal_line_width,
const std::shared_ptr<const SliceMeshStorage>& mesh,
const AngleDegrees& infill_angle);

static std::shared_ptr<InfillFeatureExtrusion> makeFrom(
const Infill::GeneratedPatterns& patterns,
PrintFeatureType type,
const coord_t line_width,
const std::shared_ptr<const SliceMeshStorage>& mesh,
const AngleDegrees& infill_angle,
const Velocity& speed);

const AngleDegrees& GetInfillAngle() const;

Expand Down
23 changes: 3 additions & 20 deletions src/feature_generation/MeshInfillGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

#include "print_operation/ContinuousExtruderMoveSequence.h"
#include "print_operation/ExtruderPlan.h"
#include "print_operation/LayerPlan.h"
#include "print_operation/InfillFeatureExtrusion.h"
#include "print_operation/LayerPlan.h"
#include "utils/math.h"


Expand Down Expand Up @@ -142,29 +142,12 @@ void MeshInfillGenerator::generateFeatures(
skip_some_zags,
zag_skip_count,
pocket_size);
infill_comp.generate(
patterns,
settings,
layer_plan->getLayerIndex(),
SectionType::INFILL,
getMesh()->cross_fill_provider,
lightning_layer,
getMesh().get());
infill_comp.generate(patterns, settings, layer_plan->getLayerIndex(), SectionType::INFILL, getMesh()->cross_fill_provider, lightning_layer, getMesh().get());
};

if (combine_idx == 0)
{
processMultiLayerInfill(
part,
settings,
layer_plan,
last_idx,
infill_pattern,
infill_line_width,
infill_overlap,
zig_zaggify_infill,
generate_infill,
patterns);
processMultiLayerInfill(part, settings, layer_plan, last_idx, infill_pattern, infill_line_width, infill_overlap, zig_zaggify_infill, generate_infill, patterns);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/feature_generation/MeshSkinGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "infill.h"
#include "print_operation/ContinuousExtruderMoveSequence.h"
#include "print_operation/ExtruderPlan.h"
#include "print_operation/LayerPlan.h"
#include "print_operation/InfillFeatureExtrusion.h"
#include "print_operation/LayerPlan.h"
#include "settings/EnumSettings.h"
#include "settings/PathConfigStorage.h"
#include "sliceDataStorage.h"
Expand Down
2 changes: 1 addition & 1 deletion src/operation_transformation/FeatureExtrusionScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ FeatureExtrusionScheduler::SequencesConstraintsMap FeatureExtrusionScheduler::ma

for (const std::shared_ptr<MoveSequencesConstraintsGenerator>& constraints_generator : moves_constraints_generators)
{
constraints_generator->appendConstraints(feature_extrusion, constraints);
constraints_generator->appendConstraints(feature_extrusion, constraints);
}

return constraints;
Expand Down
10 changes: 8 additions & 2 deletions src/print_operation/InfillFeatureExtrusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include "print_operation/InfillFeatureExtrusion.h"

#include "print_operation/ContinuousExtruderMoveSequence.h"
#include "geometry/OpenPolyline.h"
#include "print_operation/ContinuousExtruderMoveSequence.h"

namespace cura
{
Expand All @@ -19,7 +19,13 @@ InfillFeatureExtrusion::InfillFeatureExtrusion(
{
}

std::shared_ptr<InfillFeatureExtrusion> InfillFeatureExtrusion::makeFrom(const Infill::GeneratedPatterns& patterns, PrintFeatureType type, const coord_t line_width, const std::shared_ptr<const SliceMeshStorage>& mesh,const AngleDegrees& infill_angle, const Velocity &speed)
std::shared_ptr<InfillFeatureExtrusion> InfillFeatureExtrusion::makeFrom(
const Infill::GeneratedPatterns& patterns,
PrintFeatureType type,
const coord_t line_width,
const std::shared_ptr<const SliceMeshStorage>& mesh,
const AngleDegrees& infill_angle,
const Velocity& speed)
{
auto feature_extrusion = std::make_shared<InfillFeatureExtrusion>(type, line_width, mesh, infill_angle);

Expand Down

0 comments on commit 7c08efa

Please sign in to comment.