HOW TO MAKE A NEW 3D PART WITH POV-Ray

Here is a example about the way to follow in order to create case for DC-DC converter TMH from Traco.

First thing is to get components datasheet including dimensional plan. Best is to have in hand a physical part because some dimensions are often missing into datasheets. Here is TMH plan from Traco datasheet.

If printfoot is not yet in eagle libraries, you need you create it.

This printfoot is an existing printfoot modified to match with TMH case dimensions. Note that black cross is the grid origin for X and Y. Such X-Y orientation is not really good for me as I prefer to align X with longer dimension of the part like on the datasheet. So I will create it this way then finally I will rotate it so as it will match with eagle printfoot.

Now I compute dimensions from eagle printfoot origin grid.

One word about the POV-Ray coordinate system. The usual coordinate system for POV-Ray has the positive y-axis pointing up, the positive x-axis pointing to the right, and the positive z-axis pointing into the screen as follows:

This is a basic you should keep in mind. You can get more about it in chapter 2.2.1.1 of POV-Ray help.

The most used shape is probably the box. Here is its syntax:

// create a box that extends between the 2 specified points
box {
<-1, -1, -1> // one corner position <X1 Y1 Z1>
< 1, 1, 1> // other corner position <X2 Y2 Z2>
}


This can be done with a more compact way:

box {<-1, -1, -1> < 1, 1, 1>}

First I create one POV-Ray file named user.inc, it's a text file you can open with POV-Ray and save in POV-Ray include folder. Now you can write in it your own 3D parts but you also write your parts in other text files and add an include directive in the user.inc file. This last way is better if you create lots of parts. I will create the "my_vconvert.inc" file to group several DC-DC converters so I just put the following include directive into user.inc

#include "my_vconvert.inc"

Now I create the "my_vconvert.inc" file and save it also into the include folder. Its structure looks like:

#include "metals.inc" used for pins which need metal texture
#include "colors.inc" used to define Red or any colors

/*********************************************************
//Macros for DC-DC CONVERTERs "TMH" single output voltage from TRACO
//Rev. 1.0 - 19/12/05
**********************************************************/
#macro SPC_DC_DC_TMH_S_GRND(value) Macro name according with creating rules
union{

box{<-10,-10,-10><10,10,10>} objects

}
pigment{Red} color without texture
#end

#macro SPC_DC_DC_TMH_S(value) macro called by ULP
object{SPC_DC_DC_TMH_S_GRND(value)} call the object macro
#end

One can see two macros, the second one is calling first one. More than one macro could call first one passing arguments to get variation like pins number, colors etc.

Here a simple red cube is supposed to be the component case. Let see now how to display it. I create a text file with every things I need to view my 3D part. I mean light, camera location, target location, background. Then I name it "workshop.pov" and save it where you wish. Now I click "Run". Here our case view, hoops! mean future case.

#include "colors" files to add
#include "textures"
#include "metals.inc"
//#include "user.inc"
#include "my_vconvert.inc" object to see

camera{ location <20,-35,30> where is the camera
look_at <0,0,0>} where the camera is looking

light_source{ <-100,200,-200> color White} some light
light_source{ <+100,200,-200> color White}
light_source{ <+100,200,200> color White}
light_source{ <00,-200,00> color White}

sky_sphere {pigment {rgb <0.75,0.75,0.75>}} spherical gray background all around

object{ SPC_DC_DC_TMH_S("TMH1205S")} call the macro

What's happen if I use #include "user.inc" instead of #include "my_vconvert.inc" ?

Here is added a 3D grid making visible X-Y plan. This can be sometime useful but that make also a huge object package with extra computing time. Decide by yourself.

Now go back to the box of our converter and replace cube dimensions with those of THM converter.

In "my_vconvert.inc" I change coordinates and color.

box{<-8.65,0,-6.125><+10.85,+10.2,+1.375>}
pigment{Gray20}

In "workshop.pov" I change the camera location to be front of my converter.

camera{ location <0,0,-25>
look_at <0,0,0>}

 

Bleu, yellow and red lines are respectively X, Z and Y-axis. Let's raise camera for 20mm along Y-axis.

Zero point looks good.

Now I gonna remove some matter at the base of the case. Nothing more simple, I just do a volumetric difference between the green body and the thin red box.

However, in order to get a nice part, the box width should be lightly bigger than body wide. This is also true to the bottom, use -0.1 instead of zero. The reason why this to be done is that when two plans having same location are subtracted, matter is remaining visible even without thickness. When two such plans have different colors, POV-Ray does not know which one to keep as resulting color so it randomly take both colors making a spotted plan. You should use the same color to get only one color.

#macro SPC_DC_DC_TMH_S_GRND(value)
difference{
box{<-8.65,0,-6.125><+10.85,+10.2,+1.375>}
box{<-8.15,-0.1,-6.13><+10.35,+0.5,+1.38>}
}
pigment{Gray20}
#end

Let's add the little circle marking pin 1 to what has to be subtracted of the body.


So, It's right to mark pins but it's better to show them, let's add metallic box for each pin.

Underside view:

We finish by showing "value" argument which is converter reference: "TMH1205S". Text is set with very small thickness 0.1mm and is located at the top letting 0.01mm outside of the body. One could first make a difference body minus text and then adds the text at the same plan but first solution is pretty nice and needs less computation.

Top view, side view, adding a white dot to pin 1 and that's it!

The code:

And what about result on the board? Oops!

No panic, I told you at the beginning and I didn't do it, 90° rotation, both side are perfect now.

The file :