include <dimensions.scad>

use <top.scad>
use <stand.scad>
use <connector.scad>

// === top sides ===
translate([0, 0, benchheight-topsideheight]){
	topside();
}
translate([topdepth, toplength, benchheight-topsideheight]){
	rotate([0, 0, 180])
		topside();
}

// === topbeams ===
for (i=[0:topdepth/topbeamthickness-1]) {
	translate([topbeamthickness*i, topsidewidth, benchheight-topheight]) {
		beam();
	}
}

// === stand bottom ===
translate([standoffset, standsideoffset, 0]){
	standbottom();
}
translate([standoffset, toplength-standbeamthickness-standsideoffset, 0]){
	standbottom();
}

// === stand top ===
translate([standtopoffset, standsideoffset, benchheight-topheight-standbeamthickness]){
	standtop();
}
translate([standtopoffset, toplength-standbeamthickness-standsideoffset, benchheight-topheight-standbeamthickness]){
	standtop();
}

// === stand verticals ===
translate([standoffset+standvertoffset, standsideoffset, standbeamthickness]){
	standvertical();
}
translate([topdepth-standoffset-standvertoffset-standbeamthickness, standsideoffset, standbeamthickness]){
	standvertical();
}
translate([standoffset+standvertoffset, toplength-standsideoffset-standbeamthickness, standbeamthickness]){
	standvertical();
}
translate([topdepth-standoffset-standvertoffset-standbeamthickness, toplength-standsideoffset-standbeamthickness, standbeamthickness]){
	standvertical();
}

// === connector beams ===
translate([topdepth-standoffset-standvertoffset-standbeamthickness/2-connectorthickness/2, standsideoffset+standbeamthickness, connectorgroundoffset]){
	connector();
}
translate([standoffset+standvertoffset+standbeamthickness/2-connectorthickness/2, standsideoffset+standbeamthickness, connectorgroundoffset]){
	connector();
}
