summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile4
-rw-r--r--another.scad37
2 files changed, 35 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 5753a68..b9d2b4c 100644
--- a/Makefile
+++ b/Makefile
@@ -5,30 +5,32 @@ OPENSCAD_BIN?=${OPENSCAD_APP}/Contents/MacOS/OpenSCAD
5OPENSCAD_FLAGS=-D draft=false -D debug=false 5OPENSCAD_FLAGS=-D draft=false -D debug=false
6SED?=sed 6SED?=sed
7ECHO?=/bin/echo 7ECHO?=/bin/echo
8AWK?=awk 8AWK?=awk
9 9
10default: 10default:
11 @echo "And?" 11 @echo "And?"
12 12
13clean: 13clean:
14 rm -f *.stl *.gcode 14 rm -f *.stl *.gcode
15 15
16stl-another-%: 16stl-another-%:
17 $(MAKE) another-$*-{body,body-label,lever,knob,knob-label,springpad}.stl 17 $(MAKE) another-$*-{body,body-label,body-scale,lever,knob,knob-label,springpad}.stl
18 18
19another-%-body.stl: another-%.scad another.scad 19another-%-body.stl: another-%.scad another.scad
20 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body"' -o "$@" "$<" 20 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body"' -o "$@" "$<"
21another-%-body-label.stl: another-%.scad another.scad 21another-%-body-label.stl: another-%.scad another.scad
22 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body.label"' -o "$@" "$<" 22 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body.label"' -o "$@" "$<"
23another-%-body-scale.stl: another-%.scad another.scad
24 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body.scale"' -o "$@" "$<"
23another-%-lever.stl: another-%.scad another.scad 25another-%-lever.stl: another-%.scad another.scad
24 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="lever"' -o "$@" "$<" 26 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="lever"' -o "$@" "$<"
25another-%-knob.stl: another-%.scad another.scad 27another-%-knob.stl: another-%.scad another.scad
26 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob"' -o "$@" "$<" 28 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob"' -o "$@" "$<"
27another-%-knob-label.stl: another-%.scad another.scad 29another-%-knob-label.stl: another-%.scad another.scad
28 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob.label"' -o "$@" "$<" 30 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob.label"' -o "$@" "$<"
29another-%-springpad.stl: another-%.scad another.scad 31another-%-springpad.stl: another-%.scad another.scad
30 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="springpad"' -o "$@" "$<" 32 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="springpad"' -o "$@" "$<"
31 33
32multiswitch: multiswitch.c8r.scad $(addsuffix .stl,$(addprefix multiswitch-embeddest-,2 3 4 5 6)) 34multiswitch: multiswitch.c8r.scad $(addsuffix .stl,$(addprefix multiswitch-embeddest-,2 3 4 5 6))
33multiswitch-embeddest-%.stl: multiswitch-embeddest.scad 35multiswitch-embeddest-%.stl: multiswitch-embeddest.scad
34 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D inputs=$* -o "$@" "$<" 36 $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D inputs=$* -o "$@" "$<"
diff --git a/another.scad b/another.scad
index fd73a61..83a4e43 100644
--- a/another.scad
+++ b/another.scad
@@ -364,59 +364,83 @@ module the_extruder(
364 cube(size=[body_h-ls_z-sp_ch-st_split_w_tolerance,st_split_w+st_split_w_tolerance,fsw+1]); 364 cube(size=[body_h-ls_z-sp_ch-st_split_w_tolerance,st_split_w+st_split_w_tolerance,fsw+1]);
365 translate([0,0,sp_ch+st_split_w_tolerance+1]) 365 translate([0,0,sp_ch+st_split_w_tolerance+1])
366 cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]); 366 cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]);
367 } 367 }
368 }//translate 368 }//translate
369 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) 369 translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon])
370 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); 370 cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd);
371 }//mirror 371 }//mirror
372 }//translate 372 }//translate
373 373
374 // label 374 // label
375 body_label(); 375 body_label();
376 // scale
377 body_scale();
376 378
377 }//difference 379 }//difference
378 380
379 }//body module 381 }//body module
382 module body_scale() {
383 scale_thickness = 2*layer_height;
384 nscales = 5;
385 x1 = -gearbox_d/2+fsw-st_h+st_w+st_bump*2-st_bump_tip/2;
386 x0 = -gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+st_split_w+st_split_w_tolerance+st_bump_tip/2;
387 w0 = st_split_w+st_split_w_tolerance+2*(extrusion_width+2*extrusion_width);
388 w1 = 2*(longwing-gearbox_d/2-extrusion_width);
389 translate([0,-longwing,body_h-scale_thickness])
390 difference() {
391 for(x=[x0:(x1-x0)/(nscales-1):x1]) let(w=w0+(w1-w0)*(x-x0)/(x1-x0))
392 translate([x-st_bump_tip/2,-w/2,0])
393 cube(size=[st_bump_tip,w,scale_thickness+epsilon]);
394 let(w=st_split_w+st_split_w_tolerance+extrusion_width)
395 translate([-gearbox_d/2,-w/2,-1])
396 cube(size=[fsw,w,scale_thickness+2]);
397 }
398 }
380 module body_label() { 399 module body_label() {
381 if(body_label) { 400 if(body_label) {
382 label=body_label; 401 label=body_label;
383 label_thickness=body_label_thickness; 402 label_thickness=body_label_thickness;
384 label_len = len(label); 403 label_len = len(label);
385 labelspace = [gearbox_d/2-mount_screwhead_d/2-min_xy_shell,longwing-(mount_screwhead_d-st_split_w-st_split_w_tolerance)/2-2*min_xy_shell]; 404 labelspace = [gearbox_d/2-mount_screwhead_d/2-min_xy_shell,longwing-(mount_screwhead_d-st_split_w-st_split_w_tolerance)/2-2*min_xy_shell];
386 translate([0,0,body_h-label_thickness]) 405 translate([0,0,body_h-label_thickness])
387 linear_extrude(height=label_thickness+epsilon,convexity=64) 406 linear_extrude(height=label_thickness+epsilon,convexity=64)
388 translate([-mount_screwhead_d/2-min_xy_shell-labelspace.x/2,-longwing+(st_split_w+st_split_w_tolerance)/2+min_xy_shell+labelspace.y/2]) 407 translate([-mount_screwhead_d/2-min_xy_shell-labelspace.x/2,-longwing+(st_split_w+st_split_w_tolerance)/2+min_xy_shell+labelspace.y/2])
389 mirror([left?0:1,0]) 408 mirror([left?0:1,0])
390 text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black"); 409 text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black");
391 }else sphere(d=epsilon); // to avoid makefile breakage 410 }else sphere(d=epsilon); // to avoid makefile breakage
392 } 411 }
393 412
394 st_bump = 4*extrusion_width; 413 st_bump = 4*extrusion_width;
395 st_bump_tip = 2*extrusion_width; 414 st_bump_tip = 2*extrusion_width;
415 st_smalld = st_screw_d+st_screw_d_tolerance+min_xy_shell;
416 st_bigd = spring_d+spring_d_clearance/2;
417 st_hf = (st_bigd-st_smalld)/2;
418 st_h = max(st_hf*3,fsw-st_screw_l+st_hf);
419 st_w = sp_ch;
396 module springpad() { 420 module springpad() {
397 smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell; 421 smalld=st_smalld;
398 bigd = spring_d+spring_d_clearance/2; 422 bigd = st_bigd;
399 hf = (bigd-smalld)/2; 423 hf = st_hf;
400 h = max(hf*3,fsw-st_screw_l+hf); 424 h = st_h;
401 translate([-gearbox_d/2+fsw-h,-longwing,filament_elevation]) 425 translate([-gearbox_d/2+fsw-h,-longwing,filament_elevation])
402 rotate([0,90,0]) difference() { 426 rotate([0,90,0]) difference() {
403 union() { 427 union() {
404 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); 428 cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd);
405 translate([0,0,hf-epsilon]) 429 translate([0,0,hf-epsilon])
406 cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); 430 cylinder(d=bigd,h=h-hf,$fn=fnd*bigd);
407 translate([0,0,h]) 431 translate([0,0,h])
408 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4); 432 sphere(d=spring_d*3/4,$fn=fnd*spring_d*3/4);
409 l = body_h-ls_z; 433 l = body_h-ls_z;
410 w = sp_ch; 434 w = st_w;
411 translate([0,-st_split_w/2,0]) mirror([1,0,0]) { 435 translate([0,-st_split_w/2,0]) mirror([1,0,0]) {
412 hull() { 436 hull() {
413 translate([0,0,w+st_bump]) 437 translate([0,0,w+st_bump])
414 cube(size=[l+st_bump,st_split_w,w]); 438 cube(size=[l+st_bump,st_split_w,w]);
415 cube(size=[l-w,st_split_w,2*w]); 439 cube(size=[l-w,st_split_w,2*w]);
416 } 440 }
417 translate([l,0,w+st_bump]) hull() { 441 translate([l,0,w+st_bump]) hull() {
418 cube(size=[st_split_w,st_split_w,st_bump]); 442 cube(size=[st_split_w,st_split_w,st_bump]);
419 translate([0,-st_bump+st_bump_tip,st_bump]) mirror([0,0,1]) 443 translate([0,-st_bump+st_bump_tip,st_bump]) mirror([0,0,1])
420 cube(size=[st_split_w,st_split_w+2*(st_bump-st_bump_tip),st_bump_tip]); 444 cube(size=[st_split_w,st_split_w+2*(st_bump-st_bump_tip),st_bump_tip]);
421 } 445 }
422 } 446 }
@@ -489,30 +513,33 @@ module the_extruder(
489 place_idler() 513 place_idler()
490 translate([-idler_d/2+filament_offset,0,ls_z]) 514 translate([-idler_d/2+filament_offset,0,ls_z])
491 cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]); 515 cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]);
492 }//if debug 516 }//if debug
493 }//difference 517 }//difference
494 } 518 }
495 519
496 mirrorleft() 520 mirrorleft()
497 debug() 521 debug()
498 if(what=="lever") color("green",0.7) lever(); 522 if(what=="lever") color("green",0.7) lever();
499 else if(what=="body") color("yellow",0.7) body(); 523 else if(what=="body") color("yellow",0.7) body();
500 else if(what=="body.label") color("brown",0.7) body_label(); 524 else if(what=="body.label") color("brown",0.7) body_label();
525 else if(what=="body.scale") color("brown",0.7) body_scale();
501 else if(what=="knob") color("red",0.7) knob(); 526 else if(what=="knob") color("red",0.7) knob();
502 else if(what=="knob.label") color("brown",0.7) knob_label(); 527 else if(what=="knob.label") color("brown",0.7) knob_label();
503 else if(what=="springpad") color("blue",0.7) springpad(); 528 else if(what=="springpad") color("blue",0.7) springpad();
504 else if(what=="both") { 529 else if(what=="both") {
505 color("green",0.7) lever(); 530 color("green",0.7) lever();
506 color("yellow",0.7) body(); 531 color("yellow",0.7) body();
507 color("brown",0.7) body_label(); 532 color("brown",0.7) body_label();
533 color("brown",0.7) body_scale();
508 }else{ 534 }else{
509 color("green",0.7) lever(); 535 color("green",0.7) lever();
510 color("yellow",0.7) body(); 536 color("yellow",0.7) body();
511 color("brown",0.7) body_label(); 537 color("brown",0.7) body_label();
538 color("brown",0.7) body_scale();
512 color("red",0.7) knob(); 539 color("red",0.7) knob();
513 color("brown",0.7) knob_label(); 540 color("brown",0.7) knob_label();
514 color("blue",0.7) springpad(); 541 color("blue",0.7) springpad();
515 } 542 }
516} 543}
517 544
518the_extruder(what="*",left=false,debug=true); 545the_extruder(what="*",left=false,debug=true);