From ac23a369d54d46ff8ef68549d4ec2622a4561cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Tue, 10 May 2022 13:18:59 +0200 Subject: [PATCH] Fixed a missing infill caused by int32_t overflow. --- src/libslic3r/Arachne/utils/ExtrusionLine.cpp | 4 ++-- src/libslic3r/Arachne/utils/ExtrusionLine.hpp | 6 +++--- src/libslic3r/Arachne/utils/PolylineStitcher.hpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/Arachne/utils/ExtrusionLine.cpp b/src/libslic3r/Arachne/utils/ExtrusionLine.cpp index 958fbf3d1..878beb406 100644 --- a/src/libslic3r/Arachne/utils/ExtrusionLine.cpp +++ b/src/libslic3r/Arachne/utils/ExtrusionLine.cpp @@ -11,12 +11,12 @@ namespace Slic3r::Arachne ExtrusionLine::ExtrusionLine(const size_t inset_idx, const bool is_odd) : inset_idx(inset_idx), is_odd(is_odd), is_closed(false) {} -coord_t ExtrusionLine::getLength() const +int64_t ExtrusionLine::getLength() const { if (junctions.empty()) return 0; - coord_t len = 0; + int64_t len = 0; ExtrusionJunction prev = junctions.front(); for (const ExtrusionJunction &next : junctions) { len += (next.p - prev.p).cast().norm(); diff --git a/src/libslic3r/Arachne/utils/ExtrusionLine.hpp b/src/libslic3r/Arachne/utils/ExtrusionLine.hpp index def0304c0..07d8d41a2 100644 --- a/src/libslic3r/Arachne/utils/ExtrusionLine.hpp +++ b/src/libslic3r/Arachne/utils/ExtrusionLine.hpp @@ -8,7 +8,7 @@ #include "ExtrusionJunction.hpp" #include "../../Polyline.hpp" #include "../../Polygon.hpp" -#include "BoundingBox.hpp" +#include "../../BoundingBox.hpp" namespace Slic3r { class ThickPolyline; @@ -116,8 +116,8 @@ struct ExtrusionLine /*! * Sum the total length of this path. */ - coord_t getLength() const; - coord_t polylineLength() const { return getLength(); } + int64_t getLength() const; + int64_t polylineLength() const { return getLength(); } /*! * Put all junction locations into a polygon object. diff --git a/src/libslic3r/Arachne/utils/PolylineStitcher.hpp b/src/libslic3r/Arachne/utils/PolylineStitcher.hpp index 6892c3c81..14bdec0d4 100644 --- a/src/libslic3r/Arachne/utils/PolylineStitcher.hpp +++ b/src/libslic3r/Arachne/utils/PolylineStitcher.hpp @@ -85,7 +85,7 @@ public: { // try extending chain in the other direction chain.reverse(); } - coord_t chain_length = chain.polylineLength(); + int64_t chain_length = chain.polylineLength(); while (true) {