How to create Meccano rods with Openscad
Here are the dimensions from the original drawing: Here the Openscad code:
module MeccanoRod(size){
si=25.4;
extradius=9/32*si;
holeradius=2.1844;
thick=0.9;
difference(){
cube([12.7,2*5.953125+12.7*(size-1),thick]);
translate([12.7/2,12.7/2,0]) {
for ( i = [1:1:size]) {
translate([0,(i-1)*12.7, 0]) cylinder(thick,holeradius,holeradius);
}
}
translate([12.7/2,12.7/2+holeradius,0]) difference() {
cylinder(thick,2*extradius,2*extradius);
cylinder(thick,extradius,extradius);
translate([-20,0,0]) cube([40,40,thick]);
}
translate([12.7/2,12.7*(size)-12.7/2-holeradius,0]) difference() {
cylinder(thick,2*extradius,2*extradius);
cylinder(thick,extradius,extradius);
translate([-20,-40,0]) cube([40,40,thick]);
}
}
}