From 914e57cc6e3119c738808bd5a77b77e944679a31 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Wed, 11 Nov 2020 17:45:12 -0800 Subject: [PATCH] Fix for nested diff()s, issue #270 --- attachments.scad | 9 ++++++--- version.scad | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/attachments.scad b/attachments.scad index b8ffa9f..36ad4b3 100644 --- a/attachments.scad +++ b/attachments.scad @@ -923,7 +923,8 @@ module attachable( $parent_geom = geom; $parent_size = attach_geom_size(geom); $attach_to = undef; - if (attachment_is_shown($tags)) { + do_show = attachment_is_shown($tags); + if (do_show) { if (is_undef($color)) { children(0); } else color($color) { @@ -1270,7 +1271,7 @@ module recolor(c) // Usage: // hide(tags) ... // Description: -// Hides all children with the given tags. +// Hides all children with the given tags. Overrides any previous `hide()` or `show()` calls. // Example: // hide("A") cube(50, anchor=CENTER, $tags="Main") { // attach(LEFT, BOTTOM) cylinder(d=30, l=30, $tags="A"); @@ -1279,6 +1280,7 @@ module recolor(c) module hide(tags="") { $tags_hidden = tags==""? [] : str_split(tags, " "); + $tags_shown = []; children(); } @@ -1287,7 +1289,7 @@ module hide(tags="") // Usage: // show(tags) ... // Description: -// Shows only children with the given tags. +// Shows only children with the given tags. Overrides any previous `hide()` or `show()` calls. // Example: // show("A B") cube(50, anchor=CENTER, $tags="Main") { // attach(LEFT, BOTTOM) cylinder(d=30, l=30, $tags="A"); @@ -1296,6 +1298,7 @@ module hide(tags="") module show(tags="") { $tags_shown = tags==""? [] : str_split(tags, " "); + $tags_hidden = []; children(); } diff --git a/version.scad b/version.scad index ac55581..a676d9a 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,462]; +BOSL_VERSION = [2,0,463]; // Section: BOSL Library Version Functions