diff --git a/config.scad b/config.scad index dae31c1..7dbedbb 100644 --- a/config.scad +++ b/config.scad @@ -1,31 +1,159 @@ -/* use <./models/common/metric_bolt_functions.scad>; -use <./models/brake/brake_assembly_functions.scad>; -use <./models/fixings/tube_clamp_round_tee_long_104_functions.scad>; -use <./models/fixings/tube_clamp_round_3_way_through_116_functions.scad>; -use <./models/fixings/tube_clamp_round_base_plate_132_functions.scad>; -use <./models/fixings/tube_clamp_square_base_plate_132_functions.scad>; -*/ +use <./models/common/metric_countersunk_head_bolt.scad>; +use <./models/common/washer.scad>; // Configuration -R_INTERNAL = [1200, 900, 900]; +R_EXTERNAL = [1200, 900, 900]; D_BEAM_SKELETON = 20; -T_BEAM_SKELETON = 1.5; - -COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_X = 2; -COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_Y = 2; -COUNT_BEAMS_ON_SIDE_FACE_ALONG_Z = 1; - -CLEARANCE_SKIN_TO_SKELETON = 5; -T_SKIN = 10; -W_SKIN_BORDER_FRONT = 150; - +T_BEAM_SKELETON = 2; +DEPTH_SLOT_BEAM_SKELETON = 4; +D_SLOT = 6; +L_LEG = 150; +COUNT_BASE_SUPPORT_BEAMS_ON_Y = 3; +COUNT_FEET_PER_BASE_SUPPORT_BEAM_ON_Y = 2; +T_PLATE_SUPPORT = 2; D_VENT_DUCT = 100; +SIZE_BOLT_VENT = 4; +COUNT_BOLTS_PER_VENT = 4; +D_WASHER_VENT = 12; +T_WASHER_VENT = 0.8; +OVERLAP_CLEAR_PANEL_WITH_SKELETON_EACH_SIDE = 3; +D_GLOVE_HOLE = 150; +SIZE_BOLT_GLOVE = SIZE_BOLT_VENT; +COUNT_BOLTS_PER_GLOVE = 4; +OFFSET_GLOVE_HOLE_CENTRES_X = 350; +OFFSET_NUT_FROM_BOLT_END = 2; +OFFSET_NUT_FROM_BOLT_END_CHAMBER = 0.5; +D_WASHER_GLOVE = 12; +T_WASHER_GLOVE = 2; +T_HDPE_SHEET = 3; +T_GASKET_RUBBER = 1.5; -R_EXTERNAL = R_INTERNAL + (D_BEAM_SKELETON * 2) * [1, 1, 1]; -echo("R_EXTERNAL: ", R_EXTERNAL); +COUNT_HINGES = 2; +SIZE_BOLT_HINGE = 4.5; +R_HINGE = [50, 50, 2]; +D_WASHER_HINGE = 12; +T_WASHER_HINGE = 2; +R_T_NUT = [5.7, 11.5, 3.2]; +OFFSET_LATCH_FROM_SIDE = 300; +OFFSET_LATCH_FROM_TOP = 250; +R_DOOR_LATCH_SUPPORT_PLATE = [25, 120, 6]; +SIZE_BOLT_LATCH_PLATE_TO_SKELETON = 4; +D_WASHER_LATCH_PLATE_TO_SKELETON = 9; +T_WASHER_LATCH_PLATE_TO_SKELETON = 0.8; +SIZE_BOLT_LATCH_TO_PLATE = 5; +D_WASHER_LATCH_TO_PLATE = 9; +T_WASHER_LATCH_TO_PLATE = 0.8; +R_LATCH = [21, 125, 2]; +COUNT_BOLTS_PER_DOOR_GASKET_ON_X_TOP = 3; +COUNT_BOLTS_PER_DOOR_GASKET_ON_X_BOTTOM = 5; +COUNT_BOLTS_PER_DOOR_GASKET_ON_Z = 4; +OFFSET_BOLTS_FROM_SEAL_END = 100; +SIZE_BOLT_DOOR_GASKET = SIZE_BOLT_GLOVE; +/* +D_DOOR_SUPPORT_BEAM = 19; +T_DOOR_SUPPORT_BEAM = 1.6; +W_DOOR_SUPPORT_BEAM = 19; +D_DOOR_SUPPORT_BEAM = 25.4; +T_DOOR_SUPPORT_BEAM = 1.6; +W_DOOR_SUPPORT_BEAM = 25.4; +D_DOOR_SUPPORT_BEAM = 15; +T_DOOR_SUPPORT_BEAM = 4; +W_DOOR_SUPPORT_BEAM = 30; +D_DOOR_SUPPORT_BEAM = 20; +T_DOOR_SUPPORT_BEAM = 3; +W_DOOR_SUPPORT_BEAM = 40; +*/ +D_DOOR_SUPPORT_BEAM = 25; +T_DOOR_SUPPORT_BEAM = 3; +W_DOOR_SUPPORT_BEAM = 50; +W_DOOR_GASKET = 25; +D_WASHER_DOOR_GASKET = 12; +T_WASHER_DOOR_GASKET = 2; -R_SKIN = R_EXTERNAL + ((CLEARANCE_SKIN_TO_SKELETON + T_SKIN) * 2) * [1, 1, 1]; -echo("R_SKIN: ", R_SKIN); \ No newline at end of file +AREA_BEAM_PROFILE_20 = 1.6 * pow(10, -4); // m^2 +AREA_BEAM_PROFILE_30 = 3.1 * pow(10, -4); // m^2 +AREA_BEAM_PROFILE_40L = 6.1 * pow(10, -4); // m^2 +AREA_BEAM_PROFILE_40H = 9.2 * pow(10, -4); // m^2 +DENSITY_ALUMINIUM = 2700; // kg.m^-3 +DENSITY_HDPE = 950; // kg.m^-3 +DENSITY_STAINLESS_STEEL = 8000; // kg.m^-3 +G = 9.81; // m.s^-2 +SAFETY_FACTOR = 2; +SECOND_MOMENT_OF_AREA_BEAM_20 = 0.7 * pow(10, -8); // m^4 +SECOND_MOMENT_OF_AREA_BEAM_30 = 2.7 * pow(10, -8); // m^4 +SECOND_MOMENT_OF_AREA_BEAM_40L = 11.5 * pow(10, -8); // m^4 +SECOND_MOMENT_OF_AREA_BEAM_40H = 17.7 * pow(10, -8); // m^4 +YIELD_STRESS_ALUMINIUM = 150 * pow(10, 6); // Pa +YIELD_STRESS_HDPE = 25 * pow(10, 6); // Pa +YIELD_STRESS_STAINLESS_STEEL = 200 * pow(10, 6); // Pa +YOUNG_MODULUS_ALUMINIUM = 69 * pow(10, 9); // Pa +YOUNG_MODULUS_HDPE = 1 * pow(10, 9); // Pa +YOUNG_MODULUS_STAINLESS_STEEL = 200 * pow(10, 9); // Pa + + +R_INTERNAL = R_EXTERNAL - D_BEAM_SKELETON * 2 * [1, 1, 1]; +echo("R_INTERNAL: ", R_INTERNAL); +R_SKELETON_BEAM_CENTRES = (R_EXTERNAL + R_INTERNAL) / 2; +echo("R_SKELETON_BEAM_CENTRES: ", R_SKELETON_BEAM_CENTRES); + +OFFSET_X_BASE_BEAM_SUPPORTS = R_SKELETON_BEAM_CENTRES[0] / 2 / COUNT_BASE_SUPPORT_BEAMS_ON_Y; // 200; +echo("OFFSET_X_BASE_BEAM_SUPPORTS: ", OFFSET_X_BASE_BEAM_SUPPORTS); + +BASE_LOAD_FORCE = 500 * G * SAFETY_FACTOR; +echo("BASE_LOAD_FORCE: ", BASE_LOAD_FORCE); + +AREA_BEAM_PROFILE = + (D_BEAM_SKELETON == 20) ? + AREA_BEAM_PROFILE_20 : + (D_BEAM_SKELETON == 30) ? + AREA_BEAM_PROFILE_30 : + (D_BEAM_SKELETON == 40) ? + AREA_BEAM_PROFILE_40H : + AREA_BEAM_PROFILE_20 +; +echo("AREA_BEAM_PROFILE: ", AREA_BEAM_PROFILE); +SECOND_MOMENT_OF_AREA_BEAM = + (D_BEAM_SKELETON == 20) ? + SECOND_MOMENT_OF_AREA_BEAM_20 : + (D_BEAM_SKELETON == 30) ? + SECOND_MOMENT_OF_AREA_BEAM_30 : + (D_BEAM_SKELETON == 40) ? + SECOND_MOMENT_OF_AREA_BEAM_40H : + SECOND_MOMENT_OF_AREA_BEAM_20 +; +echo("SECOND_MOMENT_OF_AREA_BEAM: ", SECOND_MOMENT_OF_AREA_BEAM); + + +T_DOOR = T_HDPE_SHEET + T_GASKET_RUBBER; +echo("T_DOOR: ", T_DOOR, "mm"); + +OFFSET_HINGE_HOLE_CENTRES_X = 34; +echo("OFFSET_HINGE_HOLE_CENTRES_X: ", OFFSET_HINGE_HOLE_CENTRES_X, "mm"); +OFFSET_HINGE_HOLE_CENTRES_Y = R_HINGE[1] - 8 * 2; +echo("OFFSET_HINGE_HOLE_CENTRES_Y: ", OFFSET_HINGE_HOLE_CENTRES_Y, "mm"); + +LENGTH_BOLT_HINGE_ON_CHAMBER = T_WASHER_HINGE + R_HINGE[2] + T_BEAM_SKELETON + R_T_NUT[2] + OFFSET_NUT_FROM_BOLT_END_CHAMBER; +echo("LENGTH_BOLT_HINGE_ON_CHAMBER: ", LENGTH_BOLT_HINGE_ON_CHAMBER, "mm"); +HEIGHT_NUT_HINGE = get_metric_bolt_head_height(SIZE_BOLT_HINGE); +echo("HEIGHT_NUT_HINGE: ", HEIGHT_NUT_HINGE, "mm"); +LENGTH_BOLT_HINGE_ON_DOOR = T_GASKET_RUBBER + T_HDPE_SHEET + T_DOOR_SUPPORT_BEAM + T_WASHER_HINGE + HEIGHT_NUT_HINGE + OFFSET_NUT_FROM_BOLT_END; +echo("LENGTH_BOLT_HINGE_ON_DOOR: ", LENGTH_BOLT_HINGE_ON_DOOR, "mm"); + +HEIGHT_NUT_DOOR_GASKET = get_metric_bolt_head_height(SIZE_BOLT_DOOR_GASKET); +echo("HEIGHT_NUT_DOOR_GASKET: ", HEIGHT_NUT_DOOR_GASKET, "mm"); +LENGTH_BOLT_DOOR_GASKET = T_GASKET_RUBBER + T_HDPE_SHEET + T_DOOR_SUPPORT_BEAM + T_WASHER_DOOR_GASKET + HEIGHT_NUT_DOOR_GASKET + OFFSET_NUT_FROM_BOLT_END; +echo("LENGTH_BOLT_DOOR_GASKET: ", LENGTH_BOLT_DOOR_GASKET, "mm"); + +HEIGHT_NUT_LATCH_TO_PLATE = get_metric_bolt_head_height(SIZE_BOLT_LATCH_TO_PLATE); +echo("HEIGHT_NUT_LATCH_TO_PLATE: ", HEIGHT_NUT_LATCH_TO_PLATE, "mm"); +LENGTH_BOLT_LATCH_TO_PLATE = R_LATCH[2] + R_DOOR_LATCH_SUPPORT_PLATE[2] + T_WASHER_LATCH_TO_PLATE + HEIGHT_NUT_LATCH_TO_PLATE + OFFSET_NUT_FROM_BOLT_END_CHAMBER; +echo("LENGTH_BOLT_LATCH_TO_PLATE: ", LENGTH_BOLT_LATCH_TO_PLATE, "mm"); + +LENGTH_BOLT_LATCH_PLATE_TO_SKELETON = T_WASHER_LATCH_PLATE_TO_SKELETON + R_DOOR_LATCH_SUPPORT_PLATE[2] + T_DOOR_SUPPORT_BEAM + R_T_NUT[2] + OFFSET_NUT_FROM_BOLT_END_CHAMBER; +echo("LENGTH_BOLT_LATCH_PLATE_TO_SKELETON: ", LENGTH_BOLT_LATCH_PLATE_TO_SKELETON, "mm"); + +OFFSET_X_VENTILATION_HOLES = R_INTERNAL[0] / 2; +echo("OFFSET_X_VENTILATION_HOLES: ", OFFSET_X_VENTILATION_HOLES, "mm"); \ No newline at end of file diff --git a/main.scad b/main.scad index c31190c..f108d30 100644 --- a/main.scad +++ b/main.scad @@ -5,13 +5,16 @@ echo(str([1] * 3)); include <./config.scad>; use <./models/glovebox/glovebox.scad>; -/* -include <./models/fixings/square_tube_joint_cross.scad>; -include <./models/fixings/square_tube_joint_n_way.scad>; -include <./models/fixings/square_tube_joint_tee.scad>; -*/ + +// include <./models/fixings/angle_bracket_20_20.scad>; +// include <./models/fixings/mitre_bracket.scad>; +// include <./models/fixings/door_hinge.scad>; +// include <./models/glovebox_door/glovebox_door.scad>; +// include <./models/glovebox_door/door_support_beam.scad>; // Customisable parameters +angle_door_from_closed = 20; // [0:10:270] + /* angle_incline_tiller = 20; // [-20:5:135] angle_brake_rod = 60; // [45:5:60] @@ -20,7 +23,7 @@ angle_brake_rod = 60; // [45:5:60] $fn = 100; // output -glovebox(); // angle_incline_tiller, angle_brake_rod); +glovebox(angle_door_from_closed); /* Shopping @@ -31,8 +34,79 @@ Ventilation system Components */ +echo("Butyl roof and gutter sealant Everbuild everlast"); /* Tools */ -// color("green", 0.4) cube(R_INTERNAL, center = true); \ No newline at end of file +// color("green", 0.4) cube(R_INTERNAL, center = true); + +// Base support beams +load_base_per_beam = BASE_LOAD_FORCE / COUNT_BASE_SUPPORT_BEAMS_ON_Y; +deflection_centre_y_base_beam_centre_load = load_base_per_beam * pow(R_EXTERNAL[1] * pow(10, -3) / (1 + COUNT_FEET_PER_BASE_SUPPORT_BEAM_ON_Y), 3) / 48 / YOUNG_MODULUS_ALUMINIUM / SECOND_MOMENT_OF_AREA_BEAM; +deflection_centre_y_base_beam_udl = load_base_per_beam * pow(R_EXTERNAL[1] * pow(10, -3) / (1 + COUNT_FEET_PER_BASE_SUPPORT_BEAM_ON_Y), 3) * 5 / 384 / YOUNG_MODULUS_ALUMINIUM / SECOND_MOMENT_OF_AREA_BEAM; +base_beam_shear_stress = load_base_per_beam / AREA_BEAM_PROFILE; +von_mises_stress_energy = base_beam_shear_stress * sqrt(3); +// Base support plate +second_moment_of_area_support_plate_x = R_INTERNAL[1] * pow(10, -3) * pow(T_PLATE_SUPPORT * pow(10, -3), 3) / 12; +second_moment_of_area_support_plate_y = R_INTERNAL[0] * pow(10, -3) * pow(T_PLATE_SUPPORT * pow(10, -3), 3) / 12; +deflection_plate_centre_centre_load = BASE_LOAD_FORCE / (COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1) * pow((R_EXTERNAL[0] - OFFSET_X_BASE_BEAM_SUPPORTS * 2) * pow(10, -3) / (COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1) / 2, 3) / 48 / YOUNG_MODULUS_ALUMINIUM / second_moment_of_area_support_plate_x; +deflection_plate_centre_udl = BASE_LOAD_FORCE / (COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1) * pow((R_EXTERNAL[0] - OFFSET_X_BASE_BEAM_SUPPORTS * 2) * pow(10, -3) / (COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1) / 2, 3) * 5 / 384 / YOUNG_MODULUS_ALUMINIUM / second_moment_of_area_support_plate_x; +base_beam_shear_stress_x = load_base_per_beam / R_INTERNAL[1] / T_PLATE_SUPPORT * pow(10, 6); +M_support_plate = DENSITY_ALUMINIUM * T_PLATE_SUPPORT * R_INTERNAL[0] * R_INTERNAL[1] * pow(10, -9); +// Door latch support plates +load_door_latch = 50 * G * SAFETY_FACTOR; +second_moment_of_area_door_latch_support_plate_y = R_DOOR_LATCH_SUPPORT_PLATE[0] * pow(R_DOOR_LATCH_SUPPORT_PLATE[2], 3) / 12 * pow(10, -12); +delection_end_plate_door_latch_support = load_door_latch * pow((R_DOOR_LATCH_SUPPORT_PLATE[1] - D_BEAM_SKELETON) * pow(10, -3), 3) / 3 / YOUNG_MODULUS_STAINLESS_STEEL / second_moment_of_area_door_latch_support_plate_y; // cantilever beam with load at end +shear_stress_y_door_latch_support_plate = load_door_latch / R_DOOR_LATCH_SUPPORT_PLATE[0] / R_DOOR_LATCH_SUPPORT_PLATE[2] * pow(10, 6); +// Door support beams +load_door_support_beam = 20 * G * SAFETY_FACTOR / 2; +second_moment_of_area_door_support_beam = ( + T_DOOR_SUPPORT_BEAM * pow(W_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM * 2, 3) / 12 + + D_DOOR_SUPPORT_BEAM * pow(T_DOOR_SUPPORT_BEAM, 3) / 12 + D_DOOR_SUPPORT_BEAM * T_DOOR_SUPPORT_BEAM * (W_DOOR_SUPPORT_BEAM / 2 + T_DOOR_SUPPORT_BEAM / 2) * 2 + ) * pow(10, -12); +delection_end_door_support_beam = load_door_support_beam * pow((R_EXTERNAL[0] - D_DOOR_SUPPORT_BEAM * 2) * pow(10, -3), 3) / 3 / YOUNG_MODULUS_ALUMINIUM / second_moment_of_area_door_support_beam; // cantilever beam with load at end +area_profile_door_support_beam = (T_DOOR_SUPPORT_BEAM * (W_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM * 2) + 2 * D_DOOR_SUPPORT_BEAM * T_DOOR_SUPPORT_BEAM) * pow(10, -6); +shear_stress_z_door_support_beam = load_door_latch / area_profile_door_support_beam; +// Overall +M_beams_door = DENSITY_ALUMINIUM * area_profile_door_support_beam * 2 * (R_EXTERNAL[0] - D_DOOR_SUPPORT_BEAM + R_EXTERNAL[2] - D_DOOR_SUPPORT_BEAM) * pow(10, -3); +M_beams = DENSITY_ALUMINIUM * AREA_BEAM_PROFILE * ((L_LEG + R_EXTERNAL[2]) * 4 + (R_INTERNAL[0]) * 4 + (R_INTERNAL[1]) * 4 + R_EXTERNAL[1] * COUNT_BASE_SUPPORT_BEAMS_ON_Y + (L_LEG - D_BEAM_SKELETON) * COUNT_BASE_SUPPORT_BEAMS_ON_Y * COUNT_FEET_PER_BASE_SUPPORT_BEAM_ON_Y) * pow(10, -3); + +echo(""); +echo("Base support beams"); +echo("deflection_centre_y_base_beam_centre_load: ", deflection_centre_y_base_beam_centre_load * pow(10, 3), "mm"); +echo("deflection_centre_y_base_beam_udl: ", deflection_centre_y_base_beam_udl * pow(10, 3), "mm"); +echo("base_beam_shear_stress: ", base_beam_shear_stress * pow(10, -6), "MPa"); +echo("von_mises_stress_energy: ", von_mises_stress_energy * pow(10, -6), "MPa"); +echo("Safe stress limit (Aluminium): ", YIELD_STRESS_ALUMINIUM * pow(10, -6), "MPa"); +echo(""); +echo("Base support plate"); +echo("second_moment_of_area_support_plate_x: ", second_moment_of_area_support_plate_x * pow(10, 12), "mm^4"); +echo("second_moment_of_area_support_plate_y: ", second_moment_of_area_support_plate_y * pow(10, 12), "mm^4"); +echo("deflection_plate_centre_centre_load: ", deflection_plate_centre_centre_load * pow(10, 3), "mm"); +echo("deflection_plate_centre_udl: ", deflection_plate_centre_udl * pow(10, 3), "mm"); +echo("base_beam_shear_stress_x: ", base_beam_shear_stress_x * pow(10, -6), "MPa"); +echo("Safe stress limit (ALUMINIUM): ", YIELD_STRESS_ALUMINIUM * pow(10, -6), "MPa"); +echo("M_support_plate: ", M_support_plate, "kg"); +echo(""); +echo("Door latch support plates"); +echo("load_door_latch: ", load_door_latch, "N"); +echo("second_moment_of_area_door_latch_support_plate_y: ", second_moment_of_area_door_latch_support_plate_y * pow(10, 12), "mm^4"); +echo("delection_end_plate_door_latch_support: ", delection_end_plate_door_latch_support * pow(10, 3), "mm"); +echo("shear_stress_y_door_latch_support_plate: ", shear_stress_y_door_latch_support_plate * pow(10, -6), "MPa"); +echo("Safe stress limit (Stainless Steel): ", YIELD_STRESS_STAINLESS_STEEL * pow(10, -6), "MPa"); +echo(""); +echo("Door support beams"); +echo("load_door_support_beam: ", load_door_support_beam, "N"); +echo("second_moment_of_area_door_support_beam: ", second_moment_of_area_door_support_beam * pow(10, 12), "mm^4"); +echo("delection_end_door_support_beam: ", delection_end_door_support_beam * pow(10, 3), "mm"); +echo("shear_stress_z_door_support_beam: ", shear_stress_z_door_support_beam * pow(10, -6), "MPa"); +echo("Safe stress limit (Aluminium): ", YIELD_STRESS_ALUMINIUM * pow(10, -6), "MPa"); +echo(""); +echo("Overall"); +echo("M_beams_door: ", M_beams_door, "kg"); +echo("M_beams: ", M_beams, "kg"); + +echo("YM / D ALUMINIUM: ", YOUNG_MODULUS_ALUMINIUM / DENSITY_ALUMINIUM); +echo("YM / D HDPE: ", YOUNG_MODULUS_HDPE / DENSITY_HDPE); +echo("YM / D STAINLESS_STEEL: ", YOUNG_MODULUS_STAINLESS_STEEL / DENSITY_STAINLESS_STEEL); \ No newline at end of file diff --git a/models/common/beam_hexagonal.scad b/models/common/beam_hexagonal.scad new file mode 100644 index 0000000..aaecfab --- /dev/null +++ b/models/common/beam_hexagonal.scad @@ -0,0 +1,13 @@ +// include <../../config.scad>; + +module beam_hexagonal(L, d, centre = true, suppress_shopping_outputs = false) { + radius = d / 2; + linear_extrude(L, center = centre) polygon([[radius, 0], [radius * cos(60), radius * sin(60)], [radius * cos(120), radius * sin(120)], [radius * cos(180), radius * sin(180)], [radius * cos(240), radius * sin(240)], [radius * cos(300), radius * sin(300)]]); + // Shopping + if (!suppress_shopping_outputs) { + echo(str("Hexagonal beam: Hexagonal beam Φ", d, "mm x ", L, "mm - x1")); + } +} + +// $fn = 200; +beam_hexagonal(500, 50); \ No newline at end of file diff --git a/models/common/br_t_nut.scad b/models/common/br_t_nut.scad new file mode 100644 index 0000000..d82ae6a --- /dev/null +++ b/models/common/br_t_nut.scad @@ -0,0 +1,17 @@ +// include <../../config.scad>; + +module br_t_nut(centre = true) { + difference() { + union() { + translate([0, 0, 3.2 / 2]) cube([5.7, 11.5, 3.2], center = true); + translate([0, 0, -1 / 2]) cube([5.7, 5.7, 1], center = true); + } + cylinder(20, 4 / 2, 4 / 2, center = true); + } + // Shopping + echo(str("BR T Nut: BR T Nut M4 - x1")); +} + +// $fn = 50; +// Outputs +br_t_nut(); \ No newline at end of file diff --git a/models/common/br_t_nut.stl b/models/common/br_t_nut.stl new file mode 100644 index 0000000..ff36f88 Binary files /dev/null and b/models/common/br_t_nut.stl differ diff --git a/models/common/c_channel_beam.scad b/models/common/c_channel_beam.scad new file mode 100644 index 0000000..38d1de0 --- /dev/null +++ b/models/common/c_channel_beam.scad @@ -0,0 +1,15 @@ + + +module c_channel_beam(length, width, depth, thickness, suppress_shopping_outputs = false) { + translate([-width / 2, 0, -length / 2]) difference() { + cube([width, depth, length], center = false); + translate([thickness, thickness, 0]) cube([width - thickness * 2, depth - thickness, length], center = false); + translate([0, depth, 0]) cube([width, thickness, length], center = false); + } + // Shopping + if (!suppress_shopping_outputs) { + echo(str("Rectangular Aluminium channel beam: Rectangular Aluminium channel beam ", length, "mm x ", width, "mm x ", depth, "mm x ", thickness, "mm - x1")); + } +} + +c_channel_beam(500, 19, 19, 1.6); \ No newline at end of file diff --git a/models/common/metric_bolt.scad b/models/common/metric_bolt.scad new file mode 100644 index 0000000..8df0816 --- /dev/null +++ b/models/common/metric_bolt.scad @@ -0,0 +1,28 @@ +// include <../../config.scad>; +use <./beam_hexagonal.scad>; +use <./metric_bolt_functions.scad>; +use <./metric_nut.scad>; + +module metric_bolt(size, length, has_nut = true, offset_nut_from_end = 0) { + echo("Metric bolt assembly:"); + head_height = get_metric_bolt_head_height(size); + head_diameter = get_metric_bolt_head_diameter(size); + head_radius = head_diameter / 2; + color("gray") union() { + // Stem + cylinder(length, size / 2, head_height / 2, center = true); + // Head + translate([0, 0, length / 2 + head_height / 2]) beam_hexagonal(head_height, head_diameter, centre = true, suppress_shopping_outputs = true); + if (has_nut) { + // Nut + translate([0, 0, -(length / 2 - head_height / 2) + offset_nut_from_end]) metric_nut(size); + } + } + // Shopping + echo(str("Bolt: Bolt M", size, " x ", length, "mm - x1")); +} + +// $fn = 200; +metric_bolt(12, 100); +translate([30, 0, 0]) metric_bolt(12, 100, false); +translate([60, 0, 0]) metric_bolt(12, 100, true, 5); \ No newline at end of file diff --git a/models/common/metric_bolt_functions.scad b/models/common/metric_bolt_functions.scad new file mode 100644 index 0000000..67374a3 --- /dev/null +++ b/models/common/metric_bolt_functions.scad @@ -0,0 +1,9 @@ + +function get_metric_bolt_head_height(size) = size; +function get_metric_bolt_head_diameter(size) = size * 2; +function get_metric_bolt_washer_diameter_safe_working_clearance(size) = + (size < 20) ? + 4 * size + : + 3 * size +; \ No newline at end of file diff --git a/models/common/metric_countersunk_head_bolt.scad b/models/common/metric_countersunk_head_bolt.scad new file mode 100644 index 0000000..d56cd69 --- /dev/null +++ b/models/common/metric_countersunk_head_bolt.scad @@ -0,0 +1,33 @@ +// include <../../config.scad>; +use <./beam_hexagonal.scad>; +use <./metric_countersunk_head_bolt_functions.scad>; +use <./metric_bolt_functions.scad>; +use <./metric_nut.scad>; + +module metric_countersunk_head_bolt(size, length, has_nut = true, offset_nut_from_end = 0) { + echo("Metric countersunk head bolt assembly:"); + head_height = get_metric_countersunk_head_bolt_head_height(size); + head_diameter = get_metric_countersunk_head_bolt_head_diameter(size); + nut_height = get_metric_bolt_head_height(size); + color("gray") union() { + // Stem + cylinder(length, size / 2, size / 2, center = true); + // Head + translate([0, 0, length / 2 + head_height / 2]) difference() { + cylinder(head_height, size / 2, head_diameter / 2, center = true); + translate([0, 0, head_height / 2 - head_diameter / 10 / 2]) cube([head_diameter / 5, head_diameter, head_diameter / 10], center = true); + } + if (has_nut) { + // Nut + translate([0, 0, -(length / 2 - nut_height / 2) + offset_nut_from_end]) metric_nut(size); + } + } + // Shopping + echo(str("Bolt: Countersunk head bolt M", size, " x ", length, "mm - x1")); +} + +// $fn = 200; +metric_countersunk_head_bolt(4, 40); +translate([30, 0, 0]) metric_countersunk_head_bolt(12, 200, false); +translate([60, 0, 0]) metric_countersunk_head_bolt(12, 200, true, 10); +translate([90, 0, 0]) metric_countersunk_head_bolt(12, 100, true, 5); \ No newline at end of file diff --git a/models/common/metric_countersunk_head_bolt_functions.scad b/models/common/metric_countersunk_head_bolt_functions.scad new file mode 100644 index 0000000..4158a90 --- /dev/null +++ b/models/common/metric_countersunk_head_bolt_functions.scad @@ -0,0 +1,9 @@ + +function get_metric_countersunk_head_bolt_head_height(size) = size / 2; +function get_metric_countersunk_head_bolt_head_diameter(size) = size * 2; +function get_metric_countersunk_head_bolt_washer_diameter_safe_working_clearance(size) = + (size < 20) ? + 4 * size + : + 3 * size +; \ No newline at end of file diff --git a/models/common/metric_nut.scad b/models/common/metric_nut.scad new file mode 100644 index 0000000..a91ec8b --- /dev/null +++ b/models/common/metric_nut.scad @@ -0,0 +1,20 @@ +// include <../../config.scad>; +use <./beam_hexagonal.scad>; +use <./metric_bolt_functions.scad>; + +module metric_nut(size, centre = true) { + height = get_metric_bolt_head_height(size); + diameter = get_metric_bolt_head_diameter(size); + radius = diameter / 2; + color("gray") difference() { + // body + beam_hexagonal(height, diameter, centre = centre, suppress_shopping_outputs = true); + // hole + cylinder(height, size / 2, size / 2, center = centre); + } + // Shopping + echo(str("Nut: Nut M", size, " - x1")); +} + +// $fn = 200; +metric_nut(12); \ No newline at end of file diff --git a/models/common/washer.scad b/models/common/washer.scad new file mode 100644 index 0000000..6dabd5d --- /dev/null +++ b/models/common/washer.scad @@ -0,0 +1,15 @@ +include <../../config.scad>; + +module washer(t, d_outer, d_inner, centre = true) { + r_outer = d_outer / 2; + r_inner = d_inner / 2; + color("silver") difference() { + cylinder(t, r_outer, r_outer, center = centre); + cylinder(t, r_inner, r_inner, center = centre); + } + // Shopping + echo(str("Washer: Washer Φ", d_outer, "mm x ", d_inner, "mm x ", t, "mm - x1")); +} + +// $fn = 200; +washer(3, 10, 40); \ No newline at end of file diff --git a/models/fixings/angle_bracket_20_20.scad b/models/fixings/angle_bracket_20_20.scad new file mode 100644 index 0000000..b06f06b --- /dev/null +++ b/models/fixings/angle_bracket_20_20.scad @@ -0,0 +1,18 @@ + +include <../../config.scad>; + +module angle_bracket_20_20() { + color("gray") difference() { + translate([0, 18 / 2, 0]) rotate([90, 0, 0]) cube(18, center = false); + translate([0, 18 / 2, 0]) rotate([90, 0, 0]) translate([0, 18, 0]) rotate([0, 0, -45]) cube(18 * 2, center = false); + translate([3, -12 / 2, 3]) cube([15, 12, 12], center = false); + // bolt slots + translate([0, -4.3 / 2, 14 - 7]) cube([3, 4.3, 7], center = false); + translate([14 - 7, -4.3 / 2, 0]) cube([7, 4.3, 3], center = false); + } + // Shopping + echo(str("Angle bracket: Angle bracket 20mm x 20mm - x1")); +} + +// test output +angle_bracket_20_20(); \ No newline at end of file diff --git a/models/fixings/angle_bracket_20_20.stl b/models/fixings/angle_bracket_20_20.stl new file mode 100644 index 0000000..dd7ef12 Binary files /dev/null and b/models/fixings/angle_bracket_20_20.stl differ diff --git a/models/fixings/door_hinge.scad b/models/fixings/door_hinge.scad new file mode 100644 index 0000000..77eb9e7 --- /dev/null +++ b/models/fixings/door_hinge.scad @@ -0,0 +1,43 @@ + +include <../../config.scad>; + +module door_hinge_half() { + diameter_hole_bottom = SIZE_BOLT_HINGE; + diameter_hole_top = 7; + + color("gray") difference() { + // body + translate([-R_HINGE[0] / 2, 0, 0]) cube([R_HINGE[0], R_HINGE[1] / 2, R_HINGE[2]], center = false); + // bolt holes + for (index_hole = [0 : 1 : 1]) { + mirror([index_hole, 0, 0]) { + // through hole + translate([OFFSET_HINGE_HOLE_CENTRES_X / 2, OFFSET_HINGE_HOLE_CENTRES_Y / 2, 0]) cylinder(R_HINGE[2] / 2, diameter_hole_bottom / 2, diameter_hole_bottom / 2, center = false); + // tapered hole + translate([OFFSET_HINGE_HOLE_CENTRES_X / 2, OFFSET_HINGE_HOLE_CENTRES_Y / 2, R_HINGE[2] / 2]) cylinder(R_HINGE[2] / 2, diameter_hole_bottom / 2, diameter_hole_top / 2, center = false); + } + } + } + // Shopping +} +module door_hinge(angle_from_closed) { + color("gray") union() { + // hinge bearing axis + translate([0, 0, R_HINGE[2]]) rotate([0, 90, 0]) cylinder(R_HINGE[0], R_HINGE[2] * 2, R_HINGE[2] * 2, center = true); + // door flanges + for (index_hinge_half = [0 : 1 : 1]) { + // mirror([0, index_hinge_half, 0]) { + rotate([index_hinge_half == 0 ? 0 : 180 - angle_from_closed, 0, 0]) rotate([0, 0, index_hinge_half == 0 ? 0 : 180]) + // door_hinge_half(); + import("./door_hinge_half.stl"); + } + } + // Shopping + echo(str("Door hinge: Stainless steel door hinge - x1")); +} + +// test output +$fn = 25; + +// door_hinge_half(); +door_hinge(180); diff --git a/models/fixings/door_hinge_half.stl b/models/fixings/door_hinge_half.stl new file mode 100644 index 0000000..d826017 Binary files /dev/null and b/models/fixings/door_hinge_half.stl differ diff --git a/models/fixings/mitre_bracket.scad b/models/fixings/mitre_bracket.scad new file mode 100644 index 0000000..9e470e1 --- /dev/null +++ b/models/fixings/mitre_bracket.scad @@ -0,0 +1,16 @@ + +include <../../config.scad>; + +module mitre_bracket() { + color("gray") + // translate([0, 0, -3 / 2]) + difference() { + cube([46, 46, 3], center = false); + translate([6, 6, 0]) cube([40, 40, 3], center = false); + } + // Shopping + echo(str("Mitre bracket: Mitre bracket - x1")); +} + +// test output +mitre_bracket(); \ No newline at end of file diff --git a/models/fixings/mitre_bracket.stl b/models/fixings/mitre_bracket.stl new file mode 100644 index 0000000..aa46dd5 Binary files /dev/null and b/models/fixings/mitre_bracket.stl differ diff --git a/models/fixings/square_tube_joint_cross.scad b/models/fixings/square_tube_joint_cross.scad deleted file mode 100644 index 752e592..0000000 --- a/models/fixings/square_tube_joint_cross.scad +++ /dev/null @@ -1,17 +0,0 @@ - -include <../../config.scad>; - -module square_tube_joint_cross(tube_diameter, tube_thickness) { - length_peg = 2 * tube_diameter; - union() { - color("black") cube(tube_diameter, center = true); - for (index_peg = [0 : 1 : 3]) { - color("gray") rotate([0, 0, 90 * index_peg]) translate([tube_diameter / 2 + length_peg / 2, 0, 0]) cube([length_peg, tube_diameter - tube_thickness * 2, tube_diameter - tube_thickness * 2], center = true); - } - } - // Shopping - echo(str("Square tube joint: Tube joint Φ", tube_diameter, "mm cross - x1")); -} - -// test output -square_tube_joint_cross(D_BEAM_SKELETON, T_BEAM_SKELETON); \ No newline at end of file diff --git a/models/fixings/square_tube_joint_n_way.scad b/models/fixings/square_tube_joint_n_way.scad deleted file mode 100644 index 6d46ffe..0000000 --- a/models/fixings/square_tube_joint_n_way.scad +++ /dev/null @@ -1,40 +0,0 @@ -/* -include <../../config.scad>; -use <./tube_clamp_round_3_way_through_116_functions.scad>; -*/ - -module square_tube_joint_n_way(tube_diameter, tube_thickness, n_pegs) { - length_peg = 2 * tube_diameter; - union() { - color("black") cube(tube_diameter, center = true); - /* - // Method 1: no good - for (index_peg = [0 : 1 : n_pegs - 1]) { - color("gray") rotate([0, 0, 90 * index_peg]) translate([tube_diameter / 2 + length_peg / 2, 0, 0]) cube([length_peg, tube_diameter - tube_thickness * 2, tube_diameter - tube_thickness * 2], center = true); - } - */ - if (n_pegs >= 2) { - for (index_peg = [0 : 1 : 1]) { - color("gray") rotate([0, 0, 90 * index_peg]) translate([tube_diameter / 2 + length_peg / 2, 0, 0]) cube([length_peg, tube_diameter - tube_thickness * 2, tube_diameter - tube_thickness * 2], center = true); - } - } - if (n_pegs >= 3) { - for (index_peg = [0 : 1 : (n_pegs == 3 ? 0 : 1)]) { - color("gray") mirror([0, 0, index_peg]) translate([0, 0, tube_diameter / 2 + length_peg / 2]) cube([tube_diameter - tube_thickness * 2, tube_diameter - tube_thickness * 2, length_peg], center = true); - } - } - if (n_pegs >= 5) { - color("gray") translate([0, -(tube_diameter / 2 + length_peg / 2), 0]) cube([tube_diameter - tube_thickness * 2, length_peg, tube_diameter - tube_thickness * 2], center = true); - } - } - // Shopping - echo(str("Square tube joint: Tube joint Φ", tube_diameter, "mm ", n_pegs, "-Way - x1")); -} - -// test output -// square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, 5); -// translate([200, 0, 0]) square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, 3); - -for (count_pegs = [2 : 1 : 5]) { - translate([100 * count_pegs, 0, 0]) square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, count_pegs); -} \ No newline at end of file diff --git a/models/fixings/square_tube_joint_tee.scad b/models/fixings/square_tube_joint_tee.scad deleted file mode 100644 index 888511e..0000000 --- a/models/fixings/square_tube_joint_tee.scad +++ /dev/null @@ -1,17 +0,0 @@ - -include <../../config.scad>; - -module square_tube_joint_tee(tube_diameter, tube_thickness) { - length_peg = 2 * tube_diameter; - union() { - color("black") cube(tube_diameter, center = true); - for (index_peg = [0 : 1 : 2]) { - color("gray") rotate([0, 0, 90 * index_peg]) translate([tube_diameter / 2 + length_peg / 2, 0, 0]) cube([length_peg, tube_diameter - tube_thickness * 2, tube_diameter - tube_thickness * 2], center = true); - } - } - // Shopping - echo(str("Square tube joint: Tube joint Φ", tube_diameter, "mm tee - x1")); -} - -// test output -translate([100, 0, 50 ]) square_tube_joint_tee(D_BEAM_SKELETON, T_BEAM_SKELETON); \ No newline at end of file diff --git a/models/glovebox/glovebox.scad b/models/glovebox/glovebox.scad index 730b2bf..6822394 100644 --- a/models/glovebox/glovebox.scad +++ b/models/glovebox/glovebox.scad @@ -1,22 +1,20 @@ // Molly Dog Towing Cart include <../../config.scad>; -use <../skeleton/skeleton.scad>; -use <../skin/skin.scad>; +use <../glovebox_shell/glovebox_shell.scad>; use <../ventilation_system/ventilation_system.scad>; -module glovebox() { +module glovebox(angle_door_from_closed) { echo("Glovebox assembly:"); - // Skin - skin(); - // Skeleton - skeleton(); - // Ventilation system - ventilation_system(); + union() { + // Shell + glovebox_shell(angle_door_from_closed); + // Ventilation system + ventilation_system(); + } // Shopping - // Skin - // Skeleton + // Shell // Ventilation system } diff --git a/models/glovebox_door/door_gasket.scad b/models/glovebox_door/door_gasket.scad new file mode 100644 index 0000000..9cd4fd1 --- /dev/null +++ b/models/glovebox_door/door_gasket.scad @@ -0,0 +1,13 @@ + +include <../../config.scad> + +module door_gasket() { + color("black") difference() { + cube([R_EXTERNAL[0], R_EXTERNAL[2], T_GASKET_RUBBER], center = true); + cube([R_EXTERNAL[0] - 2 * W_DOOR_GASKET, R_EXTERNAL[2] - 2 * W_DOOR_GASKET, T_GASKET_RUBBER], center = true); + } + // Shopping +} + +// test output +door_gasket(); \ No newline at end of file diff --git a/models/glovebox_door/door_gasket.stl b/models/glovebox_door/door_gasket.stl new file mode 100644 index 0000000..55028ad Binary files /dev/null and b/models/glovebox_door/door_gasket.stl differ diff --git a/models/glovebox_door/door_support_beam.scad b/models/glovebox_door/door_support_beam.scad new file mode 100644 index 0000000..9cfce70 --- /dev/null +++ b/models/glovebox_door/door_support_beam.scad @@ -0,0 +1,12 @@ + +include <../../config.scad> +use <../common/c_channel_beam.scad>; + +module door_support_beam(length) { + + color("darkgrey") c_channel_beam(length, W_DOOR_SUPPORT_BEAM, D_DOOR_SUPPORT_BEAM, T_DOOR_SUPPORT_BEAM, true); + // Shopping + echo(str("Rectangular Aluminium channel beam: Rectangular Aluminium channel beam ", length, "mm x ", W_DOOR_SUPPORT_BEAM, "mm x ", D_DOOR_SUPPORT_BEAM, "mm x ", T_DOOR_SUPPORT_BEAM, "mm - x1")); +} + +door_support_beam(500); \ No newline at end of file diff --git a/models/glovebox_door/door_support_beam_on_x.stl b/models/glovebox_door/door_support_beam_on_x.stl new file mode 100644 index 0000000..59ec50e Binary files /dev/null and b/models/glovebox_door/door_support_beam_on_x.stl differ diff --git a/models/glovebox_door/door_support_beam_on_y.stl b/models/glovebox_door/door_support_beam_on_y.stl new file mode 100644 index 0000000..ca479f3 Binary files /dev/null and b/models/glovebox_door/door_support_beam_on_y.stl differ diff --git a/models/glovebox_door/glove_gasket.scad b/models/glovebox_door/glove_gasket.scad new file mode 100644 index 0000000..ee7c9ca --- /dev/null +++ b/models/glovebox_door/glove_gasket.scad @@ -0,0 +1,20 @@ + +include <../../config.scad>; +use <./glove_gasket_holes.scad>; + +module glove_gasket() { + color("black") difference() { + // Body + cylinder(T_GASKET_RUBBER, D_GLOVE_HOLE / 2 + W_DOOR_GASKET, D_GLOVE_HOLE / 2 + W_DOOR_GASKET, center = true); + // Arm hole + cylinder(T_GASKET_RUBBER, D_GLOVE_HOLE / 2, D_GLOVE_HOLE / 2, center = true); + // Fastener holes + glove_gasket_holes(); + } + // Shopping + echo(str("EDPM rubber: Vent Gasket ", D_GLOVE_HOLE + W_DOOR_GASKET * 2, "mm x ", D_GLOVE_HOLE + W_DOOR_GASKET * 2, "mm - x1")); +} + +$fn = 250; +// test output +glove_gasket(); \ No newline at end of file diff --git a/models/glovebox_door/glove_gasket.stl b/models/glovebox_door/glove_gasket.stl new file mode 100644 index 0000000..0ba54d7 Binary files /dev/null and b/models/glovebox_door/glove_gasket.stl differ diff --git a/models/glovebox_door/glove_gasket_holes.scad b/models/glovebox_door/glove_gasket_holes.scad new file mode 100644 index 0000000..5a427e2 --- /dev/null +++ b/models/glovebox_door/glove_gasket_holes.scad @@ -0,0 +1,14 @@ + +include <../../config.scad>; + +module glove_gasket_holes() { + for (index_hole = [0 : 1 : COUNT_BOLTS_PER_GLOVE - 1]) { + rotate([0, 0, 360 / COUNT_BOLTS_PER_GLOVE * index_hole]) translate([0, D_GLOVE_HOLE / 2 + W_DOOR_GASKET / 2, 0]) + // rotate([90, 0, 0]) + cylinder(T_HDPE_SHEET + T_GASKET_RUBBER, SIZE_BOLT_GLOVE / 2, SIZE_BOLT_GLOVE / 2, center = true); + } + // Shopping +} + +// test output +glove_gasket_holes(); \ No newline at end of file diff --git a/models/glovebox_door/glovebox_door.scad b/models/glovebox_door/glovebox_door.scad new file mode 100644 index 0000000..b534d87 --- /dev/null +++ b/models/glovebox_door/glovebox_door.scad @@ -0,0 +1,211 @@ + +include <../../config.scad>; +use <./door_support_beam.scad>; +use <./glove_gasket_holes.scad>; +use <../common/metric_bolt_functions.scad>; +use <../common/metric_countersunk_head_bolt.scad>; +use <../common/washer.scad>; + +module glovebox_door() { + union() { + difference() { + union() { + /* + difference() { + // clear panel + // color("white", 0.4) + color("black") + translate([0, -R_EXTERNAL[2] / 2, -T_HDPE_SHEET / 2]) cube([R_EXTERNAL[0], R_EXTERNAL[2], T_HDPE_SHEET], center = true); + for (index_side = [0 : 1 : 1]) { + mirror([index_side, 0, 0]) { + translate([ + OFFSET_GLOVE_HOLE_CENTRES_X / 2 + , -R_EXTERNAL[2] * 3 / 4 + , -T_HDPE_SHEET / 2 + ]){ + // Glove holes + cylinder(T_HDPE_SHEET, D_GLOVE_HOLE / 2, D_GLOVE_HOLE / 2, center = true); + // Gasket fastener holes + glove_gasket_holes(); + } + } + } + } + */ + color("white", 0.4) import("./glovebox_door_panel_only.stl"); + // gasket + color("black") translate([ + 0 + , -R_EXTERNAL[2] / 2 + , -(T_HDPE_SHEET + T_GASKET_RUBBER / 2) + ]) + import("./door_gasket.stl"); + // Glove gasket + color("black") for (index_side = [0 : 1 : 1]) { + mirror([index_side, 0, 0]) { + translate([ + OFFSET_GLOVE_HOLE_CENTRES_X / 2 + , -R_EXTERNAL[2] * 3 / 4 + , -T_HDPE_SHEET - T_GASKET_RUBBER / 2 + ]) + import("./glove_gasket.stl"); + } + } + /* + // Glove holding peg - CAN JUST INVERT THE GLOVES + translate([0, -100, -100 / 2]) cylinder(100, 12, 12, center = true); + */ + // Support beams + color("darkgrey") { + // Top + translate([ + D_DOOR_SUPPORT_BEAM / 2 + , -D_DOOR_SUPPORT_BEAM + , W_DOOR_SUPPORT_BEAM / 2 + ]) rotate([0, 90, 0]) + // door_support_beam(R_EXTERNAL[0] - D_DOOR_SUPPORT_BEAM); + import("./door_support_beam_on_x.stl"); + // Bottom + translate([ + -D_DOOR_SUPPORT_BEAM / 2 + , -R_EXTERNAL[2] + D_DOOR_SUPPORT_BEAM + , W_DOOR_SUPPORT_BEAM / 2 + ]) rotate([0, 90, 180]) + // door_support_beam(R_EXTERNAL[0] - D_DOOR_SUPPORT_BEAM); + import("./door_support_beam_on_x.stl"); + // Left + translate([ + -(R_EXTERNAL[0] / 2 - W_DOOR_SUPPORT_BEAM / 2) + , -(R_EXTERNAL[2] - D_DOOR_SUPPORT_BEAM) / 2 + , W_DOOR_SUPPORT_BEAM / 2 + ]) rotate([90, -90, 0]) + // door_support_beam(R_EXTERNAL[2] - D_DOOR_SUPPORT_BEAM); + import("./door_support_beam_on_y.stl"); + // Right + translate([ + R_EXTERNAL[0] / 2 - W_DOOR_SUPPORT_BEAM / 2 + , -R_EXTERNAL[2] / 2 - D_DOOR_SUPPORT_BEAM / 2 + , W_DOOR_SUPPORT_BEAM / 2 + ]) rotate([90, 90, 0]) + // door_support_beam(R_EXTERNAL[2] - D_DOOR_SUPPORT_BEAM); + import("./door_support_beam_on_y.stl"); + } + } + // Bolt holes + // Top + for (index_hole_on_x = [0 : 1 : COUNT_BOLTS_PER_DOOR_GASKET_ON_X_TOP - 1]) { + translate([ + R_EXTERNAL[0] / 2 - OFFSET_BOLTS_FROM_SEAL_END - (R_EXTERNAL[0] - D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END * 2) / (COUNT_BOLTS_PER_DOOR_GASKET_ON_X_TOP - 1) * index_hole_on_x + , -(D_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM) / 2 + , 0 + ]) + cylinder(W_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM * 2, SIZE_BOLT_DOOR_GASKET / 2, SIZE_BOLT_DOOR_GASKET / 2, center = true); + } + // Bottom + for (index_hole_on_x = [0 : 1 : COUNT_BOLTS_PER_DOOR_GASKET_ON_X_BOTTOM - 1]) { + translate([ + -(R_EXTERNAL[0] / 2 - OFFSET_BOLTS_FROM_SEAL_END - (R_EXTERNAL[0] - D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END * 2) / (COUNT_BOLTS_PER_DOOR_GASKET_ON_X_BOTTOM - 1) * index_hole_on_x) + , -R_EXTERNAL[1] + (D_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM) / 2 + , 0 + ]) + cylinder(W_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM * 2, SIZE_BOLT_DOOR_GASKET / 2, SIZE_BOLT_DOOR_GASKET / 2, center = true); + } + for (index_hole_on_z = [0 : 1 : COUNT_BOLTS_PER_DOOR_GASKET_ON_Z - 1]) { + // Right + translate([ + R_EXTERNAL[0] / 2 - (D_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM) / 2 + , -D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END - (R_EXTERNAL[1] - D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END * 2) / (COUNT_BOLTS_PER_DOOR_GASKET_ON_Z - 1) * index_hole_on_z + , 0 + ]) + cylinder(W_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM * 2, SIZE_BOLT_DOOR_GASKET / 2, SIZE_BOLT_DOOR_GASKET / 2, center = true); + // Left + translate([ + -(R_EXTERNAL[0] / 2 - (D_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM) / 2) + , -OFFSET_BOLTS_FROM_SEAL_END - (R_EXTERNAL[1] - D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END * 2) / (COUNT_BOLTS_PER_DOOR_GASKET_ON_Z - 1) * index_hole_on_z + , 0 + ]) + cylinder(W_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM * 2, SIZE_BOLT_DOOR_GASKET / 2, SIZE_BOLT_DOOR_GASKET / 2, center = true); + } + } + // Bolts + // Door seal + // Top + for (index_hole_on_x = [0 : 1 : COUNT_BOLTS_PER_DOOR_GASKET_ON_X_TOP - 1]) { + translate([ + D_DOOR_SUPPORT_BEAM -(R_EXTERNAL[0] / 2 - OFFSET_BOLTS_FROM_SEAL_END - (R_EXTERNAL[0] - D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END * 2) / (COUNT_BOLTS_PER_DOOR_GASKET_ON_X_TOP - 1) * index_hole_on_x) + , -(D_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM) / 2 + , 0 + ]) { + // Bolt and nut + translate([0, 0, LENGTH_BOLT_DOOR_GASKET / 2 - T_HDPE_SHEET - T_GASKET_RUBBER]) mirror([0, 0, 1]) metric_countersunk_head_bolt(SIZE_BOLT_DOOR_GASKET, LENGTH_BOLT_DOOR_GASKET, true, OFFSET_NUT_FROM_BOLT_END); + // Washer + translate([0, 0, T_DOOR_SUPPORT_BEAM + T_WASHER_DOOR_GASKET / 2]) washer(T_WASHER_DOOR_GASKET, D_WASHER_DOOR_GASKET, SIZE_BOLT_DOOR_GASKET, centre = true); + } + } + // Bottom + for (index_hole_on_x = [0 : 1 : COUNT_BOLTS_PER_DOOR_GASKET_ON_X_BOTTOM - 1]) { + translate([ + -(R_EXTERNAL[0] / 2 - OFFSET_BOLTS_FROM_SEAL_END - (R_EXTERNAL[0] - D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END * 2) / (COUNT_BOLTS_PER_DOOR_GASKET_ON_X_BOTTOM - 1) * index_hole_on_x) + , -R_EXTERNAL[1] + (D_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM) / 2 + , 0 + ]) { + // Bolt and nut + translate([0, 0, LENGTH_BOLT_DOOR_GASKET / 2 - T_HDPE_SHEET - T_GASKET_RUBBER]) mirror([0, 0, 1]) metric_countersunk_head_bolt(SIZE_BOLT_DOOR_GASKET, LENGTH_BOLT_DOOR_GASKET, true, OFFSET_NUT_FROM_BOLT_END); + // Washer + translate([0, 0, T_DOOR_SUPPORT_BEAM + T_WASHER_DOOR_GASKET / 2]) washer(T_WASHER_DOOR_GASKET, D_WASHER_DOOR_GASKET, SIZE_BOLT_DOOR_GASKET, centre = true); + } + } + for (index_hole_on_z = [0 : 1 : COUNT_BOLTS_PER_DOOR_GASKET_ON_Z - 1]) { + // Right + translate([ + R_EXTERNAL[0] / 2 - (D_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM) / 2 + , -D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END - (R_EXTERNAL[1] - D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END * 2) / (COUNT_BOLTS_PER_DOOR_GASKET_ON_Z - 1) * index_hole_on_z + , 0 + ]) { + // Bolt and nut + translate([0, 0, LENGTH_BOLT_DOOR_GASKET / 2 - T_HDPE_SHEET - T_GASKET_RUBBER]) mirror([0, 0, 1]) metric_countersunk_head_bolt(SIZE_BOLT_DOOR_GASKET, LENGTH_BOLT_DOOR_GASKET, true, OFFSET_NUT_FROM_BOLT_END); + // Washer + translate([0, 0, T_DOOR_SUPPORT_BEAM + T_WASHER_DOOR_GASKET / 2]) washer(T_WASHER_DOOR_GASKET, D_WASHER_DOOR_GASKET, SIZE_BOLT_DOOR_GASKET, centre = true); + } + // Left + translate([ + -(R_EXTERNAL[0] / 2 - (D_DOOR_SUPPORT_BEAM - T_DOOR_SUPPORT_BEAM) / 2) + , -OFFSET_BOLTS_FROM_SEAL_END - (R_EXTERNAL[1] - D_DOOR_SUPPORT_BEAM - OFFSET_BOLTS_FROM_SEAL_END * 2) / (COUNT_BOLTS_PER_DOOR_GASKET_ON_Z - 1) * index_hole_on_z + , 0 + ]) { + // Bolt and nut + translate([0, 0, LENGTH_BOLT_DOOR_GASKET / 2 - T_HDPE_SHEET - T_GASKET_RUBBER]) mirror([0, 0, 1]) metric_countersunk_head_bolt(SIZE_BOLT_DOOR_GASKET, LENGTH_BOLT_DOOR_GASKET, true, OFFSET_NUT_FROM_BOLT_END); + // Washer + translate([0, 0, T_DOOR_SUPPORT_BEAM + T_WASHER_DOOR_GASKET / 2]) washer(T_WASHER_DOOR_GASKET, D_WASHER_DOOR_GASKET, SIZE_BOLT_DOOR_GASKET, centre = true); + } + } + // Glove seals + height_nut_glove_seal = get_metric_bolt_head_height(SIZE_BOLT_GLOVE); + length_bolt_glove_seal = T_GASKET_RUBBER * 2 + T_HDPE_SHEET + T_WASHER_GLOVE + height_nut_glove_seal + OFFSET_NUT_FROM_BOLT_END; + for (index_side = [0 : 1 : 1]) { + mirror([index_side, 0, 0]) { + translate([ + OFFSET_GLOVE_HOLE_CENTRES_X / 2 + , -R_EXTERNAL[2] * 3 / 4 + , 0 + ]) { + for (index_hole = [0 : 1 : COUNT_BOLTS_PER_GLOVE - 1]) { + rotate([0, 0, 360 / COUNT_BOLTS_PER_GLOVE * index_hole]) translate([0, D_GLOVE_HOLE / 2 + W_DOOR_GASKET / 2, 0]) { + // Bolt and nut + translate([0, 0, length_bolt_glove_seal / 2 - T_HDPE_SHEET - T_GASKET_RUBBER * 2]) mirror([0, 0, 1]) metric_countersunk_head_bolt(SIZE_BOLT_GLOVE, length_bolt_glove_seal, true, OFFSET_NUT_FROM_BOLT_END); + // Washer + translate([0, 0, T_WASHER_GLOVE / 2]) washer(T_WASHER_GLOVE, D_WASHER_GLOVE, SIZE_BOLT_GLOVE, centre = true); + } + } + } + } + } + } + // Shopping +} + +$fn = 100; +// test output +glovebox_door(); +// door_support_beam(R_EXTERNAL[0] - D_DOOR_SUPPORT_BEAM); +// door_support_beam(R_EXTERNAL[2] - D_DOOR_SUPPORT_BEAM); \ No newline at end of file diff --git a/models/glovebox_door/glovebox_door_panel_only.stl b/models/glovebox_door/glovebox_door_panel_only.stl new file mode 100644 index 0000000..6e2624b Binary files /dev/null and b/models/glovebox_door/glovebox_door_panel_only.stl differ diff --git a/models/glovebox_rear_panel/glovebox_rear_panel.scad b/models/glovebox_rear_panel/glovebox_rear_panel.scad new file mode 100644 index 0000000..88b49c8 --- /dev/null +++ b/models/glovebox_rear_panel/glovebox_rear_panel.scad @@ -0,0 +1,63 @@ + +include <../../config.scad>; +use <./vent_gasket_holes.scad>; +use <../common/metric_bolt.scad>; +use <../common/metric_bolt_functions.scad>; + +module glovebox_rear_panel() { + r_panel = [ + R_INTERNAL[0] + OVERLAP_CLEAR_PANEL_WITH_SKELETON_EACH_SIDE * 2 + , T_HDPE_SHEET + , R_INTERNAL[2] + OVERLAP_CLEAR_PANEL_WITH_SKELETON_EACH_SIDE * 2 + ]; + union() { + /* + difference() { + // clear panel + color("white", 0.4) translate([0, 0, 0]) cube(r_panel, center = true); + for (index_side = [0 : 1 : 1]) { + mirror([index_side, 0, 0]) { + translate([R_INTERNAL[0] / 4, 0, -R_INTERNAL[2] / 4]) { + // ventilation holes + rotate([90, 0, 0]) cylinder(T_HDPE_SHEET, D_VENT_DUCT / 2, D_VENT_DUCT / 2, center = true); + // vent duct fastenings + rotate([90, 0, 0]) vent_gasket_holes(); + } + } + } + } + */ + color("white", 1) import("./glovebox_rear_panel_only.stl"); + // gasket + height_nut_vent = get_metric_bolt_head_height(SIZE_BOLT_VENT); + length_bolt_vent = T_WASHER_VENT * 2 + T_GASKET_RUBBER + T_HDPE_SHEET + height_nut_vent + OFFSET_NUT_FROM_BOLT_END; + for (index_side = [0 : 1 : 1]) { + mirror([index_side, 0, 0]) { + // Vent gasket + translate([ + R_INTERNAL[0] / 4 + , r_panel[1] / 2 + , -R_INTERNAL[2] / 4 + ]) { + color("black") translate([0, T_GASKET_RUBBER / 2, 0]) import("./vent_gasket.stl"); + // Fasteners + for (index_hole = [0 : 1 : COUNT_BOLTS_PER_VENT - 1]) { + rotate([0, 360 / COUNT_BOLTS_PER_VENT * index_hole, 0]) translate([D_VENT_DUCT / 2, 0, D_VENT_DUCT / 2]) + { + // Bolt and nut + translate([0, length_bolt_vent / 2 - r_panel[1] - T_WASHER_VENT, 0]) rotate([90, 0, 0]) metric_bolt(SIZE_BOLT_VENT, length_bolt_vent, true, OFFSET_NUT_FROM_BOLT_END); + // Washers + translate([0, -r_panel[1] - T_WASHER_VENT / 2, 0]) rotate([90, 0, 0]) washer(T_WASHER_VENT, D_WASHER_VENT, SIZE_BOLT_VENT, centre = true); + translate([0, T_GASKET_RUBBER + T_WASHER_VENT / 2, 0]) rotate([90, 0, 0]) washer(T_WASHER_VENT, D_WASHER_VENT, SIZE_BOLT_VENT, centre = true); + } + } + } + } + } + } + // Shopping +} + +// $fn = 250; +// test output +glovebox_rear_panel(); \ No newline at end of file diff --git a/models/glovebox_rear_panel/glovebox_rear_panel_only.stl b/models/glovebox_rear_panel/glovebox_rear_panel_only.stl new file mode 100644 index 0000000..7e54924 Binary files /dev/null and b/models/glovebox_rear_panel/glovebox_rear_panel_only.stl differ diff --git a/models/glovebox_rear_panel/vent_gasket.scad b/models/glovebox_rear_panel/vent_gasket.scad new file mode 100644 index 0000000..67dda8c --- /dev/null +++ b/models/glovebox_rear_panel/vent_gasket.scad @@ -0,0 +1,22 @@ + +include <../../config.scad>; +use <./vent_gasket_holes.scad>; + +module vent_gasket() { + // color("black") + rotate([90, 0, 0]) difference() { + // Body + // cylinder(T_GASKET_RUBBER, D_VENT_DUCT / 2 + W_DOOR_GASKET, D_VENT_DUCT / 2 + W_DOOR_GASKET, center = true); + cube([D_VENT_DUCT + W_DOOR_GASKET * 2, D_VENT_DUCT + W_DOOR_GASKET * 2, T_GASKET_RUBBER], center = true); + // Duct hole + cylinder(T_GASKET_RUBBER, D_VENT_DUCT / 2, D_VENT_DUCT / 2, center = true); + // Duct fasteners + vent_gasket_holes(); + } + // Shopping + echo(str("EDPM rubber: Vent Gasket ", D_VENT_DUCT + W_DOOR_GASKET * 2, "mm x ", D_VENT_DUCT + W_DOOR_GASKET * 2, "mm - x1")); +} + +$fn = 250; +// test output +vent_gasket(); \ No newline at end of file diff --git a/models/glovebox_rear_panel/vent_gasket.stl b/models/glovebox_rear_panel/vent_gasket.stl new file mode 100644 index 0000000..d039caf Binary files /dev/null and b/models/glovebox_rear_panel/vent_gasket.stl differ diff --git a/models/glovebox_rear_panel/vent_gasket_holes.scad b/models/glovebox_rear_panel/vent_gasket_holes.scad new file mode 100644 index 0000000..29be319 --- /dev/null +++ b/models/glovebox_rear_panel/vent_gasket_holes.scad @@ -0,0 +1,14 @@ + +include <../../config.scad>; + +module vent_gasket_holes() { + for (index_hole = [0 : 1 : COUNT_BOLTS_PER_VENT - 1]) { + rotate([0, 0, 90 * index_hole]) translate([D_VENT_DUCT / 2, D_VENT_DUCT / 2, 0]) + // rotate([90, 0, 0]) + cylinder(T_HDPE_SHEET + T_GASKET_RUBBER, SIZE_BOLT_VENT / 2, SIZE_BOLT_VENT / 2, center = true); + } + // Shopping +} + +// test output +vent_gasket_holes(); \ No newline at end of file diff --git a/models/glovebox_shell/glovebox_shell.scad b/models/glovebox_shell/glovebox_shell.scad new file mode 100644 index 0000000..daac5e6 --- /dev/null +++ b/models/glovebox_shell/glovebox_shell.scad @@ -0,0 +1,300 @@ +include <../../config.scad>; +use <../common/metric_bolt.scad>; +use <../common/metric_countersunk_head_bolt.scad>; +use <../common/washer.scad>; +use <../fixings/angle_bracket_20_20.scad>; +use <../fixings/door_hinge.scad>; +use <../fixings/mitre_bracket.scad>; +use <../glovebox_door/glovebox_door.scad>; +use <../glovebox_rear_panel/glovebox_rear_panel.scad>; +use <./skeleton_beam.scad>; + +function get_length_beam_from_total_length_and_count_segments(length_total, count_segments) = (length_total - (count_segments + 1) * D_BEAM_SKELETON) / (count_segments); + +module glovebox_shell(angle_door_from_closed) { + // Shopping + echo("Skeleton"); + // Model + union() { + length_beam_on_x = R_INTERNAL[0]; + length_beam_on_y = R_EXTERNAL[1]; + length_beam_on_z = R_INTERNAL[2]; + + // X + for (index_beam_on_y = [0 : 1 : 1]) { + for (index_beam_on_z = [0 : 1 : 1]) { + // Beams + translate([ + 0 + , R_SKELETON_BEAM_CENTRES[1] / 2 * (index_beam_on_y == 0 ? 1 : -1) + , L_LEG + D_BEAM_SKELETON / 2 + (index_beam_on_z == 0 ? 0 : R_SKELETON_BEAM_CENTRES[2]) + ]) + rotate([0, 90, 0]) + // skeleton_beam(length_beam_on_x); + color("silver") import("./skeleton_beam_for_shell_on_x.stl"); + // Joints + } + } + // translate([0, 0, L_LEG + D_BEAM_SKELETON / 2]) rotate([0, 90, 0]) skeleton_beam(length_beam_on_x); + // Y + for (index_beam_on_x = [0 : 1 : 1]) { + for (index_beam_on_z = [0 : 1 : 1]) { + // Beams + translate([ + R_SKELETON_BEAM_CENTRES[0] / 2 * (index_beam_on_x == 0 ? 1 : -1) + , 0 + , L_LEG + D_BEAM_SKELETON / 2 + (index_beam_on_z == 0 ? 0 : R_SKELETON_BEAM_CENTRES[2]) + ]) + rotate([90, 0, 0]) + // skeleton_beam(length_beam_on_y); + color("silver") import("./skeleton_beam_for_shell_on_y.stl"); + // Joints + } + } + for (index_beam_on_x = [0 : 1 : COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1]) { + // Beams + translate([ + R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 - OFFSET_X_BASE_BEAM_SUPPORTS - (index_beam_on_x) * (R_INTERNAL[0] - D_BEAM_SKELETON - OFFSET_X_BASE_BEAM_SUPPORTS * 2) / (COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1) + , 0 + , L_LEG - D_BEAM_SKELETON / 2 + ]) + rotate([90, 0, 0]) + // skeleton_beam(R_EXTERNAL[1]); + color("silver") import("./skeleton_beam_for_shell_base_support.stl"); + // Joints + for (index_support_on_x = [0 : 1 : 1]) { + for (index_support_on_y = [0 : 1 : 1]) { + translate([ + R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 - OFFSET_X_BASE_BEAM_SUPPORTS - (index_beam_on_x) * (R_INTERNAL[0] - D_BEAM_SKELETON - OFFSET_X_BASE_BEAM_SUPPORTS * 2) / (COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1) + , 0 + , 0 + ]) + mirror([index_support_on_x, 0, 0]) mirror([0, index_support_on_y, 0]) translate([D_BEAM_SKELETON / 2, R_SKELETON_BEAM_CENTRES[1] / 2, L_LEG]) + rotate([180, 0, 0]) + // angle_bracket_20_20(); + import("../fixings/angle_bracket_20_20.stl"); + } + } + } + // translate([0, 0, L_LEG - D_BEAM_SKELETON / 2]) rotate([90, 0, 0]) skeleton_beam(R_EXTERNAL[1]); + // Z + for (index_beam_on_x = [0 : 1 : 1]) { + for (index_beam_on_y = [0 : 1 : 1]) { + mirror([index_beam_on_x, 0, 0]) mirror([0, index_beam_on_y, 0]) { + // Beams + // Main chamber section + translate([R_SKELETON_BEAM_CENTRES[0] / 2, R_SKELETON_BEAM_CENTRES[1] / 2, L_LEG + D_BEAM_SKELETON + length_beam_on_z / 2]) + // skeleton_beam(length_beam_on_z); + color("silver") import("./skeleton_beam_for_shell_on_z.stl"); + // Chamber legs + translate([R_SKELETON_BEAM_CENTRES[0] / 2, R_SKELETON_BEAM_CENTRES[1] / 2, L_LEG / 2]) + // skeleton_beam(length_beam_on_z); + color("silver") import("./skeleton_beam_for_shell_leg.stl"); + // Joints + // Base + translate([R_INTERNAL[0] / 2, R_SKELETON_BEAM_CENTRES[1] / 2, L_LEG]) + rotate([180, 0, 180]) + // angle_bracket_20_20(); + import("../fixings/angle_bracket_20_20.stl"); + translate([R_SKELETON_BEAM_CENTRES[0] / 2, R_INTERNAL[1] / 2, L_LEG]) + rotate([180, 0, -90]) + // angle_bracket_20_20(); + import("../fixings/angle_bracket_20_20.stl"); + // Top - inline + /* + translate([R_EXTERNAL[0] / 2, R_SKELETON_BEAM_CENTRES[1] / 2, R_EXTERNAL[2] - D_BEAM_SKELETON / 2 + L_LEG]) + rotate([-90, 0, 0]) rotate([0, 90, 0]) + // mitre_bracket(); + import("../fixings/mitre_bracket.stl"); + translate([R_SKELETON_BEAM_CENTRES[0] / 2, R_EXTERNAL[1] / 2, R_EXTERNAL[2] - D_BEAM_SKELETON / 2 + L_LEG]) + rotate([-90, 90, 0]) + // mitre_bracket(); + import("../fixings/mitre_bracket.stl"); + */ + } + } + } + // Support beam legs + L_support_leg = L_LEG - D_BEAM_SKELETON; + for (index_beam_on_x = [0 : 1 : COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1]) { + for (index_beam_on_y = [0 : 1 : COUNT_FEET_PER_BASE_SUPPORT_BEAM_ON_Y - 1]) { + // Beam + translate([ + R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 - OFFSET_X_BASE_BEAM_SUPPORTS - (index_beam_on_x) * (R_INTERNAL[0] - D_BEAM_SKELETON - OFFSET_X_BASE_BEAM_SUPPORTS * 2) / (COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1) + , -R_SKELETON_BEAM_CENTRES[1] / 2 + (R_SKELETON_BEAM_CENTRES[1]) / (COUNT_FEET_PER_BASE_SUPPORT_BEAM_ON_Y + 1) * (1 + index_beam_on_y) + , L_support_leg / 2 + ]) + // skeleton_beam(L_support_leg); + color("silver") import("./skeleton_beam_for_shell_base_support_leg.stl"); + // Support + translate([ + R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 - OFFSET_X_BASE_BEAM_SUPPORTS - (index_beam_on_x) * (R_INTERNAL[0] - D_BEAM_SKELETON - OFFSET_X_BASE_BEAM_SUPPORTS * 2) / (COUNT_BASE_SUPPORT_BEAMS_ON_Y - 1) + , -R_SKELETON_BEAM_CENTRES[1] / 2 + (R_SKELETON_BEAM_CENTRES[1]) / (COUNT_FEET_PER_BASE_SUPPORT_BEAM_ON_Y + 1) * (1 + index_beam_on_y) + D_BEAM_SKELETON / 2 + , L_support_leg + ]) + rotate([0, 90, 90]) + // angle_bracket_20_20(); + color("silver") import("../fixings/angle_bracket_20_20.stl"); + } + } + // Rear panel + translate([0, R_SKELETON_BEAM_CENTRES[1] / 2, L_LEG + R_EXTERNAL[2] / 2]) glovebox_rear_panel(); + // Door + translate([0, -R_EXTERNAL[1] / 2 - T_DOOR, L_LEG + R_EXTERNAL[2] - T_DOOR]) rotate([90 - angle_door_from_closed, 0, 0]) glovebox_door(); + // Hinges + for (index_hinge = [0 : 1 : COUNT_HINGES - 1]) { + translate([ + -R_INTERNAL[0] / 2 + (R_INTERNAL[0]) / (COUNT_HINGES + 1) * (index_hinge + 1) + , -R_EXTERNAL[1] / 2 + , L_LEG + R_EXTERNAL[2] + ]) { + translate([0, D_BEAM_SKELETON / 2 - OFFSET_HINGE_HOLE_CENTRES_Y / 2, 0]) door_hinge(90 + angle_door_from_closed); + + for (index_bolt = [0 : 1 : 1]) { + // On Door + mirror([index_bolt, 0, 0]) translate([OFFSET_HINGE_HOLE_CENTRES_X / 2, 0, -OFFSET_HINGE_HOLE_CENTRES_Y / 2]) + translate([0, -LENGTH_BOLT_HINGE_ON_DOOR / 2, 0]) rotate([-90, 0, 0]) { + // Bolt and nut + metric_countersunk_head_bolt(SIZE_BOLT_HINGE, LENGTH_BOLT_HINGE_ON_DOOR, true, OFFSET_NUT_FROM_BOLT_END); + // Washer + translate([0, 0, LENGTH_BOLT_HINGE_ON_DOOR / 2 - (T_GASKET_RUBBER + T_HDPE_SHEET + T_DOOR_SUPPORT_BEAM + R_HINGE[2] + T_WASHER_HINGE / 2)]) washer(T_WASHER_HINGE, D_WASHER_HINGE, SIZE_BOLT_HINGE, centre = true); + } + // On Chamber + mirror([index_bolt, 0, 0]) translate([OFFSET_HINGE_HOLE_CENTRES_X / 2, D_BEAM_SKELETON / 2, R_HINGE[2]]) + // translate([0, -LENGTH_BOLT_HINGE_ON_CHAMBER / 2, 0]) + { + // T nut + translate([0, 0, -R_HINGE[2] - T_BEAM_SKELETON]) mirror([0, 0, 1]) import("../common/br_t_nut.stl"); + // Washer + translate([0, 0, T_WASHER_HINGE / 2]) washer(T_WASHER_HINGE, D_WASHER_HINGE, SIZE_BOLT_HINGE, centre = true); + // Bolt + translate([0, 0, -LENGTH_BOLT_HINGE_ON_CHAMBER / 2 + T_WASHER_HINGE]) metric_bolt(SIZE_BOLT_HINGE, LENGTH_BOLT_HINGE_ON_CHAMBER, false, OFFSET_NUT_FROM_BOLT_END); + } + } + } + } + // Latches + for (index_latch = [0 : 1 : 1]) { + // Bottom + mirror([index_latch, 0, 0]) + translate([ + R_EXTERNAL[0] / 2 - OFFSET_LATCH_FROM_SIDE + , -R_EXTERNAL[1] / 2 + , L_LEG + ]) { + // Plate + translate([0, R_DOOR_LATCH_SUPPORT_PLATE[1] / 2, -R_DOOR_LATCH_SUPPORT_PLATE[2] / 2]) difference() { + cube(R_DOOR_LATCH_SUPPORT_PLATE, center = true); + translate([0, -R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 + D_BEAM_SKELETON / 2, 0]) cylinder(R_DOOR_LATCH_SUPPORT_PLATE[2], SIZE_BOLT_LATCH_PLATE_TO_SKELETON / 2, SIZE_BOLT_LATCH_PLATE_TO_SKELETON / 2, center = true); + translate([0, R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 - D_BEAM_SKELETON / 2 * 1, 0]) cylinder(R_DOOR_LATCH_SUPPORT_PLATE[2], SIZE_BOLT_LATCH_TO_PLATE / 2, SIZE_BOLT_LATCH_TO_PLATE / 2, center = true); + translate([0, R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 - D_BEAM_SKELETON / 2 * 2, 0]) cylinder(R_DOOR_LATCH_SUPPORT_PLATE[2], SIZE_BOLT_LATCH_TO_PLATE / 2, SIZE_BOLT_LATCH_TO_PLATE / 2, center = true); + translate([0, R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 - D_BEAM_SKELETON / 2 * 3, 0]) cylinder(R_DOOR_LATCH_SUPPORT_PLATE[2], SIZE_BOLT_LATCH_TO_PLATE / 2, SIZE_BOLT_LATCH_TO_PLATE / 2, center = true); + } + // Chamber nut + translate([0, D_BEAM_SKELETON / 2, T_BEAM_SKELETON]) import("../common/br_t_nut.stl"); + // Chamber washer + translate([ + 0 + , D_BEAM_SKELETON / 2 + , -R_DOOR_LATCH_SUPPORT_PLATE[2] - T_WASHER_LATCH_PLATE_TO_SKELETON / 2 + ]) + washer(T_WASHER_LATCH_PLATE_TO_SKELETON, D_WASHER_LATCH_PLATE_TO_SKELETON, SIZE_BOLT_LATCH_PLATE_TO_SKELETON, centre = true); + // Chamber bolt + translate([ + 0 + , D_BEAM_SKELETON / 2 + , -R_DOOR_LATCH_SUPPORT_PLATE[2] + LENGTH_BOLT_LATCH_PLATE_TO_SKELETON / 2 - T_WASHER_LATCH_PLATE_TO_SKELETON + ]) + mirror([0, 0, 1]) metric_bolt(SIZE_BOLT_LATCH_PLATE_TO_SKELETON, LENGTH_BOLT_LATCH_PLATE_TO_SKELETON, false, OFFSET_NUT_FROM_BOLT_END_CHAMBER); + // Latch fastener + for (index_bolt = [0 : 1 : 2]) { + translate([0, -D_BEAM_SKELETON / 2 * index_bolt, 0]) { + // Washer + translate([ + 0 + , R_DOOR_LATCH_SUPPORT_PLATE[1] - D_BEAM_SKELETON / 2 + , T_WASHER_LATCH_TO_PLATE / 2 + ]) + washer(T_WASHER_LATCH_TO_PLATE, D_WASHER_LATCH_TO_PLATE, SIZE_BOLT_LATCH_TO_PLATE, centre = true); + // Bolt + translate([ + 0 + , R_DOOR_LATCH_SUPPORT_PLATE[1] - D_BEAM_SKELETON / 2 + , -R_DOOR_LATCH_SUPPORT_PLATE[2] + LENGTH_BOLT_LATCH_TO_PLATE / 2 - R_LATCH[2] + ]) + mirror([0, 0, 1]) metric_countersunk_head_bolt(SIZE_BOLT_LATCH_TO_PLATE, LENGTH_BOLT_LATCH_TO_PLATE, true, OFFSET_NUT_FROM_BOLT_END_CHAMBER); + } + } + } + // Sides + mirror([index_latch, 0, 0]) + translate([ + R_EXTERNAL[0] / 2 + R_DOOR_LATCH_SUPPORT_PLATE[2] / 2 + , -R_EXTERNAL[1] / 2 + R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 + , L_LEG + R_EXTERNAL[2] - OFFSET_LATCH_FROM_TOP + ]) { + rotate([0, 90, 0]) difference() { + cube(R_DOOR_LATCH_SUPPORT_PLATE, center = true); + translate([0, -R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 + D_BEAM_SKELETON / 2, 0]) cylinder(R_DOOR_LATCH_SUPPORT_PLATE[2], SIZE_BOLT_LATCH_PLATE_TO_SKELETON / 2, SIZE_BOLT_LATCH_PLATE_TO_SKELETON / 2, center = true); + translate([0, R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 - D_BEAM_SKELETON / 2 * 1, 0]) cylinder(R_DOOR_LATCH_SUPPORT_PLATE[2], SIZE_BOLT_LATCH_TO_PLATE / 2, SIZE_BOLT_LATCH_TO_PLATE / 2, center = true); + translate([0, R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 - D_BEAM_SKELETON / 2 * 2, 0]) cylinder(R_DOOR_LATCH_SUPPORT_PLATE[2], SIZE_BOLT_LATCH_TO_PLATE / 2, SIZE_BOLT_LATCH_TO_PLATE / 2, center = true); + translate([0, R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 - D_BEAM_SKELETON / 2 * 3, 0]) cylinder(R_DOOR_LATCH_SUPPORT_PLATE[2], SIZE_BOLT_LATCH_TO_PLATE / 2, SIZE_BOLT_LATCH_TO_PLATE / 2, center = true); + } + // Chamber nut + // translate([0, D_BEAM_SKELETON / 2, T_BEAM_SKELETON]) + translate([ + -R_DOOR_LATCH_SUPPORT_PLATE[2] / 2 - T_BEAM_SKELETON + , -R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 + D_BEAM_SKELETON / 2 + , 0 + ]) + rotate([0, -90, 0]) import("../common/br_t_nut.stl"); + // Chamber washer + // translate([0, D_BEAM_SKELETON / 2, -R_DOOR_LATCH_SUPPORT_PLATE[2] - T_WASHER_LATCH_PLATE_TO_SKELETON / 2]) + translate([ + R_DOOR_LATCH_SUPPORT_PLATE[2] / 2 + T_WASHER_LATCH_PLATE_TO_SKELETON / 2 + , -R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 + D_BEAM_SKELETON / 2 + , 0 + ]) + rotate([0, 90, 0]) washer(T_WASHER_LATCH_PLATE_TO_SKELETON, D_WASHER_LATCH_PLATE_TO_SKELETON, SIZE_BOLT_LATCH_PLATE_TO_SKELETON, centre = true); + // Chamber bolt + translate([ + -LENGTH_BOLT_LATCH_PLATE_TO_SKELETON / 2 + R_DOOR_LATCH_SUPPORT_PLATE[2] / 2 + T_WASHER_LATCH_PLATE_TO_SKELETON + , -R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 + D_BEAM_SKELETON / 2 + , 0 + ]) + rotate([0, 90, 0]) metric_bolt(SIZE_BOLT_LATCH_PLATE_TO_SKELETON, LENGTH_BOLT_LATCH_PLATE_TO_SKELETON, false, OFFSET_NUT_FROM_BOLT_END_CHAMBER); + // Latch fastener + for (index_bolt = [0 : 1 : 2]) { + translate([0, -D_BEAM_SKELETON / 2 * index_bolt, 0]) { + // Washer + translate([ + -T_WASHER_LATCH_TO_PLATE / 2 - R_DOOR_LATCH_SUPPORT_PLATE[2 ] / 2 + , R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 - D_BEAM_SKELETON / 2 + , 0 + ]) + rotate([0, 90, 0]) washer(T_WASHER_LATCH_TO_PLATE, D_WASHER_LATCH_TO_PLATE, SIZE_BOLT_LATCH_TO_PLATE, centre = true); + // Bolt + translate([ + -LENGTH_BOLT_LATCH_TO_PLATE / 2 + R_DOOR_LATCH_SUPPORT_PLATE[2] / 2 + R_LATCH[2] + , R_DOOR_LATCH_SUPPORT_PLATE[1] / 2 - D_BEAM_SKELETON / 2 + , 0 + ]) + rotate([0, 90, 0]) metric_countersunk_head_bolt(SIZE_BOLT_LATCH_TO_PLATE, LENGTH_BOLT_LATCH_TO_PLATE, true, OFFSET_NUT_FROM_BOLT_END_CHAMBER); + } + } + } + } + } + // Shopping + echo(str("Skeleton beam Z: Aluminium box section D8 drilled 20mm x 20mm x ", L_LEG + R_EXTERNAL[2] - D_BEAM_SKELETON, "mm - x4")); + echo(str("Skeleton beam Z fixing: Quick connector (6) - x4")); + echo("Inner bracket 6mm - x16"); + // Rear panel vent duct fasteners + // Hinge fasteners + + echo(str("Door latch support plate fastener nut: M4 T Nut (6) - x4")); + echo(str("Door latch support plate fastener bolt: Bolt M4 x ", 1 + 3.2 + R_DOOR_LATCH_SUPPORT_PLATE[2] + T_WASHER_LATCH_TO_PLATE, "mm - x4")); + echo(str("Door latch support plate fastener washer: Washer M4 x ", D_WASHER_LATCH_TO_PLATE, "mm x ", T_WASHER_LATCH_TO_PLATE, "mm - x4")); +} + +glovebox_shell(); \ No newline at end of file diff --git a/models/glovebox_shell/skeleton_beam.scad b/models/glovebox_shell/skeleton_beam.scad new file mode 100644 index 0000000..3b712fa --- /dev/null +++ b/models/glovebox_shell/skeleton_beam.scad @@ -0,0 +1,49 @@ +include <../../config.scad>; +use <../common/beam_hollow_rectangular.scad>; + +module skeleton_beam(length, suppress_shopping_outputs = false) { + d_hole_centre = 5.5; + w_slot_min = 6; + color("silver") // , 0.4) + difference() { + cube([D_BEAM_SKELETON, D_BEAM_SKELETON, length], center = true); + cylinder(length, d_hole_centre / 2, d_hole_centre / 2, center = true); + for (index_side_beam = [0 : 1 : 3]) { + rotate([0, 0, 90 * index_side_beam]) { + union() { + /* + translate([-t / 2 + D_BEAM_SKELETON / 2, 0, 0]) cube([t, w_slot_min, length], center = true); + translate([-t / 2 + D_BEAM_SKELETON / 2, 0, 0]) cube([t, w_slot_min, length], center = true); + */ + } + for (index_side_slot = [0 : 1 : 1]) { + mirror([0, index_side_slot, 0]) linear_extrude(length, center = true) polygon([ + [D_BEAM_SKELETON / 2 - T_BEAM_SKELETON - DEPTH_SLOT_BEAM_SKELETON, 0] + , [D_BEAM_SKELETON / 2 - T_BEAM_SKELETON - DEPTH_SLOT_BEAM_SKELETON, w_slot_min / 2] + , [D_BEAM_SKELETON / 2 - T_BEAM_SKELETON, w_slot_min / 2 + DEPTH_SLOT_BEAM_SKELETON] + , [D_BEAM_SKELETON / 2 - T_BEAM_SKELETON, w_slot_min / 2] + , [D_BEAM_SKELETON / 2, w_slot_min / 2] + , [D_BEAM_SKELETON / 2, 0] + ]); + } + } + } + } + // cube([D_BEAM_SKELETON, D_BEAM_SKELETON, length], center = true); + // beam_hollow_rectangular(length, D_BEAM_SKELETON, D_BEAM_SKELETON, T_BEAM_SKELETON, true); + + // Shopping + if (!suppress_shopping_outputs) { + echo(str("Skeleton beam: Aluminium box section 20mm x 20mm x ", length, "mm - x1")); + } +} + +$fn = 100; +// outputs +// skeleton_beam(500, false); +// skeleton_beam(R_INTERNAL[0], false); // X +skeleton_beam(R_EXTERNAL[1], false); // Y +// skeleton_beam(R_INTERNAL[2], false); // Z +// skeleton_beam(L_LEG, false); // chamber leg +// skeleton_beam(L_LEG - D_BEAM_SKELETON, false); // base support leg +// skeleton_beam(R_EXTERNAL[1], false); // base support \ No newline at end of file diff --git a/models/glovebox_shell/skeleton_beam_for_shell_base_support.stl b/models/glovebox_shell/skeleton_beam_for_shell_base_support.stl new file mode 100644 index 0000000..a0019c8 Binary files /dev/null and b/models/glovebox_shell/skeleton_beam_for_shell_base_support.stl differ diff --git a/models/glovebox_shell/skeleton_beam_for_shell_base_support_leg.stl b/models/glovebox_shell/skeleton_beam_for_shell_base_support_leg.stl new file mode 100644 index 0000000..cb7232e Binary files /dev/null and b/models/glovebox_shell/skeleton_beam_for_shell_base_support_leg.stl differ diff --git a/models/glovebox_shell/skeleton_beam_for_shell_leg.stl b/models/glovebox_shell/skeleton_beam_for_shell_leg.stl new file mode 100644 index 0000000..49efbbf Binary files /dev/null and b/models/glovebox_shell/skeleton_beam_for_shell_leg.stl differ diff --git a/models/glovebox_shell/skeleton_beam_for_shell_on_x.stl b/models/glovebox_shell/skeleton_beam_for_shell_on_x.stl new file mode 100644 index 0000000..ba907e4 Binary files /dev/null and b/models/glovebox_shell/skeleton_beam_for_shell_on_x.stl differ diff --git a/models/glovebox_shell/skeleton_beam_for_shell_on_y.stl b/models/glovebox_shell/skeleton_beam_for_shell_on_y.stl new file mode 100644 index 0000000..a0019c8 Binary files /dev/null and b/models/glovebox_shell/skeleton_beam_for_shell_on_y.stl differ diff --git a/models/glovebox_shell/skeleton_beam_for_shell_on_z.stl b/models/glovebox_shell/skeleton_beam_for_shell_on_z.stl new file mode 100644 index 0000000..dc62719 Binary files /dev/null and b/models/glovebox_shell/skeleton_beam_for_shell_on_z.stl differ diff --git a/models/skeleton/skeleton.scad b/models/skeleton/skeleton.scad deleted file mode 100644 index 089fadc..0000000 --- a/models/skeleton/skeleton.scad +++ /dev/null @@ -1,172 +0,0 @@ -include <../../config.scad>; -use <./skeleton_beam.scad>; -use <../fixings/square_tube_joint_cross.scad>; -use <../fixings/square_tube_joint_n_way.scad>; -use <../fixings/square_tube_joint_tee.scad>; - -function get_length_beam_from_total_length_and_count_segments(length_total, count_segments) = (length_total - (count_segments + 1) * D_BEAM_SKELETON) / (count_segments); - -module skeleton() { - // Shopping - echo("Skeleton"); - // Model - translate([0, 0, -D_BEAM_SKELETON / 2]) union() { - count_beams_on_side_face_along_y = COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_Y; - count_beams_on_rear_face_along_x = COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_X; - count_beams_on_rear_face_along_z = COUNT_BEAMS_ON_SIDE_FACE_ALONG_Z; - count_beams_on_top_face_along_x = COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_X; - count_beams_on_top_face_along_y = COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_Y; - - length_beam_on_bottom_face_along_x = get_length_beam_from_total_length_and_count_segments(R_EXTERNAL[0], COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_X); - length_beam_on_bottom_face_along_y = get_length_beam_from_total_length_and_count_segments(R_EXTERNAL[1], COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_Y); - length_beam_on_side_face_along_y = get_length_beam_from_total_length_and_count_segments(R_EXTERNAL[1], count_beams_on_side_face_along_y); - length_beam_on_side_face_along_z = get_length_beam_from_total_length_and_count_segments(R_EXTERNAL[2], COUNT_BEAMS_ON_SIDE_FACE_ALONG_Z); - length_beam_on_rear_face_along_x = get_length_beam_from_total_length_and_count_segments(R_EXTERNAL[0], count_beams_on_rear_face_along_x); - length_beam_on_rear_face_along_z = get_length_beam_from_total_length_and_count_segments(R_EXTERNAL[2], count_beams_on_rear_face_along_z); - length_beam_on_top_face_along_x = get_length_beam_from_total_length_and_count_segments(R_EXTERNAL[0], count_beams_on_top_face_along_x); - length_beam_on_top_face_along_y = get_length_beam_from_total_length_and_count_segments(R_EXTERNAL[1], count_beams_on_top_face_along_y); - - // Bottom - translate([0, 0, -R_INTERNAL[2] / 2]) for (index_beam_on_bottom_face_along_x = [0 : 1 : COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_X]) { // -R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 - for (index_beam_on_bottom_face_along_y = [0 : 1 : COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_Y]) { - // Beams - if (index_beam_on_bottom_face_along_x < COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_X) { - translate([-R_INTERNAL[0] / 2 + length_beam_on_bottom_face_along_x / 2 + (D_BEAM_SKELETON + length_beam_on_bottom_face_along_x) * (index_beam_on_bottom_face_along_x), -R_INTERNAL[1] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_bottom_face_along_y) * (index_beam_on_bottom_face_along_y), 0]) rotate([0, 90, 0]) skeleton_beam(length_beam_on_bottom_face_along_x); - } - if (index_beam_on_bottom_face_along_y < COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_Y) { - translate([-R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_bottom_face_along_x) * (index_beam_on_bottom_face_along_x), -R_INTERNAL[1] / 2 + length_beam_on_bottom_face_along_y / 2 + (D_BEAM_SKELETON + length_beam_on_bottom_face_along_y) * (index_beam_on_bottom_face_along_y), 0]) rotate([90, 0, 0]) skeleton_beam(length_beam_on_bottom_face_along_y); - } - // Joints - translate([-R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_bottom_face_along_x) * (index_beam_on_bottom_face_along_x), -R_INTERNAL[1] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_bottom_face_along_y) * (index_beam_on_bottom_face_along_y), 0]) { - if (index_beam_on_bottom_face_along_x == 0 || index_beam_on_bottom_face_along_x == COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_X) { - mirror([(index_beam_on_bottom_face_along_x == COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_X ? 1 : 0), 0, 0]) { - if (index_beam_on_bottom_face_along_y == 0 || index_beam_on_bottom_face_along_y == COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_Y) { - mirror([0, (index_beam_on_bottom_face_along_y == COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_Y ? 1 : 0), 0]) square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, 3); - } - else { - rotate([90, 0, 0]) square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, 4); - } - } - } - else { - if (index_beam_on_bottom_face_along_y == 0) { - square_tube_joint_tee(D_BEAM_SKELETON, T_BEAM_SKELETON); - } - else if (index_beam_on_bottom_face_along_y == COUNT_BEAMS_ON_BOTTOM_FACE_ALONG_Y) { - rotate([90, 0, -90]) square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, 4); - } - else { - square_tube_joint_cross(D_BEAM_SKELETON, T_BEAM_SKELETON); - } - } - } - } - } - // Sides - for (index_side = [0 : 1 : 1]) mirror([index_side, 0, 0]) { - translate([R_INTERNAL[0] / 2 + D_BEAM_SKELETON / 2, 0, 0]) for (index_beam_on_side_face_along_z = [0 : 1 : COUNT_BEAMS_ON_SIDE_FACE_ALONG_Z]) { - for (index_beam_on_side_face_along_y = [0 : 1 : count_beams_on_side_face_along_y]) { - // Beams - if ( - index_beam_on_side_face_along_y < count_beams_on_side_face_along_y - && index_beam_on_side_face_along_z > 0 - && index_beam_on_side_face_along_z < COUNT_BEAMS_ON_SIDE_FACE_ALONG_Z - - ) { - translate([0, -R_INTERNAL[1] / 2 + length_beam_on_side_face_along_y / 2 + (D_BEAM_SKELETON + length_beam_on_side_face_along_y) * (index_beam_on_side_face_along_y), -R_INTERNAL[2] / 2 + (D_BEAM_SKELETON + length_beam_on_side_face_along_z) * (index_beam_on_side_face_along_z)]) rotate([90, 0, 0]) skeleton_beam(length_beam_on_side_face_along_y); - } - if (index_beam_on_side_face_along_z < COUNT_BEAMS_ON_SIDE_FACE_ALONG_Z) { - translate([0, -R_INTERNAL[1] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_side_face_along_y) * (index_beam_on_side_face_along_y), -R_INTERNAL[2] / 2 + D_BEAM_SKELETON / 2 + length_beam_on_side_face_along_z / 2 + (D_BEAM_SKELETON + length_beam_on_side_face_along_z) * (index_beam_on_side_face_along_z)]) skeleton_beam(length_beam_on_side_face_along_z); - } - // Joints - translate([0, -R_INTERNAL[1] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_side_face_along_y) * (index_beam_on_side_face_along_y), -R_INTERNAL[2] / 2 + (D_BEAM_SKELETON + length_beam_on_side_face_along_z) * (index_beam_on_side_face_along_z)]) { - if ( - index_beam_on_side_face_along_z > 0 - && index_beam_on_side_face_along_z < COUNT_BEAMS_ON_SIDE_FACE_ALONG_Z - ) { - if (index_beam_on_side_face_along_y == 0) { - rotate([0, 90, 0]) square_tube_joint_tee(D_BEAM_SKELETON, T_BEAM_SKELETON); - } - else if (index_beam_on_side_face_along_y == count_beams_on_side_face_along_y) { - rotate([0, 0, 180]) square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, 4); - } - else { - rotate([0, 90, 0]) square_tube_joint_cross(D_BEAM_SKELETON, T_BEAM_SKELETON); - } - } - } - } - } - } - // Rear - translate([0, R_INTERNAL[1] / 2 + D_BEAM_SKELETON / 2, 0]) for (index_beam_on_rear_face_along_x = [0 : 1 : count_beams_on_rear_face_along_x]) { - for (index_beam_on_rear_face_along_z = [0 : 1 : count_beams_on_rear_face_along_z]) { - // Beams - if ( - index_beam_on_rear_face_along_x < count_beams_on_rear_face_along_x - && index_beam_on_rear_face_along_z > 0 - && index_beam_on_rear_face_along_z < count_beams_on_rear_face_along_z - - ) { - translate([-R_INTERNAL[0] / 2 + length_beam_on_rear_face_along_x / 2 + (D_BEAM_SKELETON + length_beam_on_rear_face_along_x) * (index_beam_on_rear_face_along_x), 0, -R_INTERNAL[2] / 2 + (D_BEAM_SKELETON + length_beam_on_rear_face_along_z) * (index_beam_on_rear_face_along_z)]) rotate([0, 90, 0]) skeleton_beam(length_beam_on_rear_face_along_x); - } - if ( - index_beam_on_rear_face_along_z < count_beams_on_rear_face_along_z - && index_beam_on_rear_face_along_x > 0 - && index_beam_on_rear_face_along_x < count_beams_on_rear_face_along_x - ) { - translate([-R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_rear_face_along_x) * (index_beam_on_rear_face_along_x), 0, -R_INTERNAL[2] / 2 + D_BEAM_SKELETON / 2 + length_beam_on_rear_face_along_z / 2 + (D_BEAM_SKELETON + length_beam_on_rear_face_along_z) * (index_beam_on_rear_face_along_z)]) skeleton_beam(length_beam_on_rear_face_along_z); - } - // Joints - translate([-R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_rear_face_along_x) * (index_beam_on_rear_face_along_x), 0, -R_INTERNAL[2] / 2 + (D_BEAM_SKELETON + length_beam_on_rear_face_along_z) * (index_beam_on_rear_face_along_z)]) { - if ( - index_beam_on_rear_face_along_z > 0 - && index_beam_on_rear_face_along_z < count_beams_on_rear_face_along_z - ) { - if (index_beam_on_rear_face_along_x > 0 && index_beam_on_rear_face_along_x < count_beams_on_rear_face_along_x) { - rotate([90, 0, 0]) square_tube_joint_cross(D_BEAM_SKELETON, T_BEAM_SKELETON); - } - } - } - } - } - // Top - translate([0, 0, R_INTERNAL[2] / 2 + D_BEAM_SKELETON]) for (index_beam_on_top_face_along_x = [0 : 1 : count_beams_on_top_face_along_x]) { // -R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 - for (index_beam_on_top_face_along_y = [0 : 1 : count_beams_on_top_face_along_y]) { - // Beams - if (index_beam_on_top_face_along_x < count_beams_on_top_face_along_x) { - translate([-R_INTERNAL[0] / 2 + length_beam_on_top_face_along_x / 2 + (D_BEAM_SKELETON + length_beam_on_top_face_along_x) * (index_beam_on_top_face_along_x), -R_INTERNAL[1] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_top_face_along_y) * (index_beam_on_top_face_along_y), 0]) rotate([0, 90, 0]) skeleton_beam(length_beam_on_top_face_along_x); - } - if (index_beam_on_top_face_along_y < count_beams_on_top_face_along_y) { - translate([-R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_top_face_along_x) * (index_beam_on_top_face_along_x), -R_INTERNAL[1] / 2 + length_beam_on_top_face_along_y / 2 + (D_BEAM_SKELETON + length_beam_on_top_face_along_y) * (index_beam_on_top_face_along_y), 0]) rotate([90, 0, 0]) skeleton_beam(length_beam_on_top_face_along_y); - } - // Joints - translate([-R_INTERNAL[0] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_top_face_along_x) * (index_beam_on_top_face_along_x), -R_INTERNAL[1] / 2 - D_BEAM_SKELETON / 2 + (D_BEAM_SKELETON + length_beam_on_top_face_along_y) * (index_beam_on_top_face_along_y), 0]) { - if (index_beam_on_top_face_along_x == 0 || index_beam_on_top_face_along_x == count_beams_on_top_face_along_x) { - mirror([(index_beam_on_top_face_along_x == count_beams_on_top_face_along_x ? 1 : 0), 0, 0]) { - if (index_beam_on_top_face_along_y == 0 || index_beam_on_top_face_along_y == count_beams_on_top_face_along_y) { - mirror([0, (index_beam_on_top_face_along_y == count_beams_on_top_face_along_y ? 1 : 0), 1]) square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, 3); - } - else { - rotate([-90, 0, 0]) square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, 4); - } - } - } - else { - if (index_beam_on_top_face_along_y == 0) { - square_tube_joint_tee(D_BEAM_SKELETON, T_BEAM_SKELETON); - } - else if (index_beam_on_top_face_along_y == count_beams_on_top_face_along_y) { - rotate([-90, 0, -90]) square_tube_joint_n_way(D_BEAM_SKELETON, T_BEAM_SKELETON, 4); - } - else { - square_tube_joint_cross(D_BEAM_SKELETON, T_BEAM_SKELETON); - } - } - } - } - } - } -} - -skeleton(); \ No newline at end of file diff --git a/models/skeleton/skeleton_beam.scad b/models/skeleton/skeleton_beam.scad deleted file mode 100644 index b4880b0..0000000 --- a/models/skeleton/skeleton_beam.scad +++ /dev/null @@ -1,8 +0,0 @@ -include <../../config.scad>; -use <../common/beam_hollow_rectangular.scad>; - -module skeleton_beam(length) { - color("red", 0.4) beam_hollow_rectangular(length, D_BEAM_SKELETON, D_BEAM_SKELETON, T_BEAM_SKELETON, true); - // Shopping - echo(str("Skeleton beam: Aluminium box section 20mm x 20mm x ", length, "mm - x1")); -} \ No newline at end of file