From 2aaa7006e7d0825121533ecdc37afb5783576d35 Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Thu, 5 Mar 2020 03:30:18 -0800 Subject: [PATCH] Attempt to fix errors with union(), difference(), intersection() with infinitesimally misaligned paths. --- regions.scad | 6 +++--- version.scad | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/regions.scad b/regions.scad index b8939dc..5e4e330 100644 --- a/regions.scad +++ b/regions.scad @@ -644,7 +644,7 @@ function union(regions=[],b=undef,c=undef,eps=EPSILON) = b!=undef? union(concat([regions],[b],c==undef?[]:[c]), eps=eps) : len(regions)<=1? regions[0] : union( - let(regions=[for (r=regions) is_path(r)? [r] : r]) + let(regions=[for (r=regions) quant(is_path(r)? [r] : r, 1/65536)]) concat( [_tagged_region(regions[0],regions[1],["O","S"],["O"], eps=eps)], [for (i=[2:1:len(regions)-1]) regions[i]] @@ -675,7 +675,7 @@ function difference(regions=[],b=undef,c=undef,eps=EPSILON) = b!=undef? difference(concat([regions],[b],c==undef?[]:[c]), eps=eps) : len(regions)<=1? regions[0] : difference( - let(regions=[for (r=regions) is_path(r)? [r] : r]) + let(regions=[for (r=regions) quant(is_path(r)? [r] : r, 1/65536)]) concat( [_tagged_region(regions[0],regions[1],["O","U"],["I"], eps=eps)], [for (i=[2:1:len(regions)-1]) regions[i]] @@ -705,7 +705,7 @@ function intersection(regions=[],b=undef,c=undef,eps=EPSILON) = b!=undef? intersection(concat([regions],[b],c==undef?[]:[c]),eps=eps) : len(regions)<=1? regions[0] : intersection( - let(regions=[for (r=regions) is_path(r)? [r] : r]) + let(regions=[for (r=regions) quant(is_path(r)? [r] : r, 1/65536)]) concat( [_tagged_region(regions[0],regions[1],["I","S"],["I"],eps=eps)], [for (i=[2:1:len(regions)-1]) regions[i]] diff --git a/version.scad b/version.scad index 9730ff4..12c72fc 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,159]; +BOSL_VERSION = [2,0,160]; // Section: BOSL Library Version Functions