include //or screws or threading /*Original, enhanced by sphere*/ module bob(){ Wo=34; Lo=60; Wi=23; Li=34; H=10; Ro = 8; Ri = 3; T=1.4; Off = 2.0; difference(){ union(){ rect_tube(size=[Wo,Lo], wall=(Wo-Wi)/2, rounding=Ro, h=H,irounding=3); rect_tube(size=[Wo,Lo-(Wo-Wi)/2], wall=(Wo-Wi)/2, rounding=Ro, h=H,irounding=3); } rect_tube(size=[Wo-T,Lo-T], wall=(Wo-Wi)/2-T,h=H-T,irounding=3, rounding=Ro); rect_tube(size=[Wo-T*2,Lo-T*2], wall=(Wo-Wi)/2-T,h=Off,irounding=3, rounding=Ro); up(Off/2)cuboid([Wo-6*T,Lo-6*T,Off]); } } module mytext(text){ mirror([1,0,0]) linear_extrude(1) text(text=text,halign="center"); } translate([-100,0,0]) { translate([0,40]) mytext(text="original"); bob(); } translate([0,40]) mytext(text="Minkowski"); union(){ $fn=20; minkowski(){ bob(); sphere(r=1.5); } } /* WARNING: Too many unnamed arguments supplied in file ../.local/share/OpenSCAD/libraries/BOSL2/attachments.scad, line 3274 include translate([100,0,0]) chamfer(4,-2) bob(); */ /*Approach from 2D*/ a=20; b=10; corner=1.5; module u_shape(){ difference(){ square(a); translate([a/2-b/2,0]) square(b); } } module u_round(){ $fn=30; translate([corner,corner]) difference(){ offset(r=corner) u_shape(); offset(r=corner) translate([a/2-b/2+2*corner,3*corner]) square(b-4*corner); } } module create_by_mirroring(mirroraxis){ children(); mirror(mirroraxis) children(); } //mpo(); len=200; wid=100; translate([0,len/1.5]) mytext(text="2D extrude"); create_by_mirroring([0,1,0]) create_by_mirroring([1,0,0]) translate([wid/2,len/2,0]) union(){ /*right side*/ rotate([90,0,0]) linear_extrude(len) u_round(); /*top right edge*/ rotate_extrude(angle=90) u_round(); /*top side*/ translate([-wid,0,0]) rotate([0,0,90]) rotate([90,0,0]) linear_extrude(wid) u_round(); translate([-wid,0,0]) rotate([0,0,90] ) rotate_extrude(angle=90) u_round(); } #translate([a,0]) u_round();