From 6201f7346eed8bd9db361b6c11b528fd36b338a7 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 27 Oct 2021 00:12:38 -0400 Subject: nothing significant --- cubbies.scad | 72 +++++++++++++++++++++++++++++------------------------------ shopenscad.sh | 10 ++++----- 2 files changed, 40 insertions(+), 42 deletions(-) diff --git a/cubbies.scad b/cubbies.scad index 0531a7f..88740be 100644 --- a/cubbies.scad +++ b/cubbies.scad @@ -5,7 +5,7 @@ include ; $fn=100; -part="side test fit"; // [both:Bottom + Side,bottom::Bottom Only,side:Side Only,view_fit:Debugging view to confirm tab fit,bottom_tabs:Tabs only from bottom,side_tabs:Holes only from side] +part="both"; // [both:Bottom + Side,bottom::Bottom Only,side:Side Only,view_fit:Debugging view to confirm tab fit,male_tabs:Tabs only from bottom,female_tabs:Holes only from side] /* [Cubby dimensions] */ cubby_width=150; @@ -28,13 +28,6 @@ tab_width=10; tab_padding=5; // minimum material between tabs tab_tolerance=0.5; -/* [Used only in tab fit tests] */ -// Smallest tolerance -//tolerance_start=0.5; -// Largest tolerance -//tolerance_end=1.0; -// Steps to increment from smallest to largest tolerance -//tolerance_step=0.1; /* [Screw Tabs] */ screw_tabs=true; @@ -43,9 +36,8 @@ tab_depth=thickness; tab_height=thickness; /* text inscribed (when printing tolerances) */ -text_extrude=2; -text_size=thickness * 0.8; - +text_inscription_depth=0.2; +text_size=thickness * 0.6; if ( part == "both" ) { both(); @@ -55,10 +47,10 @@ if ( part == "both" ) { cubby_side(cubby_depth, cubby_height, screw_tabs); } else if ( part == "view_fit") { view_tab_fit(cubby_width, cubby_depth, cubby_height); -} else if ( part == "bottom_tabs" ) { - bottom_test_fit(cubby_width, cubby_depth); -} else if ( part == "side_tabs" ) { - side_test_fit(cubby_depth, cubby_height); +} else if ( part == "male_tabs" ) { + male_tabs(cubby_width, cubby_depth); +} else if ( part == "female_tabs" ) { + female_tabs(cubby_depth, cubby_height); } function double (x) = x * 2; @@ -69,6 +61,7 @@ module both () { cubby_bottom(cubby_width, cubby_depth); left(((cubby_width + cubby_height) / 2) + (tab_height * 2) + gap) cubby_side(cubby_depth, cubby_height, screw_tabs); +} module cubby_bottom (width, depth) { rot(90) yrot(90) color("blue") bottom_wall() yrot(90) down(tab_height / 2) { @@ -110,8 +103,10 @@ module cubby_side (depth, height, screw_tabs=true) { module tab_bracket () { difference() { cuboid([depth,thickness,cubby_side_bracket_height()]); - alternating_tabs(true, "female", depth, tab_width, tab_depth, tab_height, tab_padding, tab_tolerance); - alternating_tabs(false, "female", depth, tab_width, tab_depth, tab_height, tab_padding, tab_tolerance); + alternating_tabs(true, "female", depth, tab_width, tab_depth, + tab_height, tab_padding, tab_tolerance); + alternating_tabs(false, "female", depth, tab_width, tab_depth, + tab_height, tab_padding, tab_tolerance); } children(); } @@ -142,31 +137,30 @@ module strut_wall(w, h) { ) children(); } -module bottom_test_fit (w, d) { - keep=(w / 2) - thickness; - //right_half(x=keep) cubby_bottom(cubby_width, cubby_depth); - +module male_tabs (w, d) { text=str("t=", tab_tolerance); - text_pos=[(-w / 2) + (thickness * 0.9), + text_pos=[(-w / 2) + (thickness * 0.8), -d / 2 + thickness, - (thickness / 2) - text_extrude]; - + (thickness / 2) - text_inscription_depth]; difference() { - left_half(x=-keep) cubby_bottom(cubby_width, cubby_depth); - #translate(text_pos) zrot(90) linear_extrude(text_extrude) color("green") text(size=text_size, text); + keep=(w / 2) - thickness; + left_half(x=-keep) cubby_bottom(cubby_width, cubby_depth); + #translate(text_pos) zrot(90) + linear_extrude(text_inscription_depth) + color("green") text(size=text_size, text); } } -module side_test_fit (d, h) { +module female_tabs (d, h) { text=str("t=", tab_tolerance); - text_pos=[-h/2 + (thickness * 0.9), + text_pos=[-h/2 + (thickness * 0.8), -d / 2 + thickness, - (thickness / 2) - text_extrude]; - + (thickness / 2) - text_inscription_depth]; difference() { - left_half(x=(h / -2 + (thickness * 3))) - cubby_side(d, h, screw_tabs=false); - #translate(text_pos) zrot(90) linear_extrude(text_extrude) color("green") text(size=text_size, text); + xrot(180) left_half(x=(h / -2 + (thickness * 3))) + cubby_side(d, h, screw_tabs=false); + #translate(text_pos) zrot(90) linear_extrude(text_inscription_depth) + color("green") text(size=text_size, text); } } @@ -175,8 +169,10 @@ module view_tab_fit (w, d, h) { module position_fit_test (left=true) { cubby_bottom(w, d); dist=(w / 2) + (thickness / -2) + tab_depth - 2; - down=half(h) - half(thickness) - tab_height - half(tab_tolerance); - yflip() yrot(90) down(dist * (left ? 1 : -1)) left(down) cubby_side(d, h, screw_tabs); + down=half(h) - half(thickness) - + tab_height - half(tab_tolerance); + yflip() yrot(90) down(dist * (left ? 1 : -1)) left(down) + cubby_side(d, h, screw_tabs); } position_fit_test(left=true); @@ -187,11 +183,13 @@ module alternating_tabs ( first, gender, length, tab_width, tab_depth, tab_heigh dist=length - (tab_padding * 2); total_tabs=dist / (tab_width + tab_padding + tolerance); half_tabs=total_tabs / 2; - tab_qty = total_tabs % 2 == 0 ? half_tabs : first ? ceil(half_tabs) : floor(half_tabs); + tab_qty = total_tabs % 2 == 0 ? half_tabs : first ? + ceil(half_tabs) : floor(half_tabs); start = first ? tab_padding : (tab_padding * 2) + tab_width; spacing = (tab_width + tab_padding) * 2; xcopies(spacing, tab_qty, dist, sp=((dist / -2) + start)) - #dovetail(gender, angle=0, slide=add_tol(tab_depth), width=add_tol(tab_width), height=add_tol(tab_height)); + #dovetail(gender, angle=0, slide=add_tol(tab_depth), + width=add_tol(tab_width), height=add_tol(tab_height)); function add_tol (x) = gender == "male" ? x : x + tolerance; } diff --git a/shopenscad.sh b/shopenscad.sh index 996d405..075290d 100755 --- a/shopenscad.sh +++ b/shopenscad.sh @@ -117,7 +117,7 @@ output_params="" default_output_filename="" all="" values_only="" -val_sep="=" +val_sep="-" var_sep="," declare -A scad @@ -139,7 +139,7 @@ while IFS= read -r line; do scad[$var]="$val" output_params+="-D '$var=$val' " values_only+="$(val_to_filename "$val")${val_sep}" - all+="${var}${val_sep}$(val_to_filename "$val")${var_sep}" + all+="${var}=$(val_to_filename "$val")${var_sep}" fi; done < <(echo "$(cat "$scad_file")" | strip_comments |strip_after_hidden |strip_nonassignments |strip_trailing_semicolon) @@ -152,7 +152,7 @@ if $print_vars; then done; echo fi -all=$(strip_trailing "$val_sep" "$all") +#all=$(strip_trailing "$val_sep" "$all") values_only=$(strip_trailing "$val_sep" "$values_only") default_output_filename="$(strip_trailing "-" "${values_only}").stl" @@ -180,5 +180,5 @@ if $interactive; then *) run=false ;; esac fi -#sed -nel <<< "$openscad_str" -$run && eval "$openscad_str" + +$run && eval "$(echo "$openscad_str")" -- cgit v1.2.3