From: Ian Jackson Date: Sun, 8 Oct 2017 01:34:50 +0000 (+0100) Subject: poster-tube-lid: BayonetCutout rework to RotateProjectSlice X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=commitdiff_plain;h=40c4ef435ac5dce7ebade670a2aa676588e5bd6d poster-tube-lid: BayonetCutout rework to RotateProjectSlice slight functional change only (minor overlap adjustment) --- diff --git a/poster-tube-lid.scad b/poster-tube-lid.scad index c4847c9..47e6a84 100644 --- a/poster-tube-lid.scad +++ b/poster-tube-lid.scad @@ -112,31 +112,38 @@ module MainProfile(){ ]); } -module BayonetCutoutSlice(offset){ - rotate([0,0, atan2(offset, main_dia/2 + side_thick) ]){ +module RotateProjectSlice(offset, slice_size, nom_rad, real_rad){ + // nom_rad > real_rad + rotate([0,0, atan2(offset, nom_rad) ]){ intersection(){ translate([-offset, -10, 0]) rotate([90,0,0]) - linear_extrude(height= main_dia*2) + linear_extrude(height= nom_rad*2) polygon(bayo_polygon); translate([0,0, -25]) - cylinder(h=50, r= main_dia/2 + rivet_tall); + cylinder(h=50, r= real_rad); translate([0,0, -25]) linear_extrude(height= 50) polygon([ [ 0,0 ], - [ -bayo_slice_size, -main_dia ], - [ +bayo_slice_size, -main_dia ] ]); + [ -slice_size, -real_rad*2 ], + [ +slice_size, -real_rad*2 ] ]); } } } -module BayonetCutout(){ - offs = [ for (i=[ bayo_c[0] : - bayo_slice_size : - bayo_i[0] + bayo_slice_size ]) i ]; +module RotateProject(x_min, x_max, slice_size, nom_rad, real_rad){ + offs = [ for (i=[ x_min : + slice_size : + x_max + slice_size ]) i ]; echo (offs); for (off=offs) - BayonetCutoutSlice(off); + RotateProjectSlice(off, slice_size, nom_rad, real_rad); +} + +module BayonetCutout(){ + RotateProject(bayo_c[0], bayo_i[0], bayo_slice_size, + main_dia/2 + side_thick, + main_dia/2 + rivet_tall); } module ProfilesDemo(){