Difference between revisions of "Click Box Programs"

From i3Detroit
Jump to: navigation, search
(Programs for the Click Box Parts)
 
Line 1: Line 1:
 
== Program which produces Top piece ==
 
== Program which produces Top piece ==
  
 +
<code>
 
height=60;
 
height=60;
 
 
width=120;
 
width=120;
 
 
depth=100;
 
depth=100;
 
 
thick=3;
 
thick=3;
 
 
////end of user defined parameters
 
////end of user defined parameters
 
  
  
 
iwidth=width;
 
iwidth=width;
 
 
iheight=height+4*thick;
 
iheight=height+4*thick;
 
 
idepth=depth;
 
idepth=depth;
 
 
ithick=thick;
 
ithick=thick;
 
 
iwiggle=.05*ithick*0;
 
iwiggle=.05*ithick*0;
 
 
ixhole=4*ithick+2*iwiggle;
 
ixhole=4*ithick+2*iwiggle;
 
 
iyhole=1*ithick+2*iwiggle;
 
iyhole=1*ithick+2*iwiggle;
 
 
isideholex=1*ithick+2*iwiggle;
 
isideholex=1*ithick+2*iwiggle;
 
 
isideholey=3*ithick+2*iwiggle;
 
isideholey=3*ithick+2*iwiggle;
 
 
ihinset=8*ithick;
 
ihinset=8*ithick;
 
 
isideyinset=2*ithick;
 
isideyinset=2*ithick;
 
 
isidexinset=ithick;
 
isidexinset=ithick;
 
 
  
  
 
//translate for dxf offset
 
//translate for dxf offset
 
 
  
 
translate(v = [10*ithick, 10*ithick, 0]) {
 
translate(v = [10*ithick, 10*ithick, 0]) {
Line 56: Line 37:
  
 
translate ([ihinset, -ithick]){
 
translate ([ihinset, -ithick]){
 
 
square([4*ithick,2*ithick]);
 
square([4*ithick,2*ithick]);
 
 
}
 
}
  
 
translate ([iwidth-(ihinset+4*ithick), -ithick]){
 
translate ([iwidth-(ihinset+4*ithick), -ithick]){
 
 
square([4*ithick,2*ithick]);
 
square([4*ithick,2*ithick]);
 
 
}
 
}
  
 
translate ([ihinset, idepth-ithick]){
 
translate ([ihinset, idepth-ithick]){
 
 
square([4*ithick,2*ithick]);
 
square([4*ithick,2*ithick]);
 
 
}
 
}
  
 
translate ([iwidth-(ihinset+4*ithick), idepth-ithick]){
 
translate ([iwidth-(ihinset+4*ithick), idepth-ithick]){
 
 
square([4*ithick,2*ithick]);
 
square([4*ithick,2*ithick]);
 
 
}
 
}
  
 
translate ([-ithick, (idepth-4*ithick)/2]){
 
translate ([-ithick, (idepth-4*ithick)/2]){
 
 
square([2*ithick,4*ithick]);
 
square([2*ithick,4*ithick]);
 
 
}
 
}
  
 
translate ([iwidth-ithick, (idepth-4*ithick)/2]){
 
translate ([iwidth-ithick, (idepth-4*ithick)/2]){
 
 
square([2*ithick,4*ithick]);
 
square([2*ithick,4*ithick]);
 
 
}
 
}
  
Line 95: Line 64:
  
 
 
} // end translate for output
+
}// end translate for output
 
+
  
 +
</code>
  
 
== Program which produces Front piece ==
 
== Program which produces Front piece ==
 +
 +
 +
<code>
  
 
height=60;
 
height=60;
Line 105: Line 77:
 
depth=100;
 
depth=100;
 
thick=3;
 
thick=3;
////end of user defined parameters
+
//end of user defined parameters
 +
 
  
 
iwidth=width;
 
