eps = 0.01;
infty = 300;
-base_d = 70;
-base_y_scale = 0.7;
-base_wall = 1.25;
+/*
+sirka trupu u nabezne hrany 80mm
+max sirka trupu 90 mm
+sirka trupu 50mm pred nabeznou hranou 84mm
+rozchod klidne 150mm
+vyska osy se spodni hranou trupu az cca 30mm pod trupem
+kolma cast asi vpredu
+*/
-base_l = 80;
-base_w = 30;
+base_h = 95;
+base_w = 83;
+base_top = 5; // above the xz plane
+base_wall = 0.6;
+base_l = 45;
-rear_angle = 75;
-wheel_base = 70;
-wheel_h = 50;
-wheel_axle_cube = 5;
+axle_cube = 7;
+axle_hole = 3.5;
-axle_hole = 2;
+strut_wall = 1.2;
+base_top_l = axle_cube;
-beam_w = 1.5;
-beam_h = 5;
-top_beam_h = 12;
+bottom_strut_l = base_l-5;
-spring_clip_l = 3.5;
-spring_clip_w = base_w - 5;
-spring_dist = 10;
+wheel_h = 60;
+wheel_base = 110;
-module rear_cyl() {
- translate([0, 0, -beam_w*sin(rear_angle)/2])
- rotate([rear_angle-90, 0, 0])
- cylinder(r = beam_w/2, h = beam_h/sin(rear_angle), $fn = 32);
+module base() {
+ difference() {
+ $fn = 128;
+ scale([base_w/base_h, 1, 1])
+ cylinder(r = base_h/2, h = base_l);
+ // cut the top half
+ translate([-infty/2, base_top, -infty/2]) cube(infty);
+
+ // cut the rear angle
+ translate([0, base_top, base_top_l])
+ rotate([-atan((base_l - base_top_l)/(base_h/2 + base_top)), 0, 0])
+ translate([-infty/2, -infty/2, 0]) cube(infty);
+ }
}
-module front_cyl() {
- rotate([rear_angle-90, 0, 0])
- cylinder(r = beam_w/2, h = beam_h, $fn = 32);
+module wheel_cube()
+{
+ translate([wheel_base/2-axle_cube,
+ -wheel_h-axle_cube/2, 0])
+ cube(axle_cube);
}
-module top_cyl() {
- rotate([rear_angle-90, 0, 0])
- cylinder(r = beam_w/2, h = top_beam_h, $fn = 32);
+module top_strut() {
+ hull() {
+ // top
+ translate([base_w/2 - strut_wall/2, 0, 0])
+ cylinder(r = strut_wall/2, h = base_top_l, $fn = 16);
+ // bottom
+ translate([wheel_base/2-strut_wall/2,
+ -wheel_h+axle_cube/2, 0])
+ cylinder(r = strut_wall/2, h = axle_cube, $fn = 16);
+ }
}
-module body() {
- rotate([rear_angle-90, 0, 0])
- translate([0, -sqrt(pow(base_d*base_y_scale/2,2) - pow(base_w*base_y_scale/2,2)), 0])
- difference() {
- // outer cylinder
- scale([1, base_y_scale, 1])
- cylinder(r = base_d/2, h = base_l);
- // cut the sides
- for (i = [-1, 1]) scale ([i, 1, 1])
- translate([base_w/2, -infty/2, -infty/2])
- cube(infty);
- // cut the rear
- translate([-infty/2, -infty, -infty/2]) cube(infty);
+module bottom_strut() {
+ hull() {
+ // center
+ rotate([0, 0, 30])
+ translate([0, -base_w/2 + base_wall/2, 0])
+ cylinder(r = strut_wall/2, h = bottom_strut_l, $fn = 16);
+ // side
+ // translate([wheel_base/2-axle_cube+strut_wall/2,
+ // -wheel_h+axle_cube/2-strut_wall/2 , 0])
+ translate([wheel_base/2-strut_wall/2,
+ -wheel_h-axle_cube/2+strut_wall/2 , 0])
+ cylinder(r = strut_wall/2, h = axle_cube, $fn = 16);
}
+}
- // wheel axle cubes
- for (i = [-1, 1]) scale([i, 1, 1])
- translate([wheel_base/2 - wheel_axle_cube, wheel_h - wheel_axle_cube/2, 0])
- cube(wheel_axle_cube);
-
- // rear beams
- for (i = [-1, 1]) scale([i,1,1])
- hull() {
- translate([-(base_w/2-beam_w/2), spring_dist, 0])
- rear_cyl();
- translate([wheel_base/2-beam_w/2, wheel_h, 0])
- rear_cyl();
- }
-
- // spring top
- hull() {
- for (j = [-1, 1])
- translate([j*(base_w/2-beam_w/2), spring_dist, 0])
- rear_cyl();
+module horiz_strut() {
+ translate([-wheel_base/2, -wheel_h-axle_cube/2, 0])
+ cube([wheel_base, strut_wall, axle_cube]);
+}
+
+module body() {
+ base();
+
+ for (x = [-1, 1]) scale([x, 1, 1]) {
+ wheel_cube();
+ top_strut();
+ bottom_strut();
}
- // spring sides
- for (i = [-1, 1]) scale([i,1,1])
- hull() {
- translate([(base_w/2+beam_w), 0, 0])
- rear_cyl();
- translate([(base_w/2-beam_w/2), spring_dist, 0])
- rear_cyl();
- }
-
- // front beams
- for (i = [-1, 1]) scale([i,1,1])
- for (j = [-1, 1]) hull() {
- translate([j*(base_w/2-beam_w/2), (base_l-top_beam_h)*cos(rear_angle), (base_l-top_beam_h)*sin(rear_angle)])
- top_cyl();
- translate([wheel_base/2-beam_w/2, wheel_h, 0])
- front_cyl();
- }
-
- // spring rear clip
- translate([-spring_clip_w/2, 0, 0])
- cube([spring_clip_w, spring_clip_l, base_wall]);
-
- // spring clip sides
- for (i = [-1, 1]) scale([i,1,1])
- hull() {
- translate([(base_w/2-beam_w/2), 0, 0])
- rear_cyl();
- translate([(base_w/2-beam_w/2), spring_clip_l - 1.5*beam_w, 0])
- rear_cyl();
- }
+ horiz_strut();
}
difference() {
body();
- // inner cylinder hole
- rotate([+rear_angle-90, 0, 0])
- translate([0, -sqrt(pow(base_d*base_y_scale/2,2) - pow(base_w*base_y_scale/2,2)), -infty/2])
- scale([1, 1*base_y_scale, 1])
- cylinder(r = base_d/2 - base_wall, h = infty);
- // cut the bottom
- translate([-infty/2, -infty/2, -infty]) cube(infty);
- // wheel axle hole
- translate([-infty/2, wheel_h, wheel_axle_cube/2])
+ // hole in the base, no matter what gets in
+ translate([0, 0, -eps])
+ scale([(base_w - base_wall)/(base_h - base_wall), 1, 1])
+ cylinder(r = base_h/2 - base_wall, h = base_l + 2*eps, $fn=128);
+
+ // hole for the wheel axle
+ translate([-infty/2, -wheel_h, axle_cube/2])
rotate([0, 90, 0])
- cylinder(r = axle_hole/2, h = infty);
+ rotate([0, 0, 90])
+ cylinder(r = axle_hole/2, h = infty);
}