1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-29 10:09:50 +02:00

Module blurb parenthesis parsing is now greedy to handle args that default to function calls.

This means that library modules cannot be one liners.
This commit is contained in:
Chris Palmer
2021-09-27 16:17:08 +01:00
parent c6b280f0e8
commit 4993c3e82d
12 changed files with 86 additions and 36 deletions

View File

@@ -46,7 +46,9 @@ function bom_mode(n = 1) = (is_undef($bom) ? 0 : $bom) >= n && (is_undef($on_bom
function exploded() = is_undef($exploded_parent) ? is_undef($explode) ? 0 : $explode : 0; //! Returns the value of `$explode` if it is defined, else `0`
function show_supports() = !$preview || exploded(); //! True if printed support material should be shown
module no_explode() let($exploded_parent = true) children(); //! Prevent children being exploded
module no_explode() //! Prevent children being exploded
let($exploded_parent = true) children();
module explode(d, explode_children = false, offset = [0,0,0]) { //! Explode children by specified Z distance or vector `d`, option to explode grand children
v = is_list(d) ? d : [0, 0, d];
o = is_list(offset) ? offset : [0, 0, offset];
@@ -67,7 +69,8 @@ module explode(d, explode_children = false, offset = [0,0,0]) { //! Explode
children();
}
module no_pose() let($posed = true, $zoomed = undef) children(); //! Force children not to be posed even if parent is
module no_pose() //! Force children not to be posed even if parent is
let($posed = true, $zoomed = undef) children();
module pose(a = [55, 0, 25], t = [0, 0, 0], exploded = undef, d = undef) //! Pose an STL or assembly for rendering to png by specifying rotation `a`, translation `t` and optionally `d`, `exploded = true for` just the exploded view or `false` for unexploded only.
let($zoomed = is_undef(d)