OrcaSlicer/src/libslic3r/GCode/SmallAreaInfillFlowCompensator.hpp
Ian Bassi 0049fd7554 Replace spline with PchipInterpolatorHelper in flow compensator
Swapped out the tk::spline implementation for PchipInterpolatorHelper in SmallAreaInfillFlowCompensator. Updated member types and method calls to use the new interpolator for improved flow compensation modeling.
2025-12-23 09:42:52 -03:00

35 lines
952 B
C++

#ifndef slic3r_GCode_SmallAreaInfillFlowCompensator_hpp_
#define slic3r_GCode_SmallAreaInfillFlowCompensator_hpp_
#include "../libslic3r.h"
#include "../PrintConfig.hpp"
#include "../ExtrusionEntity.hpp"
#include "PchipInterpolatorHelper.hpp"
#include <memory>
namespace Slic3r {
class SmallAreaInfillFlowCompensator
{
public:
SmallAreaInfillFlowCompensator() = delete;
explicit SmallAreaInfillFlowCompensator(const Slic3r::GCodeConfig& config);
~SmallAreaInfillFlowCompensator();
double modify_flow(const double line_length, const double dE, const ExtrusionRole role);
private:
// Model points
std::vector<double> eLengths;
std::vector<double> flowComps;
std::unique_ptr<PchipInterpolatorHelper> flowModel;
double flow_comp_model(const double line_length);
double max_modified_length() { return eLengths.back(); }
};
} // namespace Slic3r
#endif /* slic3r_GCode_SmallAreaInfillFlowCompensator_hpp_ */