//************************************************************** #macro CR2032H(value) //First, we make a leg. We will use this object many times, so we define it once here as a local definition. #local leg = object { cylinder {<0,-3,0>,<0,2.5,0>,0.25 texture{col_silver}} } #local leg2 = object { cylinder {<0,0,0>,<0,2.5,0>,0.4 pigment{Gray10}} } union { //Now, we put all legs in place //object{ leg translate< 0.0,0.0,0.0>} object{ leg translate< -5.08,0.0,0.0>} object{ leg translate< 15.24,0.0,0.0>} object{ leg2 translate< -8.89,0.0,5.08>} object{ leg2 translate< 8.89,0.0,5.08>} object{ leg2 translate< 0.0,0.0,-10.16>} box {<13.0,2.5,-3.0>,<17.0,7.5,3.0> pigment{Gray10}} difference { cylinder {<0,2.5,0>,<0,7.5,0>,14 pigment{Gray10}} cylinder {<0,5.0,0>,<0,7.5001,0>,10 pigment{Gray10}} prism { 5.0, 7.5001, // y0, y1 4, // number of points <-14.00, -8.08>, <-14.00, 8.08>, < 0.00, 0.0>, <-14.00, -8.08> pigment{Gray10} //texture{pigment{color White} finish {ambient 0.15 diffuse 0.85}} } } // CR2032 difference { cylinder {<0,5.2,0>,<0,7.6,0>,9.8 texture{col_silver}} text { ttf besch_font "CR2032" 0.15,0 scale 2.0 translate<-3.8,-6,-7.73> rotate<90,0,0> texture{col_silver} } } // clip difference { prism { 0, 3.25, // y0, y1 15, // number of points <0.0, 0.0>, <0.0, 1.0>, <0.5,1.5>, <7.0,1.5>, <10.0,0.5>, <19.0,0.5>, <21.9,1.0>, <22.0,0.5>, <19.0,0.0>, <10.0,0.0>, <7.0,1.0> < 0.7, 1.0>,< 0.5, 0.8>,< 0.5, 0.0>, <0.0, 0.0> texture{col_silver} rotate<-90,180,0> translate<15.5,7.5,-1.625> } text { ttf besch_font "+" 0.1,0 scale 4.0 translate<-2.5,-1.2,-8.2> rotate<90,0,0> texture{col_silver} } } //Since we built it from the lower front left corner, we translate all the object to put the center at <0,0,0> //translate<5.08,0,0> rotate<0,-90,0> } #end