123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- include <config.scad>;
-
- $fn = 42;
-
- module prism(l, w, h) {
- polyhedron(
- points = [[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],
- faces = [[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]
- );
- }
-
- module roundedcylinder(d, h, r, top = false) {
- hull() // needed, otherwise rendering fails
- rotate_extrude(convexity = 10)
- translate([d / 2, 0, 0])
- rotate([0, 180, 0]) {
- if (top) {
- translate([0, r])
- square([d / 2, h - r * 2]);
- } else {
- translate([0, r])
- square([d / 2, h - r]);
- }
-
- //translate([r, 0])
- //square([d / 2 - r, r]);
-
- translate([r, r])
- circle(r = r);
-
- if (top) {
- translate([r, h - r])
- circle(r = r);
-
- //translate([r, h - r])
- //square([d / 2 - r, r]);
- }
- }
- }
-
- module rail_2020(l, n = "") {
- translate([0, 10, 10])
- difference() {
- translate([0, -10, -10])
- cube([l, 20, 20]);
-
- translate([-1, 0, 0])
- rotate([0, 90, 0])
- cylinder(d = 4.2, h = l + 2);
-
- for (i = [0, 90, 180, 270])
- rotate([i, 0, 0]) {
- translate([-1, -6.25 / 2, 10 - 4.3 - 1.8])
- cube([l + 2, 6.25, 4.3 + 1.8 + 1]);
-
- for (j = [-1, 1])
- scale([1, j, 1])
- translate([-1, -6.25 / 2, 10 - 1.8])
- rotate([45, 0, 0])
- cube([l + 2, 6.25, 4.3 + 1.8 + 1]);
- }
- }
- }
-
- module rail_2020_x(l, n = "") {
- echo("2020 rail", n, str(l));
- rail_2020(l, n);
- }
-
- module rail_2020_y(l, n = "") {
- translate([20, 0, 0])
- rotate([0, 0, 90])
- rail_2020_x(l, n);
- }
-
- module rail_2040_x(l, n = "") {
- echo("2040 rail", n, str(l));
- rail_2020(l, n);
- translate([0, 0, -20])
- rail_2020(l, n);
- }
-
- module rail_2040_y(l, n = "") {
- translate([20, 0, 0])
- rotate([0, 0, 90])
- rail_2040_x(l, n);
- }
-
- module rail_wheel() {
- difference() {
- union() {
- cylinder(d1 = rail_wheel_mid, d2 = rail_wheel_outer, h = (rail_wheel_height - rail_wheel_center_height) / 2);
-
- translate([0, 0, (rail_wheel_height - rail_wheel_center_height) / 2])
- cylinder(d = rail_wheel_outer, h = rail_wheel_center_height);
-
- translate([0, 0, (rail_wheel_height - rail_wheel_center_height) / 2 + rail_wheel_center_height])
- cylinder(d1 = rail_wheel_outer, d2 = rail_wheel_mid, h = (rail_wheel_height - rail_wheel_center_height) / 2);
- }
- translate([0, 0, -1])
- cylinder(d = rail_wheel_inner, rail_wheel_height + 2);
- }
- }
-
- module nema17_holes_face(height, length, hole) {
- translate([nema17_size / 2, nema17_size / 2, height - 4.5])
- for (i = [1, -1])
- for (j = [1, -1])
- translate([i * nema17_hole_off, j * nema17_hole_off, 0])
- cylinder(d = hole, h = length);
- }
-
- module nema17(length) {
- difference() {
- cube([nema17_size, nema17_size, length]);
- nema17_holes_face(length, 5.0, nema17_hole_size);
- }
-
- translate([nema17_size / 2, nema17_size / 2, length]) {
- cylinder(d = nema17_center_size, h = nema17_center_height);
- cylinder(d = nema17_shaft_size, h = nema17_shaft_length);
- }
- }
-
- module dispenser_arm() {
- translate([0, dispenser_arm_tab_off, dispenser_arm_tab_hole_off])
- rotate([90, 0, 0])
- cylinder(d = dispenser_arm_dia, h = dispenser_arm_len);
-
- translate([0, dispenser_arm_tab_off, dispenser_arm_tab_hole_off - dispenser_arm_height])
- cylinder(d = dispenser_arm_dia, h = dispenser_arm_height);
-
- translate([-dispenser_arm_handle_width / 2, dispenser_arm_tab_off - dispenser_arm_len - dispenser_arm_handle_len + dispenser_arm_handle_overlap, dispenser_arm_tab_hole_off + dispenser_arm_dia / 2])
- cube([dispenser_arm_handle_width, dispenser_arm_handle_len, dispenser_arm_handle_height]);
- }
-
- module dispenser() {
- difference() {
- cylinder(d1 = dispenser_nozzle_end_dia_1, d2 = dispenser_nozzle_end_dia_2, h = dispenser_nozzle_end_length);
- translate([0, 0, -0.01])
- cylinder(d1 = dispenser_nozzle_end_dia_1 - dispenser_wall * 2, d2 = dispenser_nozzle_end_dia_2 - dispenser_wall * 2, h = dispenser_nozzle_end_length + 0.02);
- }
-
- translate([0, 0, dispenser_nozzle_end_length])
- difference() {
- cylinder(d1 = dispenser_nozzle_cap_dia_1, d2 = dispenser_nozzle_cap_dia_2, h = dispenser_nozzle_cap_height);
- translate([0, 0, -0.01])
- cylinder(d1 = dispenser_nozzle_cap_dia_1 - dispenser_wall * 2, d2 = dispenser_nozzle_cap_dia_2 - dispenser_wall * 2, h = dispenser_nozzle_cap_height + 0.02);
- }
-
- translate([0, 0, dispenser_nozzle_end_length + dispenser_nozzle_cap_height])
- difference() {
- cylinder(d = dispenser_nozzle_mid_dia, h = dispenser_nozzle_mid_height);
- translate([0, 0, -0.01])
- cylinder(d = dispenser_nozzle_mid_dia - dispenser_wall * 2, h = dispenser_nozzle_mid_height + 0.02);
- }
-
- translate([0, 0, dispenser_nozzle_end_length + dispenser_nozzle_cap_height + dispenser_nozzle_mid_height])
- difference() {
- cylinder(d = dispenser_nozzle_top_dia, h = dispenser_nozzle_top_height);
- translate([0, 0, -0.01])
- cylinder(d = dispenser_nozzle_top_dia - dispenser_wall * 2, h = dispenser_nozzle_top_height + 0.02);
- }
-
- translate([0, 0, dispenser_nozzle_end_length + dispenser_nozzle_cap_height + dispenser_nozzle_mid_height + dispenser_nozzle_top_height])
- difference() {
- cylinder(d1 = dispenser_mid_dia, d2 = dispenser_top_dia, h = dispenser_top_height);
- translate([0, 0, -0.01])
- cylinder(d1 = dispenser_mid_dia - dispenser_wall * 2, d2 = dispenser_top_dia - dispenser_wall * 2, h = dispenser_top_height + 0.02);
- }
-
- translate([0, -dispenser_top_dia / 2, dispenser_nozzle_end_length + dispenser_nozzle_cap_height + dispenser_nozzle_mid_height + dispenser_nozzle_top_height + dispenser_top_height])
- rotate([dispenser_handle_angle, 0, 0])
- translate([0, 0, -dispenser_handle_dia / 2])
- rotate([90, 0, 0])
- cylinder(d = dispenser_handle_dia, h = dispenser_handle_length);
-
- translate([0, dispenser_top_dia / 2 + dispenser_arm_handle_y, dispenser_nozzle_end_length + dispenser_nozzle_cap_height + dispenser_nozzle_mid_height + dispenser_nozzle_top_height + dispenser_top_height + dispenser_arm_handle_z])
- rotate([dispenser_arm_angle_bottom + anim_pos_extruder * (dispenser_arm_angle_top - dispenser_arm_angle_bottom), 0, 0])
- dispenser_arm();
- }
-
- dispenser_arm_angle_top = -5;
- dispenser_arm_angle_bottom = 6;
-
- dispenser();
|