Fixed numerical issue with the new algorithm to connect infill lines

with perimeters:
1) Increased accuracy of the contour length parametrization from
   float to double, as double should capture the difference of
   32bit coord_t with full accuracy (or at least very close).
2) The algorithm to insert the T-joint points into the infill perimeter
   contour was improved to avoid inserting duplicate points.
This commit is contained in:
Vojtech Bubnik 2021-01-06 12:18:05 +01:00
parent 3c9f3d2b66
commit 93a5906a18
2 changed files with 106 additions and 97 deletions

View file

@ -37,7 +37,7 @@ protected:
bool _can_connect(coord_t dist_X, coord_t dist_Y)
{
coord_t TOLERANCE = 10 * SCALED_EPSILON;
const auto TOLERANCE = coord_t(10 * SCALED_EPSILON);
return (dist_X >= (this->_line_spacing - this->_line_oscillation) - TOLERANCE)
&& (dist_X <= (this->_line_spacing + this->_line_oscillation) + TOLERANCE)
&& (dist_Y <= this->_diagonal_distance);