// rev 28-03-2018 // modif parametres , car affichage miroir ..était impossible de compesner avec rotate // affiche 0 des dizaines de secondes si secondes < 10 // POV-Ray 3.6/3.7 include file "Seven_Segment_LCD.inc.inc" // author: Friedrich A, Lohmueller, May-2009, May-2014 // homepage: http://www.f-lohmueller.de/ // email: Friedrich.Lohmueller_aT_t-online.de //-------------------------------------------------- #version 3.62; //------------------------------------------------- #macro S7_Element( SS_Color__ ) #local SS_Width = 1.18; //was 1.2 #local SS_Length = 6.0; #local SS_Diag = sqrt(SS_Width*SS_Width)/2; // polygon { number of points, list of points - closed series! } polygon { 7, <-SS_Length/2, 0>, <-SS_Length/2+SS_Diag, -SS_Width/2>, < SS_Length/2-SS_Diag, -SS_Width/2>, < SS_Length/2, 0>, < SS_Length/2-SS_Diag, SS_Width/2>, <-SS_Length/2+SS_Diag, SS_Width/2>, <-SS_Length/2, 0> texture {SS_Color__} rotate<90,0,0> } // end of polygon #end //------ end of macro //--------------------------------------------- #macro Seven_Segment_LCD( SS_Number, SS_Angle, SS_Background_Scale, SS_Light_Color, SS_Shade_Color, SS_Background_Color, SS_Point_On, SS_Point_Active, ) //---------- #local SS_Len = 6.2; #local SS_Width = 1.18; //was 1.2 #local D = 0.0001; // just a little bit !! #local Sheer_Factor = tan(radians(SS_Angle)); //----------- // The sequence of the elements: a,b,c,d,e,f,g // - 1 // / / 6 2 // - 7 // / / 5 3 // - 4 // #switch (SS_Number) #case(-1) #local Lights_On = array [7] {0,0,0,0,0,0,1} #break #case(0) #local Lights_On = array [7] {1,1,1,1,1,1,0} #break #case(1) #local Lights_On = array [7] {0,1,1,0,0,0,0} #break #case(2) #local Lights_On = array [7] {1,1,0,1,1,0,1} #break #case(3) #local Lights_On = array [7] {1,1,1,1,0,0,1} #break #case(4) #local Lights_On = array [7] {0,1,1,0,0,1,1} #break #case(5) #local Lights_On = array [7] {1,0,1,1,0,1,1} #break #case(6) #local Lights_On = array [7] {1,0,1,1,1,1,1} #break #case(7) #local Lights_On = array [7] {1,1,1,0,0,0,0} #break #case(8) #local Lights_On = array [7] {1,1,1,1,1,1,1} #break #case(9) #local Lights_On = array [7] {1,1,1,1,0,1,1} #break #else // nothing - all off!!! #local Lights_On = array [7] {0,0,0,0,0,0,0} #break #end // end arrays //--------------------- #macro Light_Color(Num) #if(Lights_On[Num] = 1) SS_Light_Color #else SS_Shade_Color #end #end //----- end of macro ------ union{ union{ object{ S7_Element( Light_Color(1-1)) translate<0,0, SS_Len> } object{ S7_Element( Light_Color(7-1)) translate<0,0, 0> } object{ S7_Element( Light_Color(4-1)) translate<0,0,-SS_Len> } object{ S7_Element( Light_Color(2-1)) rotate<0,90,0> translate< SS_Len/2,0, SS_Len/2> } object{ S7_Element( Light_Color(3-1)) rotate<0,90,0> translate< SS_Len/2,0,-SS_Len/2> } object{ S7_Element( Light_Color(6-1)) rotate<0,90,0> translate<-SS_Len/2,0, SS_Len/2> } object{ S7_Element( Light_Color(5-1)) rotate<0,90,0> translate<-SS_Len/2,0,-SS_Len/2> } matrix< 1, 0, 0, // matrix-shear_z_to_x 0, 1, 0, Sheer_Factor, 0, 1, 0, 0, 0 > } // end LEDs #if(SS_Point_On = 1) disc{ , y,SS_Width/2 #if(SS_Point_Active = 1) texture{ SS_Light_Color}} #else texture{ SS_Shade_Color}} #end #end // #if(SS_Point_On = 1) box{ <-SS_Len/2,-0.01 ,-SS_Len>, < SS_Len/2,-0.0000001, SS_Len> scale SS_Background_Scale texture {SS_Background_Color}} translate<0,D,0> } // end of union // #end //----- end of macro ---------------------