|
||
Search Here
MISC
SKILLS
HARDWARE
SCIENCE |
Want to make pretty 3D images of your circuits?
I thought so. Enjoy my Eagle3D tutorial!
Preface on Eagle
I have no plans as of the moment to write a tutorial on how to use Eagle, as there are already quite a few tutorials on the web:
After you have designed your circuit, you would probably next want to view the propagated PCB in 3D for both verification and cool-looking presentations. This is where we will start.
Eagle3D
But thankfully you have this tutorial, so it should only take you about 10 minutes =)
Step 1
Step 2
A new window will come up asking you to find a .ulp file. Browse into your Eagle3D directory (where you installed it) and select the file 3d41.ulp. Now select your language, and then browse for the output file (it will only ask you this once).
Step 3
There are tons of options here, such as shadowing, camera angles, lighting, coloring, etc. Don't worry about them for now - the defaults will give you decent results. But you may want to play around with it in the future to get that 'perfect' look. A highly suggested modification would be to rotate the board some. I like to change the Y:
Click create POV-File. This will take a few seconds to process. There is a good chance it will ask you various questions about your board components - answer as best you can. After processing is complete, you will now have a .pov file. You are halfway done! Now you need a post-processor to convert that .pov into a pretty picture . . .
Step 4
Install the software, and load it up. Click on the Open file icon, and locate your .pov file created in the previous step:
Step 5
Click Tools -> Edit master POVRAY.INI A notepad file should load up. At the very bottom of it, add this line: Library_Path="C:\Program Files\Eagle3D\povray" Make sure the directory points to where you installed Eagle3D. Now save and close the file.
Step 6
Use the section: drop-down menu to select your preferred size. Including AA will give you smoother better looking images, but will also double the processing time. (see below for an example) When you are all ready to go, push the Render button. Immediately this 'error' message will pop-up. Just push OK and ignore it. It won't happen again.
Step 7
Feel free to change the camera angle and image sizes.
Adding Components to Eagle3D, Step 8
First, click the Open file button in POV-Ray. Locate and open the file user.inc in the Eagle3D\povray folder. Next, click Open again, and change Files of type: to All Files (*.*). Locate and open the file 3dusrpac.dat in your Eagle3D folder. By default, both of these files should be blank.
Step 9
Now we need to change PACKAGE_NAME and MACRO_NAME to actual values. To find the PACKAGE_NAME, first go back to your schematic page on Eagle, click the info button, then click a component that is missing in the 3D image:
Replace PACKAGE_NAME with the Package variable. In this case it is SD4-01. Note that this is always in caps!
Step 10
First you need to locate a part that looks like what you need (or close to it). Download the Eagle3D image library (36mb) and unzip it into a folder. Set the folder options to thumbnail view so you can see them all. Locate a matching component (or as close as possible), and copy the file name onto your clipboard (minus the .png file extension). Lets say hypothetically you choose CON_DIS_MATNLOK_9263_13_1 which looks something like this:
Once again, using the Open dialog in POV-Ray, go into your Eagle3D\povray and locate the file connector.inc because you needed a connector. If you needed a switch instead, you would use switch.inc. Etc. Search the connector.inc file for the part name. You will find this:
#macro CON_DIS_MATNLOK_9263_13_1() object{CON_DIS_MATNLOK_9263_GRND(5,1)} #end Copy this code exactly and paste it in the user.inc you opened earlier. You will need to add the word value in the parenthesis and the union{} thing:
#macro CON_DIS_MATNLOK_9263_13_1(value) union{ object{CON_DIS_MATNLOK_9263_GRND(5,1)} }
Now back to the 3dusrpac.dat, replace MACRO_NAME with CON_DIS_MATNLOK_9263_13_1
to get this:
Now go back to the beginning of this tutorial, recreate the .pov file, and render your image again. If you did everything right, your new component should appear. Just say Yes, Reload in POV-Ray:
Step 11 - The hard step!!!
Now I'm definitely no professional programmer, but I will tell you it took me only about two hours of brain frying (guessing until it worked) to create my first part. And I didn't use the tutorial. Play with it for a bit and you will figure it out. Basically all you are doing is defining color, texture, and coordinates of basic shapes. Oh, and you will probably notice that the source code has a lot of German in it. So if you are awesome like me and can't read German, translate it! One hint of useful advice. You may notice that your components placed on the PCB are rotated or translated wrong. Easily solved. For our earlier example, in the connector.inc file locate the macro and right before the #end add these lines:
//add numbers in millimeters to translate the part translate <0,0,0> //add angles to rotate the part rotate <0,0,0>
Now for those who don't want to bother programming and have a CAD program, see step 12.
Step 12 - Convert a 3D CAD .stl file to .pov (Optional)
First, using your preferred CAD program, save your CAD file as a .stl. This file type is an industry standard. Next, download this small .stl to .pov conversion utility. For more info and source code, feel free to check out the stl2pov homepage. Unzip the file. Next, open up a command prompt window (click start->Run..., then type 'cmd', push OK):
Go in to the stl2pov directory:
Then type 'stl2pov input.stl >output.inc', where input is the name of your .stl file and output is the desired output pov file. Optionally, you can also type 'stl2pov input.stl|more' for more stuff. Push enter. note: in v3.0, do not use the > character. Wait until its done. You now have a .inc file you can use with any macro. Just make sure that its included:
Go back to Step 5 to add
this line in POVRAY.INI:
To view your new file and/or to include it, load up POVRay, select the New icon, and paste this code into it:
#include "output.inc" background {color rgb 1} light_source {<-100,1000,-1000> rgb 1} global_settings { assumed_gamma 2 } camera { orthographic location <10,10,-10> scale 0.2 look_at <2,0,2> } object { m_ascii texture { pigment {color <1,0,0>} finish {phong 0.5} } } Save this new DrawSTL.pov file wherever. Now just Render it as described in Step 6 and higher. To add it to your PCB, in user.inc add this: //custom CAD STL #macro MICRO_SD_GRND(value) union { #include "output.inc" object { m_ascii //texture{col_silver} texture { pigment {color <1,1,1>} finish {phong 0.5} } } translate <-14,15,-2> rotate <90,0,0> } #end #macro MICRO_SD(value) object{MICRO_SD_GRND(value)} #end |
|
Has this site helped you with your robot? Give us credit -
link back, and help others in the forums! Society of Robots copyright 2005-2014 |