#declare DecalInt = 0.02;
#declare Height = 0.01;
#declare SlabRotateSeed = seed( 4096 );
#declare ExitRoadLength = 50;

#declare ConcretePig =
pigment{ image_map{ png "imagesMap/grayConcreteTexture.png" map_type 0 interpolate 2 } rotate 90 * x }
	
#declare SlabGeom =
union{
	box{< 0, 0, 0 >,< 1, Height, 1 > }
	box{< DecalInt, 0, DecalInt >,< 1 - DecalInt, Height * 2, 1 - DecalInt > }
}

#declare SlabMiddle = ( max_extent( SlabGeom ) + min_extent( SlabGeom ) ) / 2;

#declare ConcreteSlab =
object{ SlabGeom pigment{ ConcretePig } }

#macro PlaceConcreteSlabsAroundWarehouse()
	#for( XPos, WallMinExtent.x - 1, WallMaxExtent.x )
		#for( ZPos, WallMinExtent.z, WallMaxExtent.z )
			object{ ConcreteSlab translate -SlabMiddle * < 1, 0, 1 > rotate int( AffineFunc( 0, 1, 0, 3, rand( SlabRotateSeed ) ) ) * 90 * y 
				translate SlabMiddle * < 1, 0, 1> translate < XPos, 0, ZPos > }
		#end
	#end
#end

#macro PlaceConcreteSlabsForRoad()
	#for( XPos, WallA_Entrance_I.u, WallE_Entrance_I.u - 1 )
		#for( ZPos, WallA_Entrance_I.v, WallA_Entrance_I.v + ExitRoadLength )
			object{ ConcreteSlab translate -SlabMiddle * < 1, 0, 1 > rotate int( AffineFunc( 0, 1, 0, 3, rand( SlabRotateSeed ) ) ) * 90 * y 
				translate SlabMiddle * < 1, 0, 1> translate < XPos, 0, ZPos > }
		#end
	#end
#end

#macro PlaceConcreteSlabsForFarRoad()
	#for( XPos, -HillsTotalWidth / 2, HillsTotalWidth / 2 )
		#for( ZPos, 0, WallE_Entrance_I.u - 1 - WallA_Entrance_I.u )
			object{ ConcreteSlab translate -SlabMiddle * < 1, 0, 1 > rotate int( AffineFunc( 0, 1, 0, 3, rand( SlabRotateSeed ) ) ) * 90 * y 
				translate SlabMiddle * < 1, 0, 1> translate < XPos, 0, ZPos + WallA_Entrance_I.v + ExitRoadLength > }
		#end
	#end
#end
