POV-Ray : Newsgroups : povray.newusers : Change component color Server Time
26 Dec 2024 06:46:20 EST (-0500)
  Change component color (Message 1 to 3 of 3)  
From: Vasconcelos
Subject: Change component color
Date: 13 Nov 2021 22:45:00
Message: <web.619084fdba305a36c193c9042deb432a@news.povray.org>
Hi , I 'm a beginner in POV Ray , could you help me ?
I did a render of an electronic board and I would like to change the color
of a capacitor, I checked the file "e3d_cap.inc", I made several changes, but I
am not able to change the color of the capacitor body. In fact, I can even
change the color, but the component's polarity marking disappears.
Help !!


union{
    //Elko Körper
    difference{
        union{

            cylinder{<0,0.5,0><0,hig-0.5,0>dia }


            //Elko Rundung oben
            torus{dia-0.5,0.5 translate<0,hig-0.5,0> }

            difference{

                cylinder{<0,hig-0.5,0><0,hig,0>dia-0.5 }

                cylinder{<0,hig-0.5,0><0,hig+0.1,0>dia*0.8*pow(dia/16,0.11)}

            }
            //Elko Rundung unten
            torus{dia-0.5,0.5 translate<0,0.5,0>}
        }
        //Aussparung unten
        torus{dia+0.85,1 translate<0,2.5,0>}

        //Textur für Minusmarkierung
        //pigment{image_map{png "tex_elko.png"}scale tex_scale} => AQUI ERA O



        pigment{image_map{png "tex_elko.png"}scale tex_scale  }


        finish{reflection { 0.03, .1}   phong 0.4 crand 0.05 ambient (0.1 *
global_ambient_mul)}



    }

    //Abdeckung oben
    difference{

        cylinder{<0,hig-0.5,0><0,hig-0.1,0>dia*0.8*pow(dia/16,0.11)}
        box{<0,hig-0.35,-0.1><dia,hig,0.1>}
        box{<0,hig-0.35,-0.1><dia,hig,0.1> rotate<0,120,0>}
        box{<0,hig-0.35,-0.1><dia,hig,0.1> rotate<0,240,0>}

        texture{col_silver}

    }

    //Abdeckung unten
    cylinder{<0,0.2,0><0,0.5,0>dia-0.5 pigment{Black}}
    union{
        #if(pin_short=off)
            cylinder{<0,0,0><0,-14.5,0>dia_b translate<dis/2,0,0>}    //Beinchen
rechts
            cylinder{<0,0,0><0,-17.5,0>dia_b translate<-dis/2,0,0>}   //Beinchen
links
        #else
            cylinder{<0,0,0><0,-1*(pcb_height+pin_length)-0.2,0>dia_b
translate<dis/2,0,0>}    //Beinchen rechts
            cylinder{<0,0,0><0,-1*(pcb_height+pin_length)-0.2,0>dia_b
translate<-dis/2,0,0>}   //Beinchen links
        #end
        texture{e3d_tex_silver}

    }

    //Beschriftung
    intersection{
        cylinder{<0,0,0><0,hig,0>dia}
        text {ttf besch_font value 0.2, 0 scale val_size rotate<0,0,90>
translate<0,0,-dia>}
        rotate<0,0,180>
        rotate<0,10,0>
        translate<0,hig-val_size,-0.001>
        pigment {rgb<0.4,0.6,1>}


    }
    intersection{
        cylinder{<0,0,0><0,hig,0>dia }
        text {ttf besch_font value 0.2, 0 scale val_size rotate<0,0,90>
translate<0,0,-dia>}
        rotate<0,0,180>
        rotate<0,100,0>
        translate<-0.001,hig-val_size,0>
        pigment {rgb<0.4,0.6,1>}

    }
    intersection{
        cylinder{<0,0,0><0,hig,0>dia }
        text {ttf besch_font value 0.2, 0 scale val_size rotate<0,0,90>
translate<0,0,-dia>}
        rotate<0,0,180>
        rotate<0,190,0>
        translate<0,hig-val_size,0.001>
        pigment {rgb<0.4,0.6,1>}
    }
    finish{F_MetalE ambient (0.1 * global_ambient_mul)}
    translate<0,0.2,0>


}
#end


Post a reply to this message


Attachments:
Download 'change color.png' (31 KB)

Preview of image 'change color.png'
change color.png


 

From: m@b
Subject: Re: Change component color
Date: 14 Nov 2021 02:47:18
Message: <6190bf06$1@news.povray.org>
On 14/11/2021 11:42 am, Vasconcelos wrote:
> Hi , I 'm a beginner in POV Ray , could you help me ?
> I did a render of an electronic board and I would like to change the color
> of a capacitor, I checked the file "e3d_cap.inc", I made several changes, but I
> am not able to change the color of the capacitor body. In fact, I can even
> change the color, but the component's polarity marking disappears.
> Help !!


 > pigment{image_map{png "tex_elko.png"}scale tex_scale  }



The file "tex_elko.png" is an image, the image is mapped onto a cylinder 
by POV-Ray.

You can edit the image using any graphics programme such as Paint on 
windows.


Post a reply to this message


Attachments:
Download 'tex_elko.png' (1 KB) Download 'tex_elko_edited.png' (2 KB)

Preview of image 'tex_elko.png'
tex_elko.png

Preview of image 'tex_elko_edited.png'
tex_elko_edited.png


 

From: Vasconcelos
Subject: Re: Change component color
Date: 15 Nov 2021 02:10:00
Message: <web.619207081b6c506ec193c9042deb432a@news.povray.org>
"m@b" <sai### [at] googlemailcom> wrote:
> On 14/11/2021 11:42 am, Vasconcelos wrote:
> > Hi , I 'm a beginner in POV Ray , could you help me ?
> > I did a render of an electronic board and I would like to change the color
> > of a capacitor, I checked the file "e3d_cap.inc", I made several changes, but I
> > am not able to change the color of the capacitor body. In fact, I can even
> > change the color, but the component's polarity marking disappears.
> > Help !!
>
>
>  > pigment{image_map{png "tex_elko.png"}scale tex_scale  }
>
>
>
> The file "tex_elko.png" is an image, the image is mapped onto a cylinder
> by POV-Ray.
>
> You can edit the image using any graphics programme such as Paint on
> windows.

Thank you.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.