-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | another.scad | 1 |
2 files changed, 4 insertions, 1 deletions
@@ -1,42 +1,44 @@ | |||
1 | -include Makefile.local | 1 | -include Makefile.local |
2 | 2 | ||
3 | OPENSCAD_APP?=/Applications/OpenSCAD.app | 3 | OPENSCAD_APP?=/Applications/OpenSCAD.app |
4 | OPENSCAD_BIN?=${OPENSCAD_APP}/Contents/MacOS/OpenSCAD | 4 | OPENSCAD_BIN?=${OPENSCAD_APP}/Contents/MacOS/OpenSCAD |
5 | OPENSCAD_FLAGS=-D draft=false -D debug=false | 5 | OPENSCAD_FLAGS=-D draft=false -D debug=false |
6 | SED?=sed | 6 | SED?=sed |
7 | ECHO?=/bin/echo | 7 | ECHO?=/bin/echo |
8 | AWK?=awk | 8 | AWK?=awk |
9 | 9 | ||
10 | default: | 10 | default: |
11 | @echo "And?" | 11 | @echo "And?" |
12 | 12 | ||
13 | clean: | 13 | clean: |
14 | rm -f *.stl *.gcode | 14 | rm -f *.stl *.gcode |
15 | 15 | ||
16 | stl-another-%: | 16 | stl-another-%: |
17 | $(MAKE) another-$*-{body,body-label,lever,knob,springpad}.stl | 17 | $(MAKE) another-$*-{body,body-label,lever,knob,knob-label,springpad}.stl |
18 | 18 | ||
19 | another-%-body.stl: another-%.scad another.scad | 19 | another-%-body.stl: another-%.scad another.scad |
20 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body"' -o "$@" "$<" | 20 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body"' -o "$@" "$<" |
21 | another-%-body-label.stl: another-%.scad another.scad | 21 | another-%-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 "$@" "$<" |
23 | another-%-lever.stl: another-%.scad another.scad | 23 | another-%-lever.stl: another-%.scad another.scad |
24 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="lever"' -o "$@" "$<" | 24 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="lever"' -o "$@" "$<" |
25 | another-%-knob.stl: another-%.scad another.scad | 25 | another-%-knob.stl: another-%.scad another.scad |
26 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob"' -o "$@" "$<" | 26 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob"' -o "$@" "$<" |
27 | another-%-knob-label.stl: another-%.scad another.scad | ||
28 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob.label"' -o "$@" "$<" | ||
27 | another-%-springpad.stl: another-%.scad another.scad | 29 | another-%-springpad.stl: another-%.scad another.scad |
28 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="springpad"' -o "$@" "$<" | 30 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="springpad"' -o "$@" "$<" |
29 | 31 | ||
30 | multiswitch: multiswitch.c8r.scad $(addsuffix .stl,$(addprefix multiswitch-embeddest-,2 3 4 5 6)) | 32 | multiswitch: multiswitch.c8r.scad $(addsuffix .stl,$(addprefix multiswitch-embeddest-,2 3 4 5 6)) |
31 | multiswitch-embeddest-%.stl: multiswitch-embeddest.scad | 33 | multiswitch-embeddest-%.stl: multiswitch-embeddest.scad |
32 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D inputs=$* -o "$@" "$<" | 34 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D inputs=$* -o "$@" "$<" |
33 | 35 | ||
34 | multiswitch.c8r.scad: multiswitch-c8r.scad threads.scad pushfit_data.scad pushfittery.scad multiswitch.scad | 36 | multiswitch.c8r.scad: multiswitch-c8r.scad threads.scad pushfit_data.scad pushfittery.scad multiswitch.scad |
35 | @echo "Preprocessing into $@…" | 37 | @echo "Preprocessing into $@…" |
36 | @( \ | 38 | @( \ |
37 | $(ECHO) "/* DO NOT. JUST DO NOT. FORGET THIS FILE, IT'S PREPROCESSED, GET THE SOURCE. */" ;\ | 39 | $(ECHO) "/* DO NOT. JUST DO NOT. FORGET THIS FILE, IT'S PREPROCESSED, GET THE SOURCE. */" ;\ |
38 | $(AWK) '/^\/\/CUSTOMIZERCUTOFF/ {nextfile} {print}' $^ | $(SED) -Ee 's,^(use|include),//\1,g' \ | 40 | $(AWK) '/^\/\/CUSTOMIZERCUTOFF/ {nextfile} {print}' $^ | $(SED) -Ee 's,^(use|include),//\1,g' \ |
39 | ) > $@ | 41 | ) > $@ |
40 | 42 | ||
41 | %.stl: %.scad | 43 | %.stl: %.scad |
42 | ${OPENSCAD_BIN} ${OPENSCAD_FLAGS} -o "$@" "$<" | 44 | ${OPENSCAD_BIN} ${OPENSCAD_FLAGS} -o "$@" "$<" |
diff --git a/another.scad b/another.scad index 3c4f27a..1c6d836 100644 --- a/another.scad +++ b/another.scad | |||
@@ -434,64 +434,65 @@ module the_extruder( | |||
434 | } | 434 | } |
435 | } | 435 | } |
436 | }//knob module | 436 | }//knob module |
437 | module knob_label() { | 437 | module knob_label() { |
438 | if(knob_label) { | 438 | if(knob_label) { |
439 | ll = len(knob_label); | 439 | ll = len(knob_label); |
440 | lsl = gearbox_d-knob_indent_d; | 440 | lsl = gearbox_d-knob_indent_d; |
441 | ts = knob_label_size?knob_label_size:min(lsl/ll,gearbox_d/4); | 441 | ts = knob_label_size?knob_label_size:min(lsl/ll,gearbox_d/4); |
442 | translate([0,0,body_h+epsilon+knob_h-knob_label_thickness]) | 442 | translate([0,0,body_h+epsilon+knob_h-knob_label_thickness]) |
443 | linear_extrude(height=knob_label_thickness+epsilon,convexity=64) | 443 | linear_extrude(height=knob_label_thickness+epsilon,convexity=64) |
444 | mirror([left?0:1,0]) | 444 | mirror([left?0:1,0]) |
445 | text(text=knob_label,size=ts,halign="center",valign="center",font="Arial Black"); | 445 | text(text=knob_label,size=ts,halign="center",valign="center",font="Arial Black"); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | 448 | ||
449 | module debug() { | 449 | module debug() { |
450 | difference() { | 450 | difference() { |
451 | children(); | 451 | children(); |
452 | if(debug) { | 452 | if(debug) { |
453 | // spring tensioner debug cutout | 453 | // spring tensioner debug cutout |
454 | translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) | 454 | translate([-gearbox_d/2,-longwing,ls_z]) rotate([0,-90,0]) |
455 | translate([0,-lever_thickness/2-1,-gearbox_d]) | 455 | translate([0,-lever_thickness/2-1,-gearbox_d]) |
456 | cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); | 456 | cube(size=[body_h/2+1,lever_thickness/2+1,gearbox_d+2]); |
457 | // lever axis debug cutout | 457 | // lever axis debug cutout |
458 | translate([mount_d/2,0,-1]) | 458 | translate([mount_d/2,0,-1]) |
459 | rotate([0,0,-45]) | 459 | rotate([0,0,-45]) |
460 | cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); | 460 | cube(size=[gearbox_d-mount_d,gearbox_d-mount_d,body_h+knob_h+2]); |
461 | // idler debug cutout | 461 | // idler debug cutout |
462 | translate([0,0,ls_z]) | 462 | translate([0,0,ls_z]) |
463 | place_idler() | 463 | place_idler() |
464 | rotate([0,0,-45]) | 464 | rotate([0,0,-45]) |
465 | translate([0,0,-lever_thickness/2-epsilon]) | 465 | translate([0,0,-lever_thickness/2-epsilon]) |
466 | cube(size=[lsd*sqrt(2)/2+1,lsd*sqrt(2)/2+1, | 466 | cube(size=[lsd*sqrt(2)/2+1,lsd*sqrt(2)/2+1, |
467 | lever_thickness+2*epsilon]); | 467 | lever_thickness+2*epsilon]); |
468 | // pushfit debug cutout | 468 | // pushfit debug cutout |
469 | place_idler() | 469 | place_idler() |
470 | translate([-idler_d/2+filament_offset,0,ls_z]) | 470 | translate([-idler_d/2+filament_offset,0,ls_z]) |
471 | cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]); | 471 | cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]); |
472 | }//if debug | 472 | }//if debug |
473 | }//difference | 473 | }//difference |
474 | } | 474 | } |
475 | 475 | ||
476 | mirrorleft() | 476 | mirrorleft() |
477 | debug() | 477 | debug() |
478 | if(what=="lever") color("green",0.7) lever(); | 478 | if(what=="lever") color("green",0.7) lever(); |
479 | else if(what=="body") color("yellow",0.7) body(); | 479 | else if(what=="body") color("yellow",0.7) body(); |
480 | else if(what=="body.label") color("brown",0.7) body_label(); | 480 | else if(what=="body.label") color("brown",0.7) body_label(); |
481 | else if(what=="knob") color("red",0.7) knob(); | 481 | else if(what=="knob") color("red",0.7) knob(); |
482 | else if(what=="knob.label") color("brown",0.7) knob_label(); | ||
482 | else if(what=="springpad") color("blue",0.7) springpad(); | 483 | else if(what=="springpad") color("blue",0.7) springpad(); |
483 | else if(what=="both") { | 484 | else if(what=="both") { |
484 | color("green",0.7) lever(); | 485 | color("green",0.7) lever(); |
485 | color("yellow",0.7) body(); | 486 | color("yellow",0.7) body(); |
486 | color("brown",0.7) body_label(); | 487 | color("brown",0.7) body_label(); |
487 | }else{ | 488 | }else{ |
488 | color("green",0.7) lever(); | 489 | color("green",0.7) lever(); |
489 | color("yellow",0.7) body(); | 490 | color("yellow",0.7) body(); |
490 | color("brown",0.7) body_label(); | 491 | color("brown",0.7) body_label(); |
491 | color("red",0.7) knob(); | 492 | color("red",0.7) knob(); |
492 | color("brown",0.7) knob_label(); | 493 | color("brown",0.7) knob_label(); |
493 | color("blue",0.7) springpad(); | 494 | color("blue",0.7) springpad(); |
494 | } | 495 | } |
495 | } | 496 | } |
496 | 497 | ||
497 | the_extruder(what="*",left=false,debug=true); | 498 | the_extruder(what="*",left=false,debug=true); |