diff options
author | jaseg <git@jaseg.net> | 2019-09-27 10:07:38 +0200 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2019-09-27 10:07:38 +0200 |
commit | 6002d409143a6726899a4de15c3a6b279a6b1d71 (patch) | |
tree | fcde90f9b0ece9d552164effcc710b7fad978126 /renderer/src/_lib.scad | |
parent | 3340885ade322e8ae6b75257cc760ff48e218a0a (diff) | |
download | pogojig-6002d409143a6726899a4de15c3a6b279a6b1d71.tar.gz pogojig-6002d409143a6726899a4de15c3a6b279a6b1d71.tar.bz2 pogojig-6002d409143a6726899a4de15c3a6b279a6b1d71.zip |
Directory reorg: Put renderer into its own subdir
Diffstat (limited to 'renderer/src/_lib.scad')
-rw-r--r-- | renderer/src/_lib.scad | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/renderer/src/_lib.scad b/renderer/src/_lib.scad new file mode 100644 index 0000000..2654ed7 --- /dev/null +++ b/renderer/src/_lib.scad @@ -0,0 +1,83 @@ + +module hole(l, step, w){ + translate([0, 0, -eps]) { + union(){ + linear_extrude(l+eps*2) + children(); + minkowski(){ + linear_extrude(eps) children(); + cylinder(step, w, 0); + } + } + marker_r = 4; + marker_w = 1; + linear_extrude(1) + difference() { + offset(marker_r+0.5*marker_w) children(); + offset(marker_r-0.5*marker_w) children(); + } + } +} + +module top_chamfer(height, chamfer){ + difference(){ + linear_extrude(height) children(); + translate([0,0,height+eps]) + union() { + for(w=[0:.2:chamfer]){ + mirror([0,0,1]) + linear_extrude(chamfer-w) + difference(){ + offset(1) children(); + offset(-w) children(); + } + } + } + } +} + +module base_shape(wall){ + offset(grip_rounding) offset(-grip_rounding)difference(){ + hull() offset(wall) + children(); + import(input_file, layer="Grip Slots"); + } +} + +module holder(height, depth, wall, tolerance, chamfer){ + difference() { + top_chamfer(height, chamfer/2) + //linear_extrude(height) + base_shape(wall) children(); + translate([0,0,height-depth]) + linear_extrude(depth+eps) offset(tolerance) + children(); + translate([0,0,height-chamfer+eps]) minkowski(){ + linear_extrude(eps) children(); + cylinder(chamfer, 0, chamfer); + } + } +} + +module mounting_hole(height, inset_depth, inset_extra){ + union(){ + translate([0,0,-eps]) + linear_extrude(height+2*eps) + children(); + translate([0,0,height-inset_depth]) + linear_extrude(inset_depth+eps) + offset(inset_extra) + children(); + } +} + +module jig(height, depth, wall, tolerance, chamfer) { + difference(){ + holder(height, depth, wall, tolerance, chamfer) + import(input_file, layer="Outline"); + hole(height-depth, 2, 1) + import(input_file, layer="Test Points"); + mounting_hole(height, 3, 2) + import(input_file, layer="Mounting Holes"); + } +} |