2 // GNU AGPLv3 (or later at your option)
3 // project available at these locations:
4 // https://gitorious.org/ozzloy/challenge-bot
5 // https://github.com/waynegramlich/challenge-bot
7 // all measurements are in mm unless stated otherwise
9 // metric version of deck:
11 deck_width
= deck_length
;
15 deck_hole_type
= "square";
18 // imperial version of deck
19 deck_length = 203.2; // 8 inches
20 deck_width = deck_length;
21 deck_depth = 25.4 * 3 / 16; // 3 / 16 of an inch
22 deck_pitch = 25.4; // 1 inch
23 deck_grid_hole = 6.35 / 2; // 1/4 inch diameter, 1/8 inch radius
24 deck_hole_type = "circle";
27 module
deck_2d(width
, length
, pitch
, hole
, hole_type
, center
=false){
28 center_width_offset
= center
? -(width
/ 2): 0;
29 center_length_offset
= center
? -(length
/ 2): 0;
30 translate([center_width_offset
, center_length_offset
]){
32 square([width
, length
]);
33 for (y
= [0:floor(length
/ pitch
) - 1],
34 x
= [0:floor(width
/ pitch
) - 1]){
35 translate([pitch
* (x
+ 0.5), pitch
* (y
+ 0.5)]){
36 if (hole_type
== "circle"){
37 circle(hole
, center
= true);}
38 else if (hole_type
== "square") {
39 square(hole
, center
= true);}
41 echo(str("don't know the hole type: ", hole_type
));}}}}}}
43 module
deck(width
, length
, depth
, pitch
, hole
, hole_type
, center
=false){
44 linear_extrude (height
= depth
){
45 deck_2d(width
, length
, pitch
, hole
, hole_type
, center
);}}