//Wooden crate -site:shutterstock.com -site:istockphoto.com -site:colourbox.com -site:123rf.com -site:depositphotos.com -site:clipartof.com -site:clipartguide.com -site:dreamstime.com #include "kolors.inc" #include "woods.inc" #include "stones.inc" #include "functions.inc" #declare ft = 12.0; /* !- Global Switches -! */ #declare RAD = on ; #declare PHO = off ; /* --------------------- */ global_settings { #if(RAD) radiosity { pretrace_start 0.04 pretrace_end 0.005 count 300 nearest_count 10 error_bound 0.1 recursion_limit 2 low_error_factor 0.2 gray_threshold 0.2 minimum_reuse 0.015 brightness 0.69 adc_bailout 0.01/2 } #end #if (PHO) photons { count 20000 autostop 0 jitter 0.4 media 50, 30 } #end assumed_gamma 1.0 max_trace_level 20 } light_source { 0*x rgb 1 translate <20.0, 50.0, -75.0>*ft } camera { perspective location <5.0, 8.0, -10.0>*ft up y right x*(image_width/image_height) look_at <0.0, 2.5, 0.0>*ft } plane { y, 0 pigment { checker color White, color White*0.4 scale ft } finish { ambient 0 diffuse 0.38 specular 0.07 roughness 0.3 } } #declare P_OldWood = pigment { wood turbulence <0.3, 0.1, 0.5> color_map { M_Wood1A } scale <0.125*ft, 1.0, 1.0*ft> } #declare F_OldWood = function { pattern { wood turbulence <0.3, 0.1, 0.5> scale <0.125*ft, 1.0, 1.0*ft> } } #macro Board(W, T, L) #local grain_seed = 15643544181; #local _X = rand(seed(grain_seed))*2e5; #local _Y = rand(seed(grain_seed))*2e5; #local _Z = rand(seed(grain_seed))*2e5; /* #debug concat("_X: " str(_X, 0, 6) "\n") #debug concat("_Y: " str(_Y, 0, 6) "\n") #debug concat("_Z: " str(_Z, 0, 6) "\n") */ isosurface { function { f_rounded_box(x,y,z,0.125, W/2-0.03125*F_OldWood(x-_X,y-_Y,z-_Z), T/2-0.078125*F_OldWood(x-_X,y-_Y,z-_Z), L/2+0.25) } threshold 0 max_gradient 2 contained_by { box { <-W/2, -T/2, -L/2> } } all_intersections pigment { P_OldWood translate <_X,_Y,_Z> } finish { ambient 0 diffuse 0.38 specular 0.07 roughness 0.3 } } #end #declare Pallet = union { union { object { Board(4, 2, 63) rotate 90.0*z translate <-30.5, 2.75, 0.0> } object { Board(4, 2, 63) rotate 90.0*z translate <-3.0, 2.75, 0.0> } object { Board(4, 2, 63) rotate 90.0*z translate <3.0, 2.75, 0.0> } object { Board(4, 2, 63) rotate 90.0*z translate <30.5, 2.75, 0.0> } } #local sT = -2.4375 ; #while(sT <= 2.4375) object { Board(4.5, 0.75, 63) rotate 90.0*y translate <0.0, 0.375, sT*ft> } object { Board(4.5, 0.75, 63) rotate 90.0*y translate <0.0, 5.125, sT*ft> } #local sT = sT + 0.4875 ; #end } #declare crossMember = difference { object { Board(6, 2.0, sqrt(4608)) } box { <-3.1, 0.0, -3.0> <3.1, 1.125, 3.0> } } #declare EndCap = union { #local a = 0; #while(a < 360) object { Board(6, 2.0, 54.0) rotate 90.0*y translate <-3.0, 0.0, 27.0> rotate a*y } #local a = a + 90; #end #local b = -26.0; #while(b <= 26.0) object { Board(4, 2, 56) translate } #local b = b + 4.0; #end intersection { union { object { crossMember rotate -45.0*y } object { crossMember rotate <180.0, 45.0, 0.0> } } box { <-24.0, -1.0, -24.0> <24.0, 1.0, 24.0> } } } #declare SidePlate = union { #local a = 0; #while(a < 360) object { Board(6, 2.0, 52.0) rotate 90.0*y translate <-3.0, 0.0, 26.0> rotate a*y } #local a = a + 90; #end #local b = -24.0; #while(b <= 24.0) object { Board(6, 2, 54) translate } #local b = b + 6.0; #end intersection { union { object { crossMember rotate -45.0*y } object { crossMember rotate <180.0, 45.0, 0.0> } } box { <-23.0, -1.0, -23.0> <23.0, 1.0, 23.0> } } } #declare Pallet_Crate = union { object { Pallet } union { object { EndCap translate 1.0*y } object { EndCap rotate 180.0*z translate 61.0*y} #local a = 0; #while(a < 360) object { SidePlate rotate <90.0, -90.0, 0.0> translate <29.0, 31.0, -1.0> rotate a*y } #local a = a + 90; #end translate 5.5*y } } object { Pallet_Crate }