mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
Added strings.scad to std.scad
This commit is contained in:
parent
f7578b4ba3
commit
c1e3f5d60a
3 changed files with 5 additions and 11 deletions
|
@ -531,19 +531,12 @@ function attachment_is_shown(tags) =
|
|||
assert(!is_undef($tags_shown))
|
||||
assert(!is_undef($tags_hidden))
|
||||
let(
|
||||
tags = _str_char_split(tags, " "),
|
||||
tags = str_split(tags, " "),
|
||||
shown = !$tags_shown || any([for (tag=tags) in_list(tag, $tags_shown)]),
|
||||
hidden = any([for (tag=tags) in_list(tag, $tags_hidden)])
|
||||
) shown && !hidden;
|
||||
|
||||
|
||||
function _str_char_split(s,delim,n=0,acc=[],word="") =
|
||||
(n>=len(s))? concat(acc, [word]) :
|
||||
(s[n]==delim)?
|
||||
_str_char_split(s,delim,n+1,concat(acc,[word]),"") :
|
||||
_str_char_split(s,delim,n+1,acc,str(word,s[n]));
|
||||
|
||||
|
||||
// Function: reorient()
|
||||
//
|
||||
// Usage:
|
||||
|
@ -1054,7 +1047,7 @@ module recolor(c)
|
|||
// }
|
||||
module hide(tags="")
|
||||
{
|
||||
$tags_hidden = tags==""? [] : _str_char_split(tags, " ");
|
||||
$tags_hidden = tags==""? [] : str_split(tags, " ");
|
||||
children();
|
||||
}
|
||||
|
||||
|
@ -1071,7 +1064,7 @@ module hide(tags="")
|
|||
// }
|
||||
module show(tags="")
|
||||
{
|
||||
$tags_shown = tags==""? [] : _str_char_split(tags, " ");
|
||||
$tags_shown = tags==""? [] : str_split(tags, " ");
|
||||
children();
|
||||
}
|
||||
|
||||
|
|
1
std.scad
1
std.scad
|
@ -16,6 +16,7 @@ include <edges.scad>
|
|||
include <common.scad>
|
||||
include <errors.scad>
|
||||
include <arrays.scad>
|
||||
include <strings.scad>
|
||||
include <vnf.scad>
|
||||
|
||||
include <math.scad>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,184];
|
||||
BOSL_VERSION = [2,0,185];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
|
Loading…
Reference in a new issue