From 47fc39a4ba625483c36a2f836ea5635be61572d8 Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Fri, 1 Apr 2022 16:37:04 +0200 Subject: [PATCH] fixed misleanding or wrong comments of the fitting function --- src/libslic3r/Geometry/Curves.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/Geometry/Curves.hpp b/src/libslic3r/Geometry/Curves.hpp index e39e7f100..6542cb706 100644 --- a/src/libslic3r/Geometry/Curves.hpp +++ b/src/libslic3r/Geometry/Curves.hpp @@ -70,7 +70,7 @@ struct PiecewiseFittedCurve { Vec get_fitted_value(const NumberType &observation_point) const { Vec result = Vec::Zero(); - //find corresponding segment index; expects kernels to be centered; NOTE: shift by number of additional segments, which are outside of the valid length + //find corresponding segment index; expects kernels to be centered int middle_right_segment_index = floor((observation_point - start) / segment_size); //find index of first segment that is affected by the point i; this can be deduced from kernel_span int start_segment_idx = middle_right_segment_index - Kernel::kernel_span / 2 + 1; @@ -91,9 +91,8 @@ struct PiecewiseFittedCurve { // observation points: growing sequence of points where the observations were made. // In other words, for function f(x) = y, observations are y0...yn, and observation points are x0...xn // weights: how important the observation is -// number_of_inner_splines: how many full inner splines are fit into the normalized valid range 0,1; -// final number of knots is Kernel::kernel_span times number_of_inner_splines + additional segments on start and end -// Kernel: model used for the curve fitting +// segments_count: number of segments inside the valid length of the curve +// endpoints_level_of_freedom: number of additional parameters at each end; reasonable values depend on the kernel span template PiecewiseFittedCurve fit_curve( const std::vector> &observations,