author | Michael Krelin <hacker@klever.net> | 2018-08-31 22:28:17 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2018-08-31 22:28:17 (UTC) |
commit | 1204538201ab6005f99507a511ffc17050194c8e (patch) (unidiff) | |
tree | 0a9b2a99252714f2cfafbf97e87b8b0e0700bcd8 | |
parent | 875ceca4d231a22423c42d44d8d14e02d3b4ef37 (diff) | |
download | extrudery-1204538201ab6005f99507a511ffc17050194c8e.zip extrudery-1204538201ab6005f99507a511ffc17050194c8e.tar.gz extrudery-1204538201ab6005f99507a511ffc17050194c8e.tar.bz2 |
body label as a separate STL
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | another.scad | 26 |
2 files changed, 19 insertions, 11 deletions
@@ -5,28 +5,30 @@ 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,lever,knob,springpad}.stl | 17 | $(MAKE) another-$*-{body,body-label,lever,knob,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 | ||
22 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="body.label"' -o "$@" "$<" | ||
21 | another-%-lever.stl: another-%.scad another.scad | 23 | another-%-lever.stl: another-%.scad another.scad |
22 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="lever"' -o "$@" "$<" | 24 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="lever"' -o "$@" "$<" |
23 | another-%-knob.stl: another-%.scad another.scad | 25 | another-%-knob.stl: another-%.scad another.scad |
24 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob"' -o "$@" "$<" | 26 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="knob"' -o "$@" "$<" |
25 | another-%-springpad.stl: another-%.scad another.scad | 27 | another-%-springpad.stl: another-%.scad another.scad |
26 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="springpad"' -o "$@" "$<" | 28 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D 'what="springpad"' -o "$@" "$<" |
27 | 29 | ||
28 | multiswitch: multiswitch.c8r.scad $(addsuffix .stl,$(addprefix multiswitch-embeddest-,2 3 4 5 6)) | 30 | multiswitch: multiswitch.c8r.scad $(addsuffix .stl,$(addprefix multiswitch-embeddest-,2 3 4 5 6)) |
29 | multiswitch-embeddest-%.stl: multiswitch-embeddest.scad | 31 | multiswitch-embeddest-%.stl: multiswitch-embeddest.scad |
30 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D inputs=$* -o "$@" "$<" | 32 | $(OPENSCAD_BIN) $(OPENSCAD_FLAGS) -D inputs=$* -o "$@" "$<" |
31 | 33 | ||
32 | multiswitch.c8r.scad: multiswitch-c8r.scad threads.scad pushfit_data.scad pushfittery.scad multiswitch.scad | 34 | multiswitch.c8r.scad: multiswitch-c8r.scad threads.scad pushfit_data.scad pushfittery.scad multiswitch.scad |
diff --git a/another.scad b/another.scad index f01e765..3955e49 100644 --- a/another.scad +++ b/another.scad | |||
@@ -352,38 +352,42 @@ module the_extruder( | |||
352 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) { | 352 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell-epsilon]) { |
353 | cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, | 353 | cylinder(d1=st_screw_d+st_screw_d_tolerance,d2=bigd, |
354 | h=hf+epsilon, $fn=fnd*bigd); | 354 | h=hf+epsilon, $fn=fnd*bigd); |
355 | translate([0,-(st_split_w+st_split_w_tolerance)/2,0]) | 355 | translate([0,-(st_split_w+st_split_w_tolerance)/2,0]) |
356 | cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]); | 356 | cube(size=[body_h-ls_z+1,st_split_w+st_split_w_tolerance,fsw+1]); |
357 | }//translate | 357 | }//translate |
358 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) | 358 | translate([0,0,st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+hf-epsilon]) |
359 | cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); | 359 | cylinder(d=bigd,h=fsw+1,$fn=fnd*bigd); |
360 | }//mirror | 360 | }//mirror |
361 | }//translate | 361 | }//translate |
362 | 362 | ||
363 | // label | 363 | // label |
364 | if(body_label) let(label=body_label,label_thickness=body_label_thickness) { | 364 | body_label(); |
365 | label_thickness = 2*layer_height; | ||
366 | label_len = len(label); | ||
367 | 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]; | ||
368 | translate([0,0,body_h-label_thickness]) | ||
369 | linear_extrude(height=label_thickness+epsilon,convexity=64) | ||
370 | 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]) | ||
371 | mirror([left?0:1,0]) | ||
372 | text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black"); | ||
373 | }//if(body_label) | ||
374 | 365 | ||
375 | }//difference | 366 | }//difference |
376 | 367 | ||
377 | }//body module | 368 | }//body module |
369 | module body_label() { | ||
370 | if(body_label) { | ||
371 | label=body_label; | ||
372 | label_thickness=body_label_thickness; | ||
373 | label_len = len(label); | ||
374 | 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]; | ||
375 | translate([0,0,body_h-label_thickness]) | ||
376 | linear_extrude(height=label_thickness+epsilon,convexity=64) | ||
377 | 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]) | ||
378 | mirror([left?0:1,0]) | ||
379 | text(text=label,size=labelspace.x/label_len,halign="center",valign="center",font="Arial Black"); | ||
380 | }//if(body_label) | ||
381 | } | ||
378 | 382 | ||
379 | module springpad() { | 383 | module springpad() { |
380 | smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell; | 384 | smalld=st_screw_d+st_screw_d_tolerance+min_xy_shell; |
381 | bigd = spring_d+spring_d_clearance/2; | 385 | bigd = spring_d+spring_d_clearance/2; |
382 | hf = (bigd-smalld)/2; | 386 | hf = (bigd-smalld)/2; |
383 | h = hf*3.5; | 387 | h = hf*3.5; |
384 | translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) | 388 | translate([-gearbox_d/2+st_thickshell+st_nut_h+st_nut_h_tolerance+st_thinshell+1,-longwing,filament_elevation]) |
385 | rotate([0,90,0]) difference() { | 389 | rotate([0,90,0]) difference() { |
386 | union() { | 390 | union() { |
387 | cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); | 391 | cylinder(d1=smalld,d2=bigd,h=hf,$fn=fnd*bigd); |
388 | translate([0,0,hf-epsilon]) | 392 | translate([0,0,hf-epsilon]) |
389 | cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); | 393 | cylinder(d=bigd,h=h-hf,$fn=fnd*bigd); |
@@ -452,26 +456,28 @@ module the_extruder( | |||
452 | // pushfit debug cutout | 456 | // pushfit debug cutout |
453 | place_idler() | 457 | place_idler() |
454 | translate([-idler_d/2+filament_offset,0,ls_z]) | 458 | translate([-idler_d/2+filament_offset,0,ls_z]) |
455 | cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]); | 459 | cube(size=[gearbox_d/2,gearbox_d/2+pf_h(pf),body_h-ls_z+knob_h+1]); |
456 | }//if debug | 460 | }//if debug |
457 | }//difference | 461 | }//difference |
458 | } | 462 | } |
459 | 463 | ||
460 | mirrorleft() | 464 | mirrorleft() |
461 | debug() | 465 | debug() |
462 | if(what=="lever") color("green",0.7) lever(); | 466 | if(what=="lever") color("green",0.7) lever(); |
463 | else if(what=="body") color("yellow",0.7) body(); | 467 | else if(what=="body") color("yellow",0.7) body(); |
468 | else if(what=="body.label") color("brown",0.7) body_label(); | ||
464 | else if(what=="knob") color("red",0.7) knob(); | 469 | else if(what=="knob") color("red",0.7) knob(); |
465 | else if(what=="springpad") color("blue",0.7) springpad(); | 470 | else if(what=="springpad") color("blue",0.7) springpad(); |
466 | else if(what=="both") { | 471 | else if(what=="both") { |
467 | color("green",0.7) lever(); | 472 | color("green",0.7) lever(); |
468 | color("yellow",0.7) body(); | 473 | color("yellow",0.7) body(); |
474 | color("brown",0.7) body_label(); | ||
469 | }else{ | 475 | }else{ |
470 | color("green",0.7) lever(); | 476 | color("green",0.7) lever(); |
471 | color("yellow",0.7) body(); | 477 | color("yellow",0.7) body(); |
472 | color("red",0.7) knob(); | 478 | color("red",0.7) knob(); |
473 | color("blue",0.7) springpad(); | 479 | color("blue",0.7) springpad(); |
474 | } | 480 | } |
475 | } | 481 | } |
476 | 482 | ||
477 | the_extruder(what="*",left=false,debug=true); | 483 | the_extruder(what="*",left=false,debug=true); |