From 1092211601c817bed81766ef3246bf52755f6331 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Fri, 1 Nov 2024 17:02:58 +0100 Subject: add dip storage bin --- Makefile | 11 +++++++++++ dip.scad | 30 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 dip.scad diff --git a/Makefile b/Makefile index 874a9b8..72b28a9 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,8 @@ CASE_BASE_SIZES = $(STLDIR)/case_base_2x1.stl $(STLDIR)/case_base_2x2.stl $(STLD $(STLDIR)/case_base_4x4.stl $(STLDIR)/case_base_4x5.stl $(STLDIR)/case_base_4x6.stl \ $(STLDIR)/case_base_5x5.stl +DIP_SIZES = $(STLDIR)/dip_1x1.stl $(STLDIR)/dip_2x1.stl $(STLDIR)/dip_2x2.stl $(STLDIR)/dip_2x3.stl $(STLDIR)/dip_3x3.stl + .PHONY: _default _default: stl @@ -90,6 +92,15 @@ $(STLDIR)/case_base_%.stl: case_base.scad $(STLDIR)/case_base.stl: $(CASE_BASE_SIZES) @echo +$(STLDIR)/dip_%.stl: dip.scad + @echo [ STL ] $< $* + @$(SCAD) $(STLOPTS) \ + -D ux=$(firstword $(subst x, ,$*)) -D uy=$(word 2,$(subst x, ,$*)) \ + -o $@ $< + +$(STLDIR)/dip.stl: $(DIP_SIZES) + @echo + # Generic Builds $(STLDIR)/%.stl: %.scad diff --git a/dip.scad b/dip.scad new file mode 100644 index 0000000..4cd7206 --- /dev/null +++ b/dip.scad @@ -0,0 +1,30 @@ +use + +magnets = false; + +ux = 2; +uy = 1; +uz = 2; + +pin_length = 3; +pin_spacing = 2.54; + +pin_hole_percent = 0.8; + +function hc_max(m) = floor( m / pin_spacing ); + +module pins_negative(cnt_x, cnt_y) { + for (ix = [0:cnt_x]) { + for (iy = [0 : cnt_y]) { + translate([ pin_spacing*ix + pin_spacing*(1-pin_hole_percent)*0.5, + pin_spacing*iy + pin_spacing*(1-pin_hole_percent)*0.5 ]) + cube([pin_spacing*pin_hole_percent, pin_spacing*pin_hole_percent, pin_length]); + } + } +} + +difference() { + gridfinity(ux, uy, uz, lip=true, magnets=magnets, fill=false, bottom_height=pin_length); + translate(gf_inner_origin()) translate(gf_top_vec(0)) + pins_negative(hc_max(gf_inner(ux)),hc_max(gf_inner(uy))); +} -- cgit v1.2.3