From 3053d27bb2343f00d2ef6b92dc6c78f94f3b4072 Mon Sep 17 00:00:00 2001 From: chaos Date: Sat, 30 Sep 2023 14:59:01 +0100 Subject: [PATCH] Add vial-holder --- vial-holder.scad | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 vial-holder.scad diff --git a/vial-holder.scad b/vial-holder.scad new file mode 100644 index 0000000..9e2c2fa --- /dev/null +++ b/vial-holder.scad @@ -0,0 +1,35 @@ +/* +My vials: +2" high inc cap +1 1/2" w/o cap +1/2" diameter +*/ + +// 2540mm = 1 inch +// Change to 1 when working in cm or 10 when working in mm i guess +scaleFactor = 25.4; + + +vialHeight = scaleFactor * (1 + 1/2); +vialDiam = scaleFactor * (1/2); + +// Padding around the vials. +padding = scaleFactor * (1/8); + +// Height / Width on a 1x1 box. +boxHeight = vialHeight + padding; +boxWidth = vialDiam + padding; + +vialRows = 1; +vialColumns = 1; + +for ( vialRow = [0 : vialRows-1] ){ + for ( vialColumn = [0 : vialColumns-1] ){ + translate([vialRow * boxWidth, vialColumn * boxWidth, 0]) { + difference() { + cube ([boxWidth, boxWidth, boxHeight]); + translate ([boxWidth / 2, boxWidth / 2, boxHeight - vialHeight]) cylinder (h = vialHeight, d=vialDiam, $fn=100); + } + } + } +}