// ------------------------------------ // Outdoor light // ------------------------------------ #version 3.6; #ifndef(pmol_Outdoorlight_open) #local pmol_Outdoorlight_open = 5; #end // ---------------------------------------------------------------------------- // textures // ---------------------------------------------------------------------------- #local t_hammerbluepaint = texture{ pigment{ crackle scale 0.002 color_map{ [0.00 color rgb<0.50, 0.75, 1.00>*0.75] [0.20 color rgb<0.50, 0.75, 1.00>*0.90] [1.00 color rgb<0.50, 0.75, 1.00>*1.00] } } normal{dents 0.5 scale 0.00015} finish{ambient 0 diffuse 0.6 brilliance 2 specular 0.4 roughness 0.01 metallic} } // ------------------------------------ #local t_whitepaint = texture{ pigment{color rgb 1} finish{ambient 0 diffuse 0.6 brilliance 2 phong 0.4 phong_size 5 metallic} } // ------------------------------------ #local t_chrome = texture{ pigment{color rgb 0.2} finish{diffuse 0.4 brilliance 6 phong 1.0 phong_size 100 reflection 0.6} } // ------------------------------------ #local t_glass = material{ texture{ pigment{color rgb 1 filter 0.75} finish{ambient 0 diffuse 0 specular 1 roughness 0.05 reflection{0, 1 fresnel on}} } interior{ ior 1.5 fade_distance 10 fade_power 2 caustics 0.5 } } // ---------------------------------------------------------------------------- // macros // --------------------------------------------------------------------------- // NS = number of sides // OR = Outside radius // H1 = height 1 // H2 = height 2 #macro Rpoly(NS, OR, H1, H2) prism{ linear_sweep linear_spline H1, H2, NS+1 #local ca = 0; #while(ca<=NS) #local ta = vrotate(, <0, 0, (ca/NS)*360>); #local ca = ca+1; #end } #end // ---------------------------------------------------------------------------- // components // --------------------------------------------------------------------------- #local f_ridges1 = function{ pattern{radial triangle_wave frequency 28} } // ------------------------------------ #local f_ridges2 = function{ pattern{gradient x scale<0.120, 1, 1> frequency 10 triangle_wave} } // ------------------------------------ #local f_sphere = function(x,y,z,r){x*x+y*y+z*z-r*r} // ------------------------------------ #local f_cylinderx = function(x,y,z,r){y*y+z*z+-r*r} // ------------------------------------ #local f_ridgesphere = function{f_sphere(x,y,z,1)+f_ridges1(x,y,z)*sqrt(0.0762)} // ------------------------------------ #local f_ridgecylinderx = function{f_cylinderx(x,y,z,1)+f_ridges2(x,y,z)*sqrt(0.0762)} // ------------------------------------ #local pmol_Outdoorlight_glass = difference{ merge{ cylinder{<-0.060, -0.007, 0>, <-0.060, 0, 0>, 0.0635} cylinder{< 0.060, -0.007, 0>, < 0.060, 0, 0>, 0.0635} box{<-0.060, 0.007, -0.0635>, <0.060, 0, 0.0635>} sphere{0, 1 scale 0.0565 translate<-0.060, 0, 0>} sphere{0, 1 scale 0.0565 translate< 0.060, 0, 0>} cylinder{<-0.060, 0, 0>, <0.060, 0, 0>, 1 scale<1, 0.0565, 0.0565>} } plane{y, 0} isosurface{ function{f_ridgesphere(x,y,z)} contained_by{box{<-1, -1, -1>, <0, 0.6, 1>}} threshold 0 accuracy 0.002 max_gradient 20 max_trace 5 scale 0.0525 translate<-0.060, 0, 0> } isosurface{ function{f_ridgesphere(x,y,z)} contained_by{box{<0, -1, -1>, <1, 0.6, 1>}} threshold 0 accuracy 0.002 max_gradient 20 max_trace 5 scale 0.0525 translate< 0.060, 0, 0> } isosurface{ function{f_ridgecylinderx(x,y,z)} contained_by{box{<-0.060001, -1, -1>, <0.060001, 0.6, 1>}} threshold 0 accuracy 0.002 max_gradient 20 max_trace 5 scale<1, 0.0525, 0.0525> } cylinder{<-0.060, 0.029, 0>, <-0.060, 0.035, 0>, 0.0335410} box{<-0.060, 0.029, -0.0335410>, <0.060, 0.035, 0.0335410>} cylinder{< 0.060, 0.029, 0>, < 0.060, 0.035, 0>, 0.0335410} cylinder{<-0.060, 0.034, 0>, <-0.060, 0.040, 0>, 0.0282843} box{<-0.060, 0.034, -0.0282843>, <0.060, 0.040, 0.0282843>} cylinder{< 0.060, 0.034, 0>, < 0.060, 0.040, 0>, 0.0282843} cylinder{<-0.060, 0.039, 0>, <-0.060, 0.045, 0>, 0.0206155} box{<-0.060, 0.039, -0.0206155>, <0.060, 0.045, 0.0206155>} cylinder{< 0.060, 0.039, 0>, < 0.060, 0.045, 0>, 0.0206155} cylinder{<-0.060, 0.044, 0>, <-0.060, 0.050, 0>, 0.013} box{<-0.060, 0.044, -0.013>, <0.060, 0.050, 0.013>} cylinder{< 0.060, 0.044, 0>, < 0.060, 0.050, 0>, 0.013} hollow material{t_glass} translate<0, 0.012, 0.090> rotate<-pmol_Outdoorlight_open, 0, 0> translate<0, 0.038, -0.090> } // ---------------------------------------------------------------------------- #local pmol_Outdoorlight_base = union{ difference{ union{ // outer shape cone{<-0.060, 0.0036514, 0>, 0.0716449, <-0.060, 0.045, 0>, 0.075} cone{< 0.060, 0.0036514, 0>, 0.0716449, < 0.060, 0.045, 0>, 0.075} cylinder{<-0.060, 0.003, 0>, <-0.060, 0.007, 0>, 0.0676602} cylinder{< 0.060, 0.003, 0>, < 0.060, 0.007, 0>, 0.0676602} torus{0.0676602, 0.004 translate<-0.060, 0.007, 0>} torus{0.0676602, 0.004 translate< 0.060, 0.007, 0>} cylinder{<-0.060, 0.007, -0.0676602>, < 0.060, 0.007, -0.0676602>, 0.004} cylinder{<-0.060, 0.007, 0.0676602>, < 0.060, 0.007, 0.0676602>, 0.004} prism{ linear_sweep linear_spline -0.060, 0.060, 7 <-0.0676602, 0.003> <-0.0716449, 0.0066514> <-0.075, 0.045> < 0.075, 0.045> < 0.0716449, 0.0066514> < 0.0676602, 0.003> <-0.0676602, 0.003> rotate<-90,90,0> } } // inner cutout cone{<-0.060, 0.0096514, 0>, 0.0688959, <-0.060, 0.046, 0>, 0.0720760} cone{< 0.060, 0.0096514, 0>, 0.0688959, < 0.060, 0.046, 0>, 0.0720760} cylinder{<-0.060, 0.006, 0>, <-0.060, 0.010, 0>, 0.0649112} cylinder{< 0.060, 0.006, 0>, < 0.060, 0.010, 0>, 0.0649112} torus{0.0649112, 0.004 translate<-0.060, 0.010, 0>} torus{0.0649112, 0.004 translate< 0.060, 0.010, 0>} cylinder{<-0.060, 0.010, -0.0649112>, <0.060, 0.010, -0.0649112>, 0.004} cylinder{<-0.060, 0.010, 0.0649112>, <0.060, 0.010, 0.0649112>, 0.004} prism{ linear_sweep linear_spline -0.060, 0.060, 7 <-0.0649112, 0.006> <-0.0688595, 0.0096514> <-0.0720760, 0.046> < 0.0720760, 0.046> < 0.0688595, 0.0096514> < 0.0649112, 0.006> <-0.0649112, 0.006> rotate<-90,90,0> } } // other bits: // 'feet' on back of box sphere{<-0.085, 0.003, -0.0375>, 0.003} sphere{<-0.085, 0.003, 0.0375>, 0.003} sphere{< 0.085, 0.003, -0.0375>, 0.003} sphere{< 0.085, 0.003, 0.0375>, 0.003} // screw fixing lugs box{<-0.0685, 0.031, 0.072>, <-0.0515, 0.038, 0.0835>} box{< 0.0515, 0.031, 0.072>, < 0.0685, 0.038, 0.0835>} cylinder{<-0.060, 0.031, 0.0835>, <-0.060, 0.038, 0.0835>, 0.0085} cylinder{< 0.060, 0.031, 0.0835>, < 0.060, 0.038, 0.0835>, 0.0085} // hinge lugs prism{ linear_sweep linear_spline -0.004, 0.004, 5 <-0.072, 0.0254123> <-0.0919411, 0.0307556> <-0.090, 0.038> <-0.072, 0.038> <-0.072, 0.0254123> rotate<-90,-90,0> translate<-0.065, 0, 0> } prism{ linear_sweep linear_spline -0.005, 0.005, 5 <-0.072, 0.0264476> <-0.0916823, 0.0317215> <-0.090, 0.038> <-0.072, 0.038> <-0.072, 0.0264476> rotate<-90,-90,0> translate<-0.065, 0, 0> } cylinder{<-0.069, 0.038, -0.090>, <-0.061, 0.038, -0.090>, 0.0075} cylinder{<-0.070, 0.038, -0.090>, <-0.060, 0.038, -0.090>, 0.0065} torus{0.0065, 0.001 rotate<0, 0, 90> translate<-0.069, 0.038, -0.090>} torus{0.0065, 0.001 rotate<0, 0, 90> translate<-0.061, 0.038, -0.090>} cylinder{<-0.069, 0.0317215, -0.0916823>, <-0.069, 0.0264476, -0.072>, 0.001} cylinder{<-0.061, 0.0317215, -0.0916823>, <-0.061, 0.0264476, -0.072>, 0.001} prism{ linear_sweep linear_spline -0.005, 0.005, 5 <-0.072, 0.0254123> <-0.0919411, 0.0307556> <-0.090, 0.038> <-0.072, 0.038> <-0.072, 0.0254123> rotate<-90,-90,0> translate< 0.065, 0, 0> } prism{ linear_sweep linear_spline -0.005, 0.005, 5 <-0.072, 0.0264476> <-0.0916823, 0.0317215> <-0.090, 0.038> <-0.072, 0.038> <-0.072, 0.0264476> rotate<-90,-90,0> translate< 0.065, 0, 0> } cylinder{< 0.069, 0.038, -0.090>, < 0.061, 0.038, -0.090>, 0.0075} cylinder{< 0.070, 0.038, -0.090>, < 0.060, 0.038, -0.090>, 0.0065} torus{0.0065, 0.001 rotate<0, 0, 90> translate< 0.069, 0.038, -0.090>} torus{0.0065, 0.001 rotate<0, 0, 90> translate< 0.061, 0.038, -0.090>} cylinder{< 0.069, 0.0317215, -0.0916823>, < 0.069, 0.0264476, -0.072>, 0.001} cylinder{< 0.061, 0.0317215, -0.0916823>, < 0.061, 0.0264476, -0.072>, 0.001} // hinge pins sphere{0, 1 scale<0.0015, 0.0035, 0.0035> translate<-0.071, 0.038, -0.090> texture{t_chrome}} sphere{0, 1 scale<0.0015, 0.0035, 0.0035> translate<-0.051, 0.038, -0.090> texture{t_chrome}} sphere{0, 1 scale<0.0015, 0.0035, 0.0035> translate< 0.051, 0.038, -0.090> texture{t_chrome}} sphere{0, 1 scale<0.0015, 0.0035, 0.0035> translate< 0.071, 0.038, -0.090> texture{t_chrome}} cylinder{<-0.071, 0.038, -0.090>, <-0.051, 0.038, -0.090>, 0.0025 texture{t_chrome}} cylinder{< 0.051, 0.038, -0.090>, < 0.071, 0.038, -0.090>, 0.0025 texture{t_chrome}} // power cord inlet - should terminate at <-0.153, 0.023, 0> cord radius should be 0.006; intersection{ Rpoly(6, 0.0135, 0, 0.005) cylinder{<0, -0.001, 0>, <0, 0.006, 0>, 0.013} rotate<0, 5, 90> translate<-0.134, 0.023, 0> texture{t_chrome} } intersection{ Rpoly(6, 0.0135, 0, 0.005) cylinder{<0, -0.001, 0>, <0, 0.006, 0>, 0.013} sphere{0, 1 scale<0.014, 0.0044, 0.014> translate<0, 0.0025, 0>} rotate<0, 12, 90> translate<-0.144, 0.023, 0> texture{t_chrome} } cylinder{<-0.150, 0.023, 0>, <-0.131, 0.023, 0>, 0.010 texture{t_chrome}} cylinder{<-0.150, 0.023, 0>, <-0.152, 0.023, 0>, 0.011 texture{t_chrome}} cylinder{<-0.152, 0.023, 0>, <-0.153, 0.023, 0>, 0.010 texture{t_chrome}} torus{0.010, 0.001 rotate<0,0,90> translate<-0.152, 0.023, 0> texture{t_chrome}} texture{t_hammerbluepaint} } // ---------------------------------------------------------------------------- #local pmol_Outdoorlight_lid = union{ difference{ union{ // outer shape lathe{ linear_spline 8 <0, 0> <0.080, 0> <0.080, 0.009> <0.072, 0.017> <0.072, 0.020> <0.068, 0.024> <0, 0.024> <0, 0> translate<-0.060, 0, 0> } lathe{ linear_spline 8 <0, 0> <0.080, 0> <0.080, 0.009> <0.072, 0.017> <0.072, 0.020> <0.068, 0.024> <0, 0.024> <0, 0> translate< 0.060, 0, 0> } prism{ linear_sweep linear_spline -0.060, 0.060, 11 <-0.080, 0> <-0.080, 0.009> <-0.072, 0.017> <-0.072, 0.020> <-0.068, 0.024> < 0.068, 0.024> < 0.072, 0.020> < 0.072, 0.017> < 0.080, 0.009> < 0.080, 0> <-0.080, 0> rotate<-90,90,0> } torus{0.076, 0.004 sturm translate<-0.060, 0.009, 0>} torus{0.076, 0.004 sturm translate< 0.060, 0.009, 0>} torus{0.068, 0.004 sturm translate<-0.060, 0.020, 0>} torus{0.068, 0.004 sturm translate< 0.060, 0.020, 0>} cylinder{<-0.060, 0.009, -0.076>, <0.060, 0.009, -0.076>, 0.004} cylinder{<-0.060, 0.009, 0.076>, <0.060, 0.009, 0.076>, 0.004} cylinder{<-0.060, 0.020, -0.068>, <0.060, 0.020, -0.068>, 0.004} cylinder{<-0.060, 0.020, 0.068>, <0.060, 0.020, 0.068>, 0.004} } // cutout intersection{torus{0.076, 0.004 sturm} box{<-0.080, -0.004, -0.080>, <0, 0.004, 0.080>} translate<-0.060, 0.017, 0>} intersection{torus{0.076, 0.004 sturm} box{<0, -0.004, -0.080>, <0.080, 0.004, 0.080>} translate<0.060, 0.017, 0>} cylinder{<-0.0605, 0.017, -0.076>, <0.0605, 0.017, -0.076>, 0.004} cylinder{<-0.0605, 0.017, 0.076>, <0.0605, 0.017, 0.076>, 0.004} cylinder{<-0.0605, -0.001, 0>, <-0.0605, 0.007, 0>, 0.077} cylinder{< 0.0605, -0.001, 0>, < 0.0605, 0.007, 0>, 0.077} cylinder{<-0.060, 0.006, 0>, <-0.060, 0.021, 0>, 0.069} cylinder{< 0.060, 0.006, 0>, < 0.060, 0.021, 0>, 0.069} cylinder{<-0.060, 0.020, 0>, <-0.060, 0.025, 0>, 0.0575} cylinder{< 0.060, 0.020, 0>, < 0.060, 0.025, 0>, 0.0575} box{<-0.060, -0.001, -0.077>, <0.060, 0.007, 0.077>} box{<-0.060, 0.006, -0.069>, <0.060, 0.021, 0.069>} box{<-0.060, 0.020, -0.0575>, <0.060, 0.025, 0.0575>} } // other bits: prism{ // hinge lug linear_sweep linear_spline -0.0025, 0.0025, 5 <0.079, 0> <0.090, 0> <0.0926383, 0.0070206> <0.0774071, 0.0127443> <0.079, 0> rotate<-90,90,0> translate<-0.0555, 0, 0> } prism{ linear_sweep linear_spline -0.0035, 0.0035, 5 <0.079, 0> <0.090, 0> <0.0922865, 0.0060846> <0.0775472, 0.0116234> <0.079, 0> rotate<-90,90,0> translate<-0.0555, 0, 0> } cylinder{<-0.058, 0, -0.090>, <-0.053, 0, -0.090>, 0.0075} cylinder{<-0.059, 0, -0.090>, <-0.052, 0, -0.090>, 0.0065} torus{0.0065, 0.001 rotate<0,0,90> translate<-0.058, 0, -0.090>} torus{0.0065, 0.001 rotate<0,0,90> translate<-0.053, 0, -0.090>} cylinder{<-0.058, 0.0060846, -0.0922865>, <-0.058, 0.0118083, -0.0770553>, 0.001} cylinder{<-0.053, 0.0060846, -0.0922865>, <-0.053, 0.0118083, -0.0770553>, 0.001} prism{ // hinge lug linear_sweep linear_spline -0.0025, 0.0025, 5 <0.079, 0> <0.090, 0> <0.0926383, 0.0070206> <0.0774071, 0.0127443> <0.079, 0> rotate<-90,90,0> translate<0.0555, 0, 0> } prism{ linear_sweep linear_spline -0.0035, 0.0035, 5 <0.079, 0> <0.090, 0> <0.0922865, 0.0060846> <0.0775472, 0.0116234> <0.079, 0> rotate<-90,90,0> translate<0.0555, 0, 0> } cylinder{< 0.053, 0, -0.090>, < 0.058, 0, -0.090>, 0.0075} cylinder{< 0.052, 0, -0.090>, < 0.059, 0, -0.090>, 0.0065} torus{0.0065, 0.001 rotate<0,0,90> translate< 0.053, 0, -0.090>} torus{0.0065, 0.001 rotate<0,0,90> translate< 0.058, 0, -0.090>} cylinder{< 0.053, 0.0060846, -0.0922865>, < 0.053, 0.0118083, -0.0770553>, 0.001} cylinder{< 0.058, 0.0060846, -0.0922865>, < 0.058, 0.0118083, -0.0770553>, 0.001} // screw fixing lugs cone{<-0.060, 0, 0.0835>, 0.008, <-0.060, 0.0136104, 0.0835>, 0.0079959} cone{< 0.060, 0, 0.0835>, 0.008, < 0.060, 0.0136104, 0.0835>, 0.0079959} torus{0.0065, 0.0015 translate<-0.060, 0.0135, 0.0835>} torus{0.0065, 0.0015 translate< 0.060, 0.0135, 0.0835>} texture{t_hammerbluepaint} translate<0, 0, 0.090> rotate<-pmol_Outdoorlight_open, 0, 0> translate<0, 0.038, -0.090> } // ---------------------------------------------------------------------------- #declare pmol_Outdoorlight = union{ object{pmol_Outdoorlight_base} object{pmol_Outdoorlight_lid} object{pmol_Outdoorlight_glass} } // ------------------------ end of file