[Tutorial] Generating 3D PCB Data in seconds

In this Tutorial i will show you the few steps needed to generate 3D PCB Information easily.
First of all you will have to use this tools:

  • EAGLE Layout Editor (generate-3d-idf-data.ulp) – for generating idf Information.
  • IDFStepper – for generating STEP Data.
  • FreeCAD – for viewing generated 3D Data and assembly with housing models.

If you are using EAGLE, you know how libraries are organized in Symbols, Packages and Devices.
In some other tutorials i will show how to set up all library Informations properly, this tutorial will focus only on the library parts concerning 3D Data, which is the Package Information. This additional Infomation to generate step-files will cost you maybe one additional minute when creating a new Package but the 3D Information you get is completely amazing.

First of all you will have to generate some new layers in the Package of a Device:

  • Package Layer 57: for top placed parts
  • Package Layer 58: for bottom placed parts

(just copy paste into the command line of eagle-Package Editor: layer ’57’ tCAD or layer ’58’ bCAD)

By only drawing the outlines of your part in this layers, shapes will later be extruded with the height of your line width (1 µm width = 1mm heigth). The line width determines the extrusion height. If you want some pins of your e.g. TQFP part shown in the 3D Model you will have to draw extra rectangular shapes for every pin.

Layer 57: tCAD Polygons for Plastic Case and Pins

Be aware, that eagle connects lines which are close together, to a single polygon, therefore, parallel outline shape of pins and plastic case should not be connected since you will get errors when generating the idf-file. You can check if they are connected, by zooming in wide, or only moving the shapes a bit. You will see if they stick together immediately. To have no problems i move the conours by entering the numbers directly into the Info of a shape contour, so they will always be in a distance of more than 1µm. In the 3D Model you wont see that distance between feet and plastic case.

NOTE: Be sure that you draw something like the maximum outline dimensions, since big parts may have mm Tolerances and they might collide in your housing if you don’t consider that sometimes parts are bigger than the typ. size shown in the Datasheets!

Layer 50: PCB Outline with PCB cutout

Next step is to generate a new layer in your .brd:
.brd Layer 50: for the PCB Outline (you may copy only the Dimension to that Layer). as in the Package.
The line width also determines the PCB Thickness, in the same way.


one simple PCB Outline with a breakthrough and three simple Parts placed
one simple PCB Outline with a breakthrough and three simple Parts placed

If you want some cutouts or breaktroughs in your Board, you can do so by defining a Polygon with line width set to 0.0µm. When you are done with the Layout, here in my tiny example i only put one Resistor and another Capacitor onto the Board, it may look something like this.

After that you will have to generate the 3D idf Data with a eagle ulp Program called generate-3d-idf-data.ulp.

step file generated with idf-stepper (idf and idb file as Input)

There will be 2 files generated. On is the named *.idf and it contains the information of the whole polygons. idf-stepper will generate a step file for every single polygon and store it in the root folder. The *.idb file contains the Information how the polygons are oriented to the Board origin. idf-stepper will take all the generated step files, put them in place to one big step assembly. In windows idf-stepper works with drag&drop the *.idf and *.idb files simply onto the executable and you are done!

When you are using your simple rectangular shapes like me in my little example you will then get a generated step file looking something like this. For most Mechanical Engineers this generated step Information is all what they need to place the parts in a mechanical assemly and check collisions and correctness of mounting points.

But idf-stepper also can also deal with advanced very complex step models. Exactly this function gives you the most powerful capability:

By only using the *.idb file you can take every very advanced 3D Model as Input source to the idf stepper. Only take a short look at the naming convention, take your advanced model, give it the right orientation and you can use it immediately by replacing the generated step file of this part generated by idf-stepper. If you deliver the idf-stepper only the *.idb file as Input, the existing step files wont be overwritten.

 In another Project i used more advanced 3D Models for the LEDs, once you have rotated the advanded LED-Models into the right angles, you can use them every time again:

included advanced step files for LEDs

One addiotional highly useful and powerful feature: Since FreeCAD has the Ability to save the step file as *.html (every modern Browser can use WebGL) you can send your 3D Model as html-file to everyone, still if he has no CAD Viewer, he will be able to rotate the model, zoom in/out within the browser. The only thing you might have to adjust by your own with a simple text editor is, to set the camera Position far enough from your board, since if the standard Position is (0.0, 0.0, 1.0), which means the camera is set in the PCB, so by default you do not see any parts. I like to use something like that camera.position.set( 100.0, 100.0, 200.0 );

This last sample i provided here, outgoing from an with idf-stepper generated step-file, opened with FreeCAD and saved as html(webGL) file.