1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-01 11:22:36 +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

@@ -588,9 +588,26 @@ module box_back_blank(type, sheet = false) { //! Generates a 2D template for the
sheet_2D(subst_sheet(type, sheet), box_width(type) - sheet_reduction(type), box_height(type) - sheet_reduction(type), 1);
}
module box_base(type) render_2D_sheet(box_base_sheet(type)) box_base_blank(type); //! Default base, can be overridden to customise
module box_top(type) render_2D_sheet(box_top_sheet(type)) box_top_blank(type); //! Default top, can be overridden to customise
module box_back(type) render_2D_sheet(box_sheets(type)) box_back_blank(type); //! Default back, can be overridden to customise
module box_front(type) render_2D_sheet(box_sheets(type)) box_front_blank(type); //! Default front, can be overridden to customise
module box_left(type) render_2D_sheet(box_sheets(type)) box_left_blank(type); //! Default left side, can be overridden to customise
module box_right(type) render_2D_sheet(box_sheets(type)) box_right_blank(type); //! Default right side, can be overridden to customise
module box_base(type) //! Default base, can be overridden to customise
render_2D_sheet(box_base_sheet(type))
box_base_blank(type);
module box_top(type) //! Default top, can be overridden to customise
render_2D_sheet(box_top_sheet(type))
box_top_blank(type);
module box_back(type) //! Default back, can be overridden to customise
render_2D_sheet(box_sheets(type))
box_back_blank(type);
module box_front(type) //! Default front, can be overridden to customise
render_2D_sheet(box_sheets(type))
box_front_blank(type);
module box_left(type) //! Default left side, can be overridden to customise
render_2D_sheet(box_sheets(type))
box_left_blank(type);
module box_right(type) //! Default right side, can be overridden to customise
render_2D_sheet(box_sheets(type))
box_right_blank(type);

View File

@@ -198,12 +198,29 @@ module bbox_back_blank(type, sheet = false) { //! 2D template for the back
}
}
module bbox_base(type) render_2D_sheet(bbox_base_sheet(type)) bbox_base_blank(type); //! Default base, can be overridden to customise
module bbox_top(type) render_2D_sheet(bbox_top_sheet(type)) bbox_top_blank(type); //! Default top, can be overridden to customise
module bbox_back(type) render_2D_sheet(bbox_sheets(type)) bbox_back_blank(type); //! Default back, can be overridden to customise
module bbox_front(type) render_2D_sheet(bbox_sheets(type)) bbox_front_blank(type); //! Default front, can be overridden to customise
module bbox_left(type) render_2D_sheet(bbox_sheets(type)) bbox_left_blank(type); //! Default left side, can be overridden to customise
module bbox_right(type) render_2D_sheet(bbox_sheets(type)) bbox_right_blank(type); //! Default right side, can be overridden to customise
module bbox_base(type) //! Default base, can be overridden to customise
render_2D_sheet(bbox_base_sheet(type))
bbox_base_blank(type);
module bbox_top(type) //! Default top, can be overridden to customise
render_2D_sheet(bbox_top_sheet(type))
bbox_top_blank(type);
module bbox_back(type) //! Default back, can be overridden to customise
render_2D_sheet(bbox_sheets(type))
bbox_back_blank(type);
module bbox_front(type) //! Default front, can be overridden to customise
render_2D_sheet(bbox_sheets(type))
bbox_front_blank(type);
module bbox_left(type) //! Default left side, can be overridden to customise
render_2D_sheet(bbox_sheets(type))
bbox_left_blank(type);
module bbox_right(type) //! Default right side, can be overridden to customise
render_2D_sheet(bbox_sheets(type))
bbox_right_blank(type);
module _bbox_assembly(type, top = true, base = true, left = true, right = true, back = true, front = true) { //! The box assembly, wrap with a local copy without parameters
width = bbox_width(type);

View File

@@ -105,7 +105,8 @@ module fixing_block(screw = def_screw) { //! Generate the STL
}
}
module fixing_block_assembly(screw = def_screw) pose([55, 180, 25], [0, 4.8, 4.8]) //! Printed part with the inserts inserted
module fixing_block_assembly(screw = def_screw) //! Printed part with the inserts inserted
pose([55, 180, 25], [0, 4.8, 4.8])
assembly(str("fixing_block_M", 20 * screw_radius(screw)), ngb = true) {
translate_z(fixing_block_height(screw))
rotate([0, 180, 0])

View File

@@ -79,7 +79,8 @@ module handle_stl() { //! generate the STL
//
//! Place inserts in the bottom of the posts and push them home with a soldering iron with a conical bit heated to 200°C.
//
module handle_assembly() pose([225, 0, 150], [0, 0, 14]) //! Printed part with inserts in place
module handle_assembly() //! Printed part with inserts in place
pose([225, 0, 150], [0, 0, 14])
assembly("handle", ngb = true) {
translate_z(handle_height())
stl_colour(pp1_colour) vflip() handle_stl();

View File

@@ -81,8 +81,9 @@ module ribbon_clamp(ways, screw = screw) { //! Generate STL for given number of
}
}
module ribbon_clamp_assembly(ways, screw = screw) pose([55, 180, 25]) //! Printed part with inserts in place
assembly(let(screw_d = screw_radius(screw) * 2)str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : ""), ngb = true) {
module ribbon_clamp_assembly(ways, screw = screw) //! Printed part with inserts in place
pose([55, 180, 25])
assembly(let(screw_d = screw_radius(screw) * 2)str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : ""), ngb = true) {
h = ribbon_clamp_height(screw);
insert = screw_insert(screw);