From cacbcc6d9cb96257ce98a689f87ced8e1aeb2e8e Mon Sep 17 00:00:00 2001 From: Bob Date: Fri, 1 May 2020 16:11:37 -0400 Subject: [PATCH 1/2] Add common examples I want to keep the primary documentation digestible, but there are a lot of common use-cases that are a little tricky to figure out. I'm going to start adding those to the examples directory --- examples/multimaterial_key_top.scad | 29 ++++++++++++++++ examples/multimaterial_legend.scad | 16 +++++++++ ...single_extruder_multimaterial_legends.scad | 34 +++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 examples/multimaterial_key_top.scad create mode 100644 examples/multimaterial_legend.scad create mode 100644 examples/single_extruder_multimaterial_legends.scad diff --git a/examples/multimaterial_key_top.scad b/examples/multimaterial_key_top.scad new file mode 100644 index 0000000..339bdbb --- /dev/null +++ b/examples/multimaterial_key_top.scad @@ -0,0 +1,29 @@ +include <../includes.scad> + +/* use this file to generate multimaterial models for making keycaps with a + different material for the key top. + + This would be great to use with flexible filament, to make squishy-topped + keys. + + You don't need a multimaterial printer to use these files since it's hard + height cutoff. You could print the bottom, leave the prints on the bed, and + then print the top in a different material. Be careful though! your start + gcode may crash into the prints. +*/ + +depth = 1; +// swap the debug()s to render opposite part +/* debug() */ difference() { // intersection() { + key(); + top_of_key() { + translate([-total_key_width(),-total_key_height(),-$total_depth - depth]) cube([total_key_width()*2, total_key_height()*2, $total_depth]); + } +} + +debug() intersection() { + key(); + top_of_key() { + translate([-total_key_width(),-total_key_height(),-$total_depth - depth]) cube([total_key_width()*2, total_key_height()*2, $total_depth]); + } +} diff --git a/examples/multimaterial_legend.scad b/examples/multimaterial_legend.scad new file mode 100644 index 0000000..d4d131f --- /dev/null +++ b/examples/multimaterial_legend.scad @@ -0,0 +1,16 @@ +include <../includes.scad> + +/* in this example we'll use some openSCAD to generate files for printing inset + legends with a multimaterial printer. +*/ + +legends = ["F1", "1", "q", "a", "z", ""]; +for (x = [0:1:4]) { + translate_u(0,-x) legend(legends[x]) dcs_row(x, 0) { + // swap the debug()s to render opposite part + debug() key(true); + /* debug() */ dished() { + legends($inset_legend_depth); + } + } +} diff --git a/examples/single_extruder_multimaterial_legends.scad b/examples/single_extruder_multimaterial_legends.scad new file mode 100644 index 0000000..7a7dacd --- /dev/null +++ b/examples/single_extruder_multimaterial_legends.scad @@ -0,0 +1,34 @@ +include <../includes.scad> + +/* Don't have a multimaterial printer but still want cool "doubleshot" legends? + with a couple tricks, you can! We just have to print upside down with no + dish. + + Here's how to use this file: + + 1. modify it as you see fit + 2. render the legends and the keycaps separately + 3. run the legends through your 3d printer. make sure they are a single layer + 4. LEAVE THEM on the bed + 5. change filaments + 6. run the keycaps over the legends. MAKE SURE they line up! PrusaSlicer + centers models on the bed + 7. voila! + 8. use a powder-coated bed for extra points +*/ + +legends = ["F1", "1", "q", "a", "z", ""]; +for (x = [0:1:4]) { + translate_u(0,-x) dcs_row(x, 0) upside_down() legend(legends[x]) { + $dish_type = "disable"; + $inset_legend_depth = 0.2; // whatever layer height you use + + union() { + // swap the debug()s to render opposite part + debug() key(true); + /* debug() */ dished() { + legends($inset_legend_depth); + } + } + } +} From 30e82fc4427980deb5eb9c205c48ae657c0daa49 Mon Sep 17 00:00:00 2001 From: Bob Date: Fri, 1 May 2020 16:11:37 -0400 Subject: [PATCH 2/2] Add common examples I want to keep the primary documentation digestible, but there are a lot of common use-cases that are a little tricky to figure out. I'm going to start adding those to the examples directory --- examples/multimaterial_key_top.scad | 29 ++++++++++++++++ examples/multimaterial_legend.scad | 16 +++++++++ ...single_extruder_multimaterial_legends.scad | 34 +++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 examples/multimaterial_key_top.scad create mode 100644 examples/multimaterial_legend.scad create mode 100644 examples/single_extruder_multimaterial_legends.scad diff --git a/examples/multimaterial_key_top.scad b/examples/multimaterial_key_top.scad new file mode 100644 index 0000000..339bdbb --- /dev/null +++ b/examples/multimaterial_key_top.scad @@ -0,0 +1,29 @@ +include <../includes.scad> + +/* use this file to generate multimaterial models for making keycaps with a + different material for the key top. + + This would be great to use with flexible filament, to make squishy-topped + keys. + + You don't need a multimaterial printer to use these files since it's hard + height cutoff. You could print the bottom, leave the prints on the bed, and + then print the top in a different material. Be careful though! your start + gcode may crash into the prints. +*/ + +depth = 1; +// swap the debug()s to render opposite part +/* debug() */ difference() { // intersection() { + key(); + top_of_key() { + translate([-total_key_width(),-total_key_height(),-$total_depth - depth]) cube([total_key_width()*2, total_key_height()*2, $total_depth]); + } +} + +debug() intersection() { + key(); + top_of_key() { + translate([-total_key_width(),-total_key_height(),-$total_depth - depth]) cube([total_key_width()*2, total_key_height()*2, $total_depth]); + } +} diff --git a/examples/multimaterial_legend.scad b/examples/multimaterial_legend.scad new file mode 100644 index 0000000..d4d131f --- /dev/null +++ b/examples/multimaterial_legend.scad @@ -0,0 +1,16 @@ +include <../includes.scad> + +/* in this example we'll use some openSCAD to generate files for printing inset + legends with a multimaterial printer. +*/ + +legends = ["F1", "1", "q", "a", "z", ""]; +for (x = [0:1:4]) { + translate_u(0,-x) legend(legends[x]) dcs_row(x, 0) { + // swap the debug()s to render opposite part + debug() key(true); + /* debug() */ dished() { + legends($inset_legend_depth); + } + } +} diff --git a/examples/single_extruder_multimaterial_legends.scad b/examples/single_extruder_multimaterial_legends.scad new file mode 100644 index 0000000..7a7dacd --- /dev/null +++ b/examples/single_extruder_multimaterial_legends.scad @@ -0,0 +1,34 @@ +include <../includes.scad> + +/* Don't have a multimaterial printer but still want cool "doubleshot" legends? + with a couple tricks, you can! We just have to print upside down with no + dish. + + Here's how to use this file: + + 1. modify it as you see fit + 2. render the legends and the keycaps separately + 3. run the legends through your 3d printer. make sure they are a single layer + 4. LEAVE THEM on the bed + 5. change filaments + 6. run the keycaps over the legends. MAKE SURE they line up! PrusaSlicer + centers models on the bed + 7. voila! + 8. use a powder-coated bed for extra points +*/ + +legends = ["F1", "1", "q", "a", "z", ""]; +for (x = [0:1:4]) { + translate_u(0,-x) dcs_row(x, 0) upside_down() legend(legends[x]) { + $dish_type = "disable"; + $inset_legend_depth = 0.2; // whatever layer height you use + + union() { + // swap the debug()s to render opposite part + debug() key(true); + /* debug() */ dished() { + legends($inset_legend_depth); + } + } + } +}