Index: 1206.scad =================================================================== --- 1206.scad (revision 24791) +++ 1206.scad (revision 24792) @@ -1,15 +1,20 @@ -module part_1206() +module part_1206(len=3.2, width=1.6, height=0.6, pad_len=0.5) { - translate([0,0,0.3]) { - // body - color([0.1,0.1,0.1]) - cube([3.2-2*0.2,1.6,0.6], center=true); - // terminals - color([0.8,0.8,0.8]) { - translate([+1.5, 0, 0]) - cube([0.2, 1.6, 0.6], center=true); - translate([-1.5, 0, 0]) - cube([0.2, 1.6, 0.6], center=true); + union() { + translate([0,0,height/2]) { + // body + color([0.1,0.1,0.1]) + cube([len-2*pad_len,width,height], center=true); + // terminals + color([0.8,0.8,0.8]) { + translate([+len/2-pad_len/2, 0, 0]) + cube([pad_len, width, height], center=true); + } + color([0.8,0.8,0.8]) { + translate([-len/2+pad_len/2, 0, 0]) + cube([pad_len, width, height], center=true); + } } } } +