So you just finished your first PCB in Eagle. Good job. Me too actually, and after a few days I came across something very cool. Eagle3D. Eagle3D takes your Eagle .brd file and renders it as a 3D image, so you get to see the board in a photorealstic way. (I think I’ve been saving up photorealistic to use in a post-1995 context. I really don’t think I’ve seen it used to describe anything since the box of Myst). So you download Eagle3D, you download POVray, you copy your include files over there, generate your .pov file, and you launch POVray in anticipation… and then it crashes.
So here’s the deal. POVray for the Mac is either being developed poorly, or more likely is simply not the center of the universe for it’s developers. On the POVray website they blame Apple for not properly keeping up the PPC emulator. I want to support these folks for their hard work, but seriously… we’ve been using all-intel Macs for 4 years now. Time to move on. At any rate, this problem occurs in a few machines, and it’s not quite clear which ones. The problem has something to do with preferences, and Intel Macs between 2006 and 2007 (of course, my Mac is an early 2008 model, but who’s counting?)
Because I couldn’t find any easy answers to getting POVray to run, I was pleased to have found a solution. Here are the steps needed to get your board rendered in 3D:
1. Download these things:
2. Install MegaPOV, and Eagle3D (if you haven’t already)
MegaPOV is a derivative of POVray, and it’s fortunately written in Cocoa and is a proper universal binary. Because it will run properly, we can use it to render the images Eagle3D turns out. MegaPOV is an easy click-and-drag to install. Just stick it in your Applications folder. For Eagle 3D, I recommend you move the folder into the EAGLE folder in your Applications directory. Good place to have it.
3. Copy over needed include files
In order to use MegaPOV for Eagle3D, we need to copy some include files from POVray . In the POVray folder, you’ll see a folder called includes. Rename this folder to “pov-includes” (or whatever you would like), and copy the folder into the MegaPOV folder.
4. Make changes to the Eagle3D UPL
In POVray, you can name variables starting with lowercase letters. MegaPOV is not as courteous in that respect, and so if you try to render an Eagle3D pov file, it’ll throw and error:
It’s relatively easy to fix this. The variable named environment is the culprit, and we’ll need to change it in the ulp file in the Eagle 3D folder. As Eagle3D is a few years old, everyone is probably using the 3d41.ulp. If you’re not, you’ll need to change the file you’re using.
Find the following lines in the code:
46: "#if(environment=on)n" 1023: if(opt_amb==1) printf("n#declare environment = on;n"); 1024: else printf("n#declare environment = off;n");
Change those lines to look like this (respectively):
46: "#if(Environment=on)n" 1023: if(opt_amb==1) printf("n#declare Environment = on;n"); 1024: else printf("n#declare Environment = off;n");
That’s it, no other changes to be made in the code. You just need to capitalize the E in “Environment”!
5. Set additional include paths
We need some of the include files that are floating around here. In MegaPOV you can set two include paths. It provides a convenient open dialog. You need to select:
6. Make your board!
That’s all you need to do. From this point, you need to simply run the Eagle3D script in EAGLE, and it’ll generate your .pov. Open your .pov in MegaPOV, and it should render just fine.