iwidth=width;
Line 122: Line 95:
  
 
//translate for dxf offset
 
//translate for dxf offset
 +
  
 
translate(v = [10*ithick, 10*ithick, 0]) {
 
translate(v = [10*ithick, 10*ithick, 0]) {
Line 132: Line 106:
  
 
//paint the big square
 
//paint the big square
  square ([iwidth,iheight]);
+
 
 +
square ([iwidth,iheight]);
 
    
 
    
 
//cut 4 notches
 
//cut 4 notches
 +
 
translate([ihinset-iwiggle,
 
translate([ihinset-iwiggle,
 
ithick-iwiggle, 0]) {  
 
ithick-iwiggle, 0]) {  
Line 158: Line 134:
  
 
//add the tabs
 
//add the tabs
 +
 
translate ([-2.1*ithick, ithick]){
 
translate ([-2.1*ithick, ithick]){
polygon(points = [ [ithick, .5*ithick], [ithick,ithick],
+
polygon(points = [ [ithick, .5*ithick], [ithick,ithick],
[4*ithick,ithick],[4*ithick,4*ithick],
+
[4*ithick,ithick],[4*ithick,4*ithick],
[ithick,4*ithick],[0,ithick]],  
+
[ithick,4*ithick],[0,ithick]],  
paths = [[0,1,2,3,4,5]], convexity=1);
+
paths = [ [0,1,2,3,4,5] ], convexity=1);
 
}
 
}
  
 
translate ([iwidth+2.1*ithick, ithick]){
 
translate ([iwidth+2.1*ithick, ithick]){
mirror([ 1, 0, 0 ]) {
+
mirror([ 1, 0, 0 ]) {
polygon(points = [[ithick, .5*ithick], [ithick,ithick],
+
polygon(points = [[ithick, .5*ithick], [ithick,ithick],
[4*ithick,ithick],[4*ithick,4*ithick],
+
[4*ithick,ithick],[4*ithick,4*ithick],
[ithick,4*ithick],[0,ithick]],  
+
[ithick,4*ithick],[0,ithick]],  
paths = [[0,1,2,3,4,5]], convexity=1);
+
paths = [ [0,1,2,3,4,5] ], convexity=1);
 
}
 
}
 
}
 
}
  
 
translate ([-2.1*ithick, (iheight-ithick)]){
 
translate ([-2.1*ithick, (iheight-ithick)]){
mirror([ 0, 1, 0 ]) {
+
mirror([ 0, 1, 0 ]) {
polygon(points = [[ithick, .5*ithick], [ithick,ithick],
+
polygon(points = [[ithick, .5*ithick], [ithick,ithick],
[4*ithick,ithick],[4*ithick,4*ithick],
+
[4*ithick,ithick],[4*ithick,4*ithick],
[ithick,4*ithick],[0,ithick]],  
+
[ithick,4*ithick],[0,ithick]],  
paths = [[0,1,2,3,4,5]], convexity=1);
+
paths = [ [0,1,2,3,4,5] ], convexity=1);
 
}
 
}
 
}
 
}
  
 
translate ([iwidth+2.1*ithick, iheight -ithick]){
 
translate ([iwidth+2.1*ithick, iheight -ithick]){
rotate(a = 180, v = [0,0,1]) {
+
rotate(a = 180, v = [0,0,1]) {
polygon(points = [[ithick, .5*ithick], [ithick,ithick],
+
polygon(points = [[ithick, .5*ithick], [ithick,ithick],
[4*ithick,ithick],[4*ithick,4*ithick],
+
[4*ithick,ithick],[4*ithick,4*ithick],
[ithick,4*ithick],[0,ithick]],  
+
[ithick,4*ithick],[0,ithick]],  
paths = [[0,1,2,3,4,5]], convexity=1);
+
paths = [ [0,1,2,3,4,5] ], convexity=1);
 
}
 
}
 
}
 
}
Line 197: Line 174:
  
 
//cut the z slot
 
//cut the z slot
 +
 
translate ([iwidth-4.9*ithick, ithick]){
 
translate ([iwidth-4.9*ithick, ithick]){
 
polygon(points=
 
polygon(points=
Line 203: Line 181:
 
[7*ithick,3*ithick],[3*ithick,3*ithick],
 
[7*ithick,3*ithick],[3*ithick,3*ithick],
 
[3*ithick,1*ithick],[0,1*ithick]],  
 
[3*ithick,1*ithick],[0,1*ithick]],  
paths=[[0,1,2,3,4,5,6,7]]);
+
paths=[ [0,1,2,3,4,5,6,7] ]);
 
}
 
}
  
Line 212: Line 190:
 
[7*ithick,3*ithick],[3*ithick,3*ithick],
 
[7*ithick,3*ithick],[3*ithick,3*ithick],
 
[3*ithick,1*ithick],[0,1*ithick]],  
 
[3*ithick,1*ithick],[0,1*ithick]],  
paths=[[0,1,2,3,4,5,6,7]]);
+
paths=[ [0,1,2,3,4,5,6,7] ]);
 
}
 
}
 
