FOSHelter/src/assembly.scad

119 lines
3.9 KiB
OpenSCAD

include <variables.scad>;
use <modules/quadpipe.scad>
use <modules/corner.scad>
use <modules/hinge.scad>;
use <subassembly.scad>;
/*
// place a railed pipe and a side hinge for demo purposes
quadpipe_rail(1000);
translate([hinge_rail_height + quadpipe_thickness, hinge_length, 0]){
rotate([90, 0, 270]){
hinge_side();
}
}*/
/* MAIN ASSEMBLY STARTS HERE */
// assemble the skeleton
translate([quadpipe_side * 3, 0, 0]){
core();
}
// place hinges on left battery strut
//translate([quadpipe_side * 3 + quadpipe_thickness + hinge_rail_height, 0, core_battery_height]){
color("red"){
translate([quadpipe_side * 2.5 - quadpipe_thickness, 0, core_battery_height - quadpipe_side / 2]){
rotate([90, 180, -90]){
hinge_side_array();
}
}
}
// place hinges on right battery strut
translate([quadpipe_side * 3 + core_width - hinge_rail_height - quadpipe_thickness, core_length, core_battery_height]){
rotate([-90, 0, -90]){
hinge_side_array();
}
}
// place hinges on left top strut
translate([quadpipe_side * 3 + quadpipe_thickness + hinge_rail_height, core_length, core_height - quadpipe_side]){
rotate([90, 0, -90]){
hinge_side_array();
}
}
// place hinges on right top strut
translate([quadpipe_side * 3 + core_width - hinge_rail_height - quadpipe_thickness, 0, core_height - quadpipe_side]){
rotate([-90, 180, -90]){
hinge_side_array();
}
}
// Foldable walls on the left side
translate([$t * (core_battery_height + 2 * quadpipe_side), 0, $t * (2 * quadpipe_side + hinge_rail_thickness)]){
rotate([0, $t * -90, 0]){
translate([quadpipe_side * 2 - quadpipe_thickness, 0, core_battery_height + quadpipe_thickness]){
wall_floor();
}
}
}
translate([$t * (-wall_floor_strut_height + quadpipe_side - (3 * hinge_rail_thickness)), 0, $t * (wall_side_height + core_battery_height + hinge_270_exposed_height - hinge_rail_thickness)]){
rotate([0, $t * 180, 0]){
translate([quadpipe_side - hinge_rail_thickness, 0, 2 * quadpipe_side]){
wall_side();
}
}
}
translate([$t * (-wall_ceiling_height - 2 * quadpipe_side), 0, $t * (core_height - hinge_rail_thickness)]){
rotate([0, $t * 90, 0]){
translate([quadpipe_side - hinge_rail_thickness, 0, wall_ceiling_height + 4 * quadpipe_side - hinge_rail_thickness]){ // Full disclosure: I have no clue why the - hinge_rail_thickness is needed for the z-axis
rotate([0, 180, 0]){
wall_ceiling();
}
}
}
}
// Foldable walls on the right side
translate([$t * (wall_floor_height / 2 + core_battery_height + 2 * quadpipe_side), 0, $t * (8 * quadpipe_side - hinge_rail_thickness + core_width)]){
rotate([0, $t * 90, 0]){
translate([core_width + quadpipe_side * 4 - quadpipe_thickness, core_length, core_battery_height + quadpipe_thickness]){
rotate([0, 0, 180]){
wall_floor();
}
}
}
}
translate([$t * (core_width + 2 * wall_floor_strut_height + 2 * hinge_270_exposed_height + 2 * hinge_side_exposed_height + 4 * quadpipe_side - hinge_rail_thickness), 0, $t * (wall_side_height + core_battery_height + hinge_270_exposed_height - hinge_rail_thickness)]){
rotate([0, $t * 180, 0]){
translate([core_width + 5 * quadpipe_side - hinge_rail_thickness, core_length, 2 * quadpipe_side]){
rotate([0, 0, 180]){
wall_side();
}
}
}
}
translate([$t * (2 * wall_ceiling_height + 6 * quadpipe_side), 0, $t * (core_battery_height)]){
rotate([0, $t * -90, 0]){
translate([core_width + 5 * quadpipe_side - hinge_rail_thickness, core_length, wall_ceiling_height + 4 * quadpipe_side - hinge_rail_thickness]){ // Full disclosure: I have no clue why the - hinge_rail_thickness is needed for the z-axis
rotate([0, 180, 180]){
wall_ceiling();
}
}
}
}