#include "woods.inc"

#declare ValueA = 0.75;

#declare BoardA = prism{linear_sweep linear_spline ValueA + 0.1, -ValueA - 0.1, 5, 
							<0, -0.7>,<0.05,-0.75>,<0.2,-0.75>,<0.25,-0.7>,<0,-0.7> texture{T_Wood13} }
#declare GroupA = union{
						object{BoardA translate -0.75*x}
						object{BoardA translate -0.5 *x}
						object{BoardA translate -0.25*x}
						object{BoardA }
						object{BoardA translate 0.25*x}
						object{BoardA translate 0.5*x}
						translate -0.15*z
					}
					
#declare BoardB = prism{
						linear_sweep linear_spline 
						0.9, 0.95, 7, 
						<0.5,0.75>, <0.75,0.75>, <0.75,0.5>, <-0.5,-0.75>, <-0.75,-0.75>, <-0.75,-0.5>, <0.5,0.75> texture{T_Wood16} 
					} 

#declare CrateObj = //dx,dy,dz (2,2,2) 
					// Xmin -1 - Xmax 1 - Ymin 0 - Ymax 2 - Zmin -1 - Zmax 1 
union{
	difference{
		box{-1,1}
		box{<-2,-ValueA,-ValueA>,<2,ValueA,ValueA>}//extrude x
		box{<-ValueA,-2,-ValueA>,<ValueA,2,ValueA>}//extrude y
		box{<-ValueA,-ValueA,-2>,<ValueA,ValueA,2>}//extrude z
		texture{T_Wood11}
	}
	object{GroupA}              //front
	object{BoardB rotate -90*x}//  "
	object{GroupA rotate 180*y}//back
	object{BoardB rotate 90*x}//   "
	object{GroupA rotate -90*y}//right
	object{BoardB rotate -90*z}//  " 
	object{GroupA rotate 90*y}//left
	object{BoardB rotate 90*z}//  "
	object{GroupA rotate 90*x}//above
	object{BoardB}           //  "
	object{GroupA rotate -90*x}//beneath
	object{BoardB rotate 180*z}//  "
	translate y
}
