From 91b9b8aebfa634ee7a6f26284a5b782c72de0fb6 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Wed, 23 May 2018 12:49:56 +0200 Subject: Fixed wrong layer height texture updates when using multiple objects --- xs/xsp/Print.xsp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xs') diff --git a/xs/xsp/Print.xsp b/xs/xsp/Print.xsp index ef9c5345f..702919514 100644 --- a/xs/xsp/Print.xsp +++ b/xs/xsp/Print.xsp @@ -52,6 +52,9 @@ _constant() int region_count() %code%{ RETVAL = THIS->print()->regions.size(); %}; + int region_volumes_count() + %code%{ RETVAL = THIS->region_volumes.size(); %}; + Ref print(); Ref model_object(); Ref config() -- cgit v1.2.3 From 40bb0b6f55c5702da34b801eb23ee891a06c723d Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Tue, 5 Jun 2018 16:07:09 +0200 Subject: Fixed overflow in Polygon::area() --- xs/src/libslic3r/Polygon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xs') diff --git a/xs/src/libslic3r/Polygon.cpp b/xs/src/libslic3r/Polygon.cpp index 27f9a2ca1..b5fd7e64f 100644 --- a/xs/src/libslic3r/Polygon.cpp +++ b/xs/src/libslic3r/Polygon.cpp @@ -103,7 +103,7 @@ double Polygon::area() const double a = 0.; for (size_t i = 0, j = n - 1; i < n; ++i) { - a += double(points[j].x + points[i].x) * double(points[i].y - points[j].y); + a += ((double)points[j].x + (double)points[i].x) * ((double)points[i].y - (double)points[j].y); j = i; } return 0.5 * a; -- cgit v1.2.3