support_width = 51.0; support_height = 13.0; support_length = 25.0; support_angle = 12.0; support_width_2 = support_width / 2.0; rear_support_height = support_height + support_height * tan( support_angle ); /*support_points = [ [support_width_2, -13.0, 0,0 ], [ support_width_2, 0.0, 0,0 ], [ support_width_2, 12.0, support_height ], [ support_width_2, -13.0, rear_support_height ], [ -support_width_2, -13.0, 0,0 ], [ -support_width_2, 0.0, 0,0 ], [ -support_width_2, 12.0, support_height ], [ -support_width_2, -13.0, rear_support_height ] ]; supportpoints = [ [ 0, 0, 0 ], //0 [ 10, 0, 0 ], //1 [ 10, 7, 0 ], //2 [ 0, 7, 0 ], //3 [ 0, 0, 5 ], //4 [ 10, 0, 5 ], //5 [ 10, 7, 5 ], //6 [ 0, 7, 5 ]]; //7 support_faces = [ [0,1,2,3], // bottom [4,5,1,0], // front [7,6,5,4], // top [5,6,2,1], // right [6,7,3,2], // back [7,4,0,3]]; polyhedron( support_points, support_faces ); */ module raw_rifle_support () { CubePoints = [ [ 0, 0, 0 ], //0 [ 15, 0, 0 ], //1 [ 15, support_width, 0 ], //2 [ 0, support_width, 0 ], //3 [ 0, 0, rear_support_height ], //4 [ 25, 0, support_height ], //5 [ 25, support_width, support_height ], //6 [ 0, support_width, rear_support_height ]]; //7 CubeFaces = [ [0,1,2,3], // bottom [4,5,1,0], // front [7,6,5,4], // top [5,6,2,1], // right [6,7,3,2], // back [7,4,0,3]]; // left polyhedron( CubePoints, CubeFaces ); } module rifle_corner () { difference(){ cube([8.0, support_width, 8.0 ] ); translate([0.8,support_height+13,9.99]) rotate([90,0,0]) cylinder(h = 60.0, r = 10.0, center = true, $fn=90); } } module rifle_corner2 () { difference(){ cube([8.5, support_width, 8.0 ] ); translate([0.0,support_height+15,10.5]) rotate([90,0,0]) cylinder(h = 60.0, r = 10.5, center = true, $fn=90); } } module hand_corner () { difference(){ cube([20.0, support_width, 20.0 ] ); translate([0,support_height+15,0]) rotate([90,0,0]) cylinder(h = 60.0, r = 10.0, center = true, $fn=90); } } module right_side(){ union(){ translate([6,0,0]) sphere(r=8); translate([6,0,0]) cylinder(h=30,r=8); } } module rifle_support() { difference() { raw_rifle_support(); translate([9.9,0,0]) rifle_corner2(); rotate([0,-95,0]) translate([4,0,-10]) hand_corner(); } } module screw_hole(){ union(){ cylinder(h=20,r=2.25, center=true, $fn=90 ); translate([0,0,12]) cylinder(h=5,r=3.85, center = true, $fn=90 ); } } difference(){ rifle_support(); rotate([0,-40,0]) translate([12,10,-6.9]) screw_hole(); rotate([0,-40,0]) translate([12,35,-6.9]) screw_hole(); rotate([0,-90,3]) translate([-5,support_width+1,-12]) right_side(); } /* cylinder(h = 60.0, r = 10.0, center = true ); translate( [20.0,20.0,0.0]) cylinder(h = 60.0, r = 7.0, center = true ); */