// the book shelf


#local shelfbottominnerround = 0.2;
#local shelfbottomouterround = 0.1;
#local shelfbottomthick = 1.2;
#local folderHeight = 31.5;
#local folderWidth  = 5.3;
#local folderDepth  = 29;
#local folderEdge   =  0.35;
#local folderMaterialThick = 0.25;

#local folder = superellipsoid {
    <0.011, 0.051>
    scale 0.5
    scale <folderDepth,folderHeight,folderWidth>
    translate <-0.525*folderDepth,0.5*folderHeight,0>
}








#declare bookShelf = union {
union {
	box {
		<-50,shelfbottomouterround,-50>,<0,shelfbottomthick-shelfbottominnerround,50>
	}
	box {
		<-50,0,-50>,<-shelfbottominnerround,shelfbottomthick,50>
	}
	cylinder {
		<-shelfbottominnerround,shelfbottomthick-shelfbottominnerround,-50>,<-shelfbottominnerround,shelfbottomthick-shelfbottominnerround,50>,shelfbottominnerround
	}
	cylinder {
		<-shelfbottominnerround,shelfbottomouterround,-50>,<-shelfbottominnerround,shelfbottomouterround,50>,shelfbottomouterround
	}
	texture { bookshelfTexture }
	}
	object {
		folder
		texture { folderTexture1 }
		translate <0,shelfbottomthick,-3*(folderWidth-0.1)>
	}
	object {
		folder
		texture { folderTexture2 }
		translate <0,shelfbottomthick,-2*(folderWidth-0.1)>
	}
	object {
		folder
		texture { folderTexture1 }
		translate <0,shelfbottomthick,-folderWidth-0.3>
	}
	object {
		folder
		texture { folderTexture2 }
		translate <0,shelfbottomthick,0>
	}
	object {
		folder
		texture { folderTexture1 }
		translate <-0.4,shelfbottomthick,folderWidth+0.1>
	}
	object {
		folder
		texture { folderTexture2 }
		translate <-0.2,shelfbottomthick,2*(folderWidth+0.1)>
	}
	object {
		folder
		texture { folderTexture1 }
		translate <0,shelfbottomthick,3*(folderWidth+0.1)>
	}
	object {
		folder
		texture { folderTexture2 }
		translate <0,shelfbottomthick,4*(folderWidth+0.1)>
	}
	object {
		folder
		texture { folderTexture1 }
		translate <0,shelfbottomthick,5*(folderWidth+0.1)>
	}
	object {
		folder
		texture { folderTexture1 }
		translate <0,shelfbottomthick,6*(folderWidth+0.1)>
	}
}