translate ([iwidth+2.1*ithick, iheight -4*ithick]){
 
translate ([iwidth+2.1*ithick, iheight -4*ithick]){
Line 221: Line 199:
 
[7*ithick,3*ithick],[3*ithick,3*ithick],
 
[7*ithick,3*ithick],[3*ithick,3*ithick],
 
[3*ithick,1*ithick],[0,1*ithick]],  
 
[3*ithick,1*ithick],[0,1*ithick]],  
paths=[[0,1,2,3,4,5,6,7]]);
+
paths=[ [0,1,2,3,4,5,6,7] ]);
 
}
 
}
 
}
 
}
Line 231: Line 209:
 
[7*ithick,3*ithick],[3*ithick,3*ithick],
 
[7*ithick,3*ithick],[3*ithick,3*ithick],
 
[3*ithick,1*ithick],[0,1*ithick]],  
 
[3*ithick,1*ithick],[0,1*ithick]],  
paths=[[0,1,2,3,4,5,6,7]]);
+
paths=[ [0,1,2,3,4,5,6,7] ]);
 
}
 
}
 
}
 
}
 +
 +
 
}  //end the difference
 
}  //end the difference
}  // end translate for output
 
  
  
 +
}  // end translate for output
 +
 +
</code>
  
 
== Program which produces Side piece ==
 
== Program which produces Side piece ==
  
 +
<code>
 
height=60;
 
height=60;
 
width=120;
 
width=120;
 
depth=100;
 
depth=100;
 
thick=3;
 
thick=3;
////end of user defined parameters
+
//end of user defined parameters
 +
 
  
 
iwidth=width;
 
iwidth=width;
Line 262: Line 246:
  
 
//translate for dxf offset
 
//translate for dxf offset
 +
 +
  
 
translate(v = [10*ithick, 10*ithick, 0]) {
 
translate(v = [10*ithick, 10*ithick, 0]) {
Line 270: Line 256:
  
 
//paint the big square
 
//paint the big square
 +
 +
 
  square ([idepth+4*ithick,iheight]);
 
  square ([idepth+4*ithick,iheight]);
 
 
 
    
 
    
 
//cut 6 notches
 
//cut 6 notches
 +
 +
 
translate([isidexinset-iwiggle,
 
translate([isidexinset-iwiggle,
 
isideyinset-iwiggle, 0]) {  
 
isideyinset-iwiggle, 0]) {  
Line 297: Line 287:
 
}
 
}
 
}
 
}
 +
 +
  
 
//cut cross holes
 
//cut cross holes
Line 313: Line 305:
  
 
}  //end difference
 
}  //end difference
 +
  
 
//add feet
 
//add feet
 +
 +
 
