$fn = $preview ? 32 : 256; a_pillar_y = -400; // y location of face of 'A' pillar bb_height = 274; // internal height of battery box bb_width = 260; // internal width of battery box /***************************************************** * the 'cowl' is the near-horizontal panel which the * bottom of the windscreen is mounted to. In practice * this probably slopes down forward, but for the * moment I'm making the simlifying assumption that it * is horizontal. ****************************************************/ cowl_height = 550; floor_length = 1100; floor_width = 1500; /***************************************************** * TODO: I need to calculate the lengths of everything * which bonds to the front or rear bulkhead from the * layback angles, but I'm being lazy for now ****************************************************/ layback_angle_f = 60; layback_angle_r = 60; sheet_thickness = 8; sill_max_height = bb_height; sill_min_height = 125; sill_width = 150; module battery_box_side( floor_length = 1100) { fhl = (floor_length/2); top_hl = 800; // calculate this later rotate([90, 0 , 0]) linear_extrude( height=sheet_thickness) { polygon([[ 0 - fhl, 0], [ fhl, 0], [ top_hl, bb_height], [ 0 - top_hl, bb_height]]); } } module battery_box( floor_length = 1100) { top_hl = 800; // calculate this later hbbw = bb_width/2; translate([0, hbbw, 0]) battery_box_side( floor_length); translate([0, 0 - (hbbw + sheet_thickness), 0]) battery_box_side( floor_length); translate([0, 0 - hbbw, 0]) cube([sheet_thickness, bb_width, bb_height]); translate([0, 0 - sheet_thickness, bb_height]) cube([1600, bb_width + (sheet_thickness * 2), sheet_thickness], center = true); } module sill( floor_length = 1100) { cr = 5000; fhl = (floor_length/2); top_hl = 800; // calculate this later difference() { rotate([90, 0 , 0]) linear_extrude( height=sill_width) { polygon([[ 0 - fhl, 0], [ fhl, 0], [ top_hl, sill_max_height], [ 0, sill_min_height], [ a_pillar_y, sill_min_height], [ a_pillar_y, cowl_height], [ 0 - top_hl, cowl_height]]); } rotate([-3, 0, 0]) translate([0, cr - (sill_width/2), 0]) cylinder( h = cowl_height, r = cr); } } module front_bulkhead() { } cube([floor_length, floor_width, sheet_thickness], center=true); battery_box(); translate([0, ( floor_width/2) + (sill_width/2), 0]) sill(); mirror([0, 1, 0]) translate([0, ( floor_width/2) + (sill_width/2), 0]) sill();