From 9a66bc613276aa1a91eabd8bc4f13c2b16d74748 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 9 Oct 2021 23:15:43 -0400 Subject: [PATCH] tag optimization --- regions.scad | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/regions.scad b/regions.scad index 380ef11..6909866 100644 --- a/regions.scad +++ b/regions.scad @@ -1014,10 +1014,10 @@ function _tag_subpaths(region1, region2, eps=EPSILON, SUtags=true) = ]; -function _tagged_region(region1,region2,keep1,keep2,eps=EPSILON) = +function _tagged_region(region1,region2,keep1,keep2,SUtags1=true, eps=EPSILON) = let( - tagged1 = _tag_subpaths(region1, region2, eps=eps), - tagged2 = _tag_subpaths(region2, region1, eps=eps), + tagged1 = _tag_subpaths(region1, region2, eps=eps, SUtags=SUtags1), + tagged2 = _tag_subpaths(region2, region1, eps=eps, SUtags=false), tagged = [ for (tagpath = tagged1) if (in_list(tagpath[0], keep1)) tagpath[1], for (tagpath = tagged2) if (in_list(tagpath[0], keep2)) tagpath[1] @@ -1151,7 +1151,7 @@ function exclusive_or(regions=[],b=undef,c=undef,eps=EPSILON) = len(regions)==1? regions[0] : let(regions=[for (r=regions) is_path(r)? [r] : r]) exclusive_or([ - _tagged_region(regions[0],regions[1],["I","O"],["I","O"],eps=eps), + _tagged_region(regions[0],regions[1],["I","O"],["I","O"],eps=eps,SUtags1=false), for (i=[2:1:len(regions)-1]) regions[i] ], eps=eps