translate([ithick,0, 0]) {
 
translate([ithick,0, 0]) {
 
circle(ithick);
 
circle(ithick);
Line 326: Line 321:
  
 
}  // end translate for output
 
}  // end translate for output
 +
 +
</code>

Revision as of 15:53, 24 March 2013

Program which produces Top piece

height=60; width=120; depth=100; thick=3; ////end of user defined parameters


iwidth=width; iheight=height+4*thick; idepth=depth; ithick=thick; iwiggle=.05*ithick*0; ixhole=4*ithick+2*iwiggle; iyhole=1*ithick+2*iwiggle; isideholex=1*ithick+2*iwiggle; isideholey=3*ithick+2*iwiggle; ihinset=8*ithick; isideyinset=2*ithick; isidexinset=ithick;


//translate for dxf offset

translate(v = [10*ithick, 10*ithick, 0]) {

union() {

//paint the big square

square ([iwidth,idepth]);


//add the tabs

translate ([ihinset, -ithick]){ square([4*ithick,2*ithick]); }

translate ([iwidth-(ihinset+4*ithick), -ithick]){ square([4*ithick,2*ithick]); }

translate ([ihinset, idepth-ithick]){ square([4*ithick,2*ithick]); }

translate ([iwidth-(ihinset+4*ithick), idepth-ithick]){ square([4*ithick,2*ithick]); }

translate ([-ithick, (idepth-4*ithick)/2]){ square([2*ithick,4*ithick]); }

translate ([iwidth-ithick, (idepth-4*ithick)/2]){ square([2*ithick,4*ithick]); }


}//end the union for tabs


}// end translate for output

Program which produces Front piece

height=60; width=120; depth=100; thick=3; //end of user defined parameters


iwidth=width; iheight=height+4*thick; idepth=depth; ithick=thick; iwiggle=0; ixhole=4*ithick+2*iwiggle; iyhole=1*ithick+2*iwiggle; isideholex=1*ithick+2*iwiggle; isideholey=3*ithick+2*iwiggle; ihinset=8*ithick; isideyinset=2*ithick; isidexinset=ithick;


//translate for dxf offset


