mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2024-11-30 02:30:03 -05:00
Made hflip and vflip conditional.
This commit is contained in:
parent
d70ddf5359
commit
25dceee20a
@ -39,7 +39,7 @@ module belt_test() {
|
|||||||
screw = find_screw(hs_cs_cap, pulley_bore(pulley));
|
screw = find_screw(hs_cs_cap, pulley_bore(pulley));
|
||||||
insert = screw_insert(screw);
|
insert = screw_insert(screw);
|
||||||
|
|
||||||
rotate([0, flip ? 180 : 0, 0]) {
|
hflip(flip) {
|
||||||
pulley_assembly(pulley);
|
pulley_assembly(pulley);
|
||||||
translate_z(pulley_height(pulley) + pulley_offset(pulley) + screw_head_depth(screw, pulley_bore(pulley)))
|
translate_z(pulley_height(pulley) + pulley_offset(pulley) + screw_head_depth(screw, pulley_bore(pulley)))
|
||||||
screw(screw, 20);
|
screw(screw, 20);
|
||||||
|
@ -39,8 +39,8 @@ function r2sides4n(r) = floor((r2sides(r) + 3) / 4) * 4;
|
|||||||
function limit(x, min, max) = max(min(x, max), min); //! Force x in range min <= x <= max
|
function limit(x, min, max) = max(min(x, max), min); //! Force x in range min <= x <= max
|
||||||
|
|
||||||
module translate_z(z) translate([0, 0, z]) children(); //! Shortcut for Z only translations
|
module translate_z(z) translate([0, 0, z]) children(); //! Shortcut for Z only translations
|
||||||
module vflip() rotate([180, 0, 0]) children(); //! Invert children by doing a 180° flip around the X axis
|
module vflip(flip=true) rotate([flip ? 180 : 0, 0, 0]) children(); //! Invert children by doing a 180° flip around the X axis
|
||||||
module hflip() rotate([0, 180, 0]) children(); //! Invert children by doing a 180° flip around the Y axis
|
module hflip(flip=true) rotate([0, flip ? 180: 0, 0]) children(); //! Invert children by doing a 180° flip around the Y axis
|
||||||
module ellipse(xr, yr) scale([1, yr / xr]) circle4n(xr); //! Draw an ellipse
|
module ellipse(xr, yr) scale([1, yr / xr]) circle4n(xr); //! Draw an ellipse
|
||||||
|
|
||||||
function slice_str(str, start, end, s ="") = start >= end ? s : slice_str(str, start + 1, end, str(s, str[start])); // Helper for slice()
|
function slice_str(str, start, end, s ="") = start >= end ? s : slice_str(str, start + 1, end, str(s, str[start])); // Helper for slice()
|
||||||
|
Loading…
Reference in New Issue
Block a user