translate(v = [10*ithick, 10*ithick, 0]) {

difference () {

union() {

difference (){

//paint the big square

square ([iwidth,iheight]);

//cut 4 notches

translate([ihinset-iwiggle, ithick-iwiggle, 0]) { square([ixhole,iyhole]); }

translate([iwidth - (ihinset+iwiggle+ixhole), ithick-iwiggle, 0]) { square([ixhole,iyhole]); }

translate([ihinset-iwiggle, iheight -2*ithick-iwiggle, 0]) { square([ixhole,iyhole]); }

translate([iwidth - (ihinset+iwiggle+ixhole), iheight -2*ithick-iwiggle, 0]) { square([ixhole,iyhole]); }

} //end difference

//add the tabs

translate ([-2.1*ithick, ithick]){ polygon(points = [ [ithick, .5*ithick], [ithick,ithick], [4*ithick,ithick],[4*ithick,4*ithick], [ithick,4*ithick],[0,ithick]], paths = [ [0,1,2,3,4,5] ], convexity=1); }

translate ([iwidth+2.1*ithick, ithick]){ mirror([ 1, 0, 0 ]) { polygon(points = [[ithick, .5*ithick], [ithick,ithick], [4*ithick,ithick],[4*ithick,4*ithick], [ithick,4*ithick],[0,ithick]], paths = [ [0,1,2,3,4,5] ], convexity=1); } }

translate ([-2.1*ithick, (iheight-ithick)]){ mirror([ 0, 1, 0 ]) { polygon(points = [[ithick, .5*ithick], [ithick,ithick], [4*ithick,ithick],[4*ithick,4*ithick], [ithick,4*ithick],[0,ithick]], paths = [ [0,1,2,3,4,5] ], convexity=1); } }

translate ([iwidth+2.1*ithick, iheight -ithick]){ rotate(a = 180, v = [0,0,1]) { polygon(points = [[ithick, .5*ithick], [ithick,ithick], [4*ithick,ithick],[4*ithick,4*ithick], [ithick,4*ithick],[0,ithick]], paths = [ [0,1,2,3,4,5] ], convexity=1); } }


}//end the union for tabs

//cut the z slot

translate ([iwidth-4.9*ithick, ithick]){ polygon(points= [[0,0],[4*ithick,0], [4*ithick,2*ithick],[7*ithick,2*ithick], [7*ithick,3*ithick],[3*ithick,3*ithick], [3*ithick,1*ithick],[0,1*ithick]], paths=[ [0,1,2,3,4,5,6,7] ]); }

translate ([-2.1*ithick, (iheight-4*ithick)]){ polygon(points= [[0,0],[4*ithick,0], [4*ithick,2*ithick],[7*ithick,2*ithick], [7*ithick,3*ithick],[3*ithick,3*ithick], [3*ithick,1*ithick],[0,1*ithick]], paths=[ [0,1,2,3,4,5,6,7] ]); } translate ([iwidth+2.1*ithick, iheight -4*ithick]){ mirror(1,0,0){ polygon(points= [[0,0],[4*ithick,0], [4*ithick,2*ithick],[7*ithick,2*ithick], [7*ithick,3*ithick],[3*ithick,3*ithick], [3*ithick,1*ithick],[0,1*ithick]], paths=[ [0,1,2,3,4,5,6,7] ]); } } translate ([4.9*ithick, ithick]){ mirror(1,0,0){ polygon(points= [[0,0],[4*ithick,0], [4*ithick,2*ithick],[7*ithick,2*ithick], [7*ithick,3*ithick],[3*ithick,3*ithick], [3*ithick,1*ithick],[0,1*ithick]], paths=[ [0,1,2,3,4,5,6,7] ]); } }


} //end the difference


} // end translate for output

Program which produces Side piece

height=60; width=120; depth=100; thick=3; //end of user defined parameters


iwidth=width; iheight=height+4*thick; idepth=depth; ithick=thick; iwiggle=.05*ithick*0; ixhole=4*ithick+2*iwiggle; iyhole=1*ithick+2*iwiggle; isideholex=1*ithick+2*iwiggle; isideholey=3*ithick+2*iwiggle; ihinset=8*ithick; isideyinset=2*ithick; isidexinset=ithick;


//translate for dxf offset


translate(v = [10*ithick, 10*ithick, 0]) {

union() {

difference (){

//paint the big square


square ([idepth+4*ithick,iheight]);


//cut 6 notches


translate([isidexinset-iwiggle, isideyinset-iwiggle, 0]) { square([isideholex,isideholey]); }

translate([idepth-isidexinset-ithick-2*iwiggle+4*ithick, isideyinset-iwiggle, 0]) { square([isideholex,isideholey]); }

translate([isidexinset-iwiggle, iheight-isideyinset+iwiggle, 0]) { mirror([ 0, 1, 0 ]) { square([isideholex,isideholey]); } }

translate([idepth-isidexinset-ithick-2*iwiggle+4*ithick, iheight-isideyinset+iwiggle, 0]) { mirror([ 0, 1, 0 ]) { square([isideholex,isideholey]); } }


//cut cross holes

translate([(idepth-ixhole+4*ithick)/2-iwiggle, iheight-isideyinset+iwiggle, 0]) { square([ixhole,iyhole]);

}

translate([(idepth-ixhole+4*ithick)/2-iwiggle, ithick-iwiggle, 0]) { square([ixhole,iyhole]);

}

} //end difference


//add feet


translate([ithick,0, 0]) { circle(ithick); }

translate([idepth-ithick+4*ithick,0, 0]) { circle(ithick); }

}//end the union for feet

} // end translate for output