ZofzPCB 3D Gerber Viewer Help
written by: Rafal Powierski, Simon Ndiritu
- Reading Gerber Files
- Netlist and IPC356 file
- Right Panel: Layers & effects
- View Menu - still some more effects
- Connection between Program and Website
- Bug Reports
- CrossCheck page
- Keyboard and Mouse Controls on a single page (PDF)
- Gerber format specification & related documents:Ucamco Download Page
- Gerber file format at Wikipedia: Gerber Format
- Electronics Design Checklist Form: Hank Wallace
1. Reading Gerber Files
ZofzPCB is designed to offer two ways of composing a project: auto and manual.
Auto provides you with a quick and convenient way of composing a new project. The purpose of the Auto Load is to match gerber/drill files to assumed functions in PCB definition. This feature is based on a file name rules set. Welcome to the file name hell. Everyone invents a new schema! In an attempt to moderate this blossom of creativity, some mask rules are applied. If you are wondering how this works, well I will let you know. For each set of rules, matching points are aggregated from all matching files. The rule with the highest number of matching points wins and it is the one that is displayed.
In case you would like to create another set that is related to a particular CAD vendor default convention,
then I am willing to assist you. Get in touch with me.
To access the rules text-file, go to: Windows-Start-Button / Programs / ZofzPCB / CAM_Load_Rules.txt. Alternatively, you can use the following file path: "%APPDATA%\ZofzPCB\CAM_Load_Rules.txt
Hoping you have clearly understood the introductory part, below is a step-by-step procedure of using the auto function.
- After launching the program, go to File. Under Compose New, select Auto. That is, Command: File / Compose New / Auto.
- The following dialog box will appear:
- Select Folder (and mask, if needed).
Summary of matching files is displayed on the right side of the above dialog box. Sometimes you may find that the number of matching files is fewer than expected. In such cases, you are advised to use the manual method.
- Press Auto Load. In case it is your first project after launching the program, your project will be auto loaded. Otherwise, you will be prompted to confirm erasure of the current project data. You should just confirm if you are composing a new project.
- Layer Stackup is displayed. This allows you to review Gerber files assignment to particular layers, drill, and IPC356 netlist slots.
- Press OK: - Read & Render.
The board will be flattened. That is, the negative and positive constructs are converted into simple shapes.
It is then triangulated to enable the Direct3D to display the PCB model.
1.2 Manual Compose
Have you tried the auto compose and you are not satisfied with the results? If that is the case, then you can compose your project by using manual compose. The procedure of composing a project using this approach is as detailed below.
- After launching the program, go to File. Under Compose New, select Manual. That is, Command: File / Compose New / Manual.
In case it is your first project after launching the program, then your project will be loaded. Otherwise, you will be prompted to confirm erasure of the current project data. You should proceed by clicking Yes if you are composing a new project.
Assign file function
- You will get a dialog box that is similar to the one above. The left side of the dialog box is the file explorer interface while the right side has the Layer Stack list, the Drill Plates list, and the Netlist file placeholder.
- Select project files for the layer, drill, and netlist categories. This is done by selecting a file from the file explorer and then pressing a button to move it to a window on the right. Alternatively, you can select multiple files and move them as a group.
- Insert the selected files. A file is added to the Layer Stack list by pressing Insert File To Layer Stack button. The Insert Void To Layer Stack button allows a user to insert Core or Prepreg layers (not associated with any Gerber drawing file). Drill files are added to the Drill Plates List by clicking the Insert File To Drill Plates button. The IPC356 file (if available) should be inserted under IPC356 - Nets - Pads – Components by using the Set File As IPC-356 button.
- Having selected and inserted the files, you can organize your categories or render your project. However, it is highly recommended that you set the properties and organize the categories before rendering. By doing so, you will avoid the need to re-render your project.
Organizing Layer Stack
- You can organize the layer stack while you are still in the Manual Compose Stackup dialogue box or you can go to Display/Edit Stackup. For the latter, you will get a dialogue box that is similar to the one below.
- The stack list represents the order of layers from top (component side) to bottom (solder side). Each entry represents a layer in the PCB layer stack. It is important to note that some layers are associated with Gerber files (e.g. copper), while others are not (e.g. core). The first column defines the type of the layer and specifies it. You can edit the order by moving a selected layer up or down by using up/down buttons.
- The Board Outline field is a special layer and should be positioned at the bottom of the list. It may or may not be related to a Gerber file. It is a placeholder for the PCB total thickness value.
- When all the Gerber layers are identified, it is easy to enter the total thickness of the PCB in the Board Outline's Thickness field. The Set Equal Spacing button adds missing core layers and sets their thickness to the entered value.
- Note: The Gerber file should specify whether the film is positive or negative. To understand the positive and negative films, consider this scenario: if you want to draw a punched surface, you can draw the dots and ask for a negative film. Alternatively, you can paint the entire surface except the dots and ask for a positive film. In other words, if you want a dotted film, you have two options. Similarly, your file should clearly define the film to be used. In case the film is not specified, then the program uses the default options-default positive and default negative.
- After organizing the Layer Stack, you can move to the Drill Plates.
- You can organize the layer stack while you are still in the Manual Compose Stackup dialogue box or you can go to Display/Edit Stackup. For the latter, you will get a dialogue box that is similar to the one below.
Organizing Drill Plates
- The software automatically detects if the provided drill file is in Excellon or Gerber format.
- In some cases, a PCB project will have only one drill file. If that is not the case, you will need to define the functions of the provided drill file(s).
- For a selected drill file, you should define where the drill plates start and end. For example, assuming a 4-layer PCB, from layer1 to layer 4 (top to bottom) or layer 1 to layer 2.
- The program also allows you to specify whether it is metal-plated or not.
- When you are through with organizing your categories, you are ready to proceed to the next step. You are almost through!
- OK: - Read & Render
- The board will be flattened. That is, the negative and positive constructs are converted to simple shapes. It is then triangulated for the Direct3D to display the PCB model.
- In case there is a need to interrupt the process, the following options are available:
- Stop At Next Checkpoint
The process will be stopped when the current task ends. No new actions will be started.
- Stop Now Dangerously
The process is stopped immediately. This action causes the allocated memory to leak. It is not guaranteed that the process will continue from the point it is stopped without restarting the program.
- Stop At Next Checkpoint
1.3 File format and aperture file
You should not change the following options unless the Gerber files are generated by an old or incompatible CAD exporter or are abnormal in any other way.
- Gerber file options
The contemporary format, RS-274-X, defines apertures and all parameters needed to create a layer drawing. Sometimes, only a subset of parameters is defined by the Gerber file. In case the pure D format is used, the operator has to define many parameters and adjust the settings manually. Nevertheless, such cases are rare. Parameters set in the associated dialog are default. If there are explicit definitions in the Gerber file, they normally override the defaults. A default negative parameter is defined per layer in the layer stack list.
- Aperture file
The apertures are normally defined in the Gerber file(s). If that is not the case, you should put the file containing apertures as the first file in the layer stack and set its attribute to "Aperture". It is important to note that the apertures should be in RS-274-X file format.
- Excellon file options
Although we have few parameters here, the standard is generally weak. I hope the "Guess" option will work for you. If it doesn’t, kindly feel free to send me your examples.
The Guess option is based on a statistical approach. Guessing is done by matching and scaling drills to pads. Gerber format offers a better quality output than Excellon making it the preferred format for drill files.
- IPC356 file options
The IPC356 is a clearly defined format. This old format defines functions of each character that it uses. Sometimes it is difficult to enhance precision and range when using this standard because it is a constant column length format. It defines a specific number of digits per value and this may differ with what some projects may require. For that reason, some vendors prefer to change the scale while maintaining the required number of characters in order for the format to handle bigger boards. However, this failure to adhere to the IPC356’s standard may cause scaling problems.
1.4 Board Outline: using the meta drawing
This approach can be used when the board outline is drawn on a copper or silkscreen layer.
However, the approach is suitable only if the outline is drawn using tracks of thickness below a specific threshold value. All other objects on the layer must use a thickness value that is greater than the threshold. The threshold thickness value is set in the dialog box as shown below.
To ensure uniformity of a correction, 2 values are used to define the new slope of the transfer function. By keeping the value of "Minimal" less than that of "Slope Start", the size relation between the affected object sizes is preserved.
1.5 Board Outline: identifying the PCB outline
Sometimes the Gerber files are generated as pure M2M files. In other cases, a descriptive text or drawings is inserted in various layers.
The program can remove any object that is located outside the PCB on any layer. In order to do this, the program must understand the PCB shape. To achieve this, it analyzes the Board Outline layer (or meta drawing on other layer) to determine the M2M part of the picture and removes objects that are outside the bounding rectangle.
You can enlarge the created mask by adjusting the horizontal and vertical margin values.
By clicking the How to Identify button, you will get a dialog box that is similar to the one shown below.
The program offers the following options:
- Accept all detected Loops
All detected outlines define multiple PCBs.
- Auto Recognition
This is based on finding a division line. The horizontal or vertical line divides the drawing into two parts: the PCB and the description text.
- Take the greatest Loop
This assumes that the biggest object is the PCB.
- Take 2,...10 greatest Loops
Assumes that the biggest two to ten objects are the PCB parts. You should select the number of loops that you want the program to take (from 2 to 10).
In all the above cases, the outline is converted into a polygon that represents the surface of the PCB. On the outline drawing, the program interprets the tracks as the edges of the polygon. This means that the drawing must form a loop. To account for small errors, the program uses the drawing track width plus "Brush Blob" value as an error margin.
These are illustration examples of how Outline Drawings are converted to board surfaces. The green part represents the PCB while the black one (removed part) is the drawing.
- The surfaces XOR if the borders do not touch. You can create cutouts.
- If multi-path outline is detected, the greatest surface is assumed.
- Double line means two edges (XOR). If you want to draw a frame, you should open it.
- If text is sneaking in, it will look like strange very small PCB pieces
- Small breaks may be corrected, but bigger ones may simply remove the surface resulting in a no PCB volume at all.
1.6 Automatic fit of image, drills and netlist
It is common to have the Gerber file image centered on the film. The drill file features an arbitrary offset and the same can also apply to the IPC356 file. Owing to this, offset correction is always executed.
If the points required to match are not enough, a warning usually pop ups. This message can be ignored but you should consider the possible causes of this before you proceed.
The image/drill correction is not performed if the drill files are in Gerber format.
1.7 Stackup file save/load
You can save/load the Stackup file either as a .camset file extension or in XML text format. If you click Save, your changes and adjustments to the project will be saved. When the Stackup is loaded, the Gerber, Excellon, and IPC356 files are automatically loaded.
The saved camera positions are also included in this file.
1.8 Rendered board file save/load
The rendering process produces a .zofzproj file extension (binary format file).
Sometimes the flattening process can take longer. In such cases, the program allows saving and loading of flattened and rendered boards to a proprietary binary file. It is important to note that the format of this file may change when more features are added. In such cases, old files may be not loaded or some options may be unavailable.
2. Netlist and IPC356 file
- You should generate and include the IPC356 Bare Board Flying Probe file in your Gerber files set. It is useful in PCB factories and EMSs (if you decide to share it with them). It defines test points and therefore finds uses in the electrical testing of PCBs.
- The file contains exposed PCB-copper-points descriptions. Each line defines one point and contains the following:
- mechanical position
- mechanical size
- component designator name
- component pin/pad name
- netlist node name
- Benefits in ZofzPCB: Benefits of using the IPC356 in this program include the following:
- The program displays components. At the moment, the shapes of the components are not accurate. To get the exact shapes, the program must have access to component names and footprints.
- PCB connectivity is tested and error report generated if the IPC356 does not match with the copper connections.
- The list of objects is provided in the dialog box. To view the list, you should go to Netlist and select Components, Pins, Nets, Nodes PCB, Nodes IPC or Errors. In case the IPC356 and actual copper network have variations due to errors, the Nodes PCB and Nodes IPC can differ. This double listing helps in finding the cause of the problem.
- The program displays the names of the components, pins, and nets. You just need to move the cursor over an object to see its name on the right side panel.
- Cross-Check allows you to browse schematic and PCB simultaneously. For a demo, you can visit the CrossCheck-Page.
The navigation process requires a wheel mouse and a keyboard. In addition, the ZofzPCB program supports 3Dconnexion 3D mouse.
To illustrate how navigation is done using the wheel mouse and keyboard, an airplane has been used to represent different viewpoints. In the following illustrations, the function of every key is given together with a corresponding viewpoint.
|F1||quick keyboard help|
|PgUp-PgDn||CAM forward - backward|
|CAM shift / hover|
Numeric pad / *
Ctrl- / *
|CAM roll, Ctrl=next rectangular|
|A-D, S-W||CAM pan, tilt|
|Right Mouse Button DRAG||CAM pan - tilt|
|Tab||roll to level the floor|
|Space Bar||nearest rectangular|
|Save current camera position|
|1 ... 9, 0||Jump to saved camera position|
|Left Mouse Button CLICK||center this PCB point|
|Left Mouse Button DRAG||rotate around this PCB point|
|Ctrl - Left Mouse Button DRAG||rotate around this PCB point|
4. Right Panel: Layers & effects
Zofzpcb offers fast access options on its right side panel. The following are the available options:
- Mouse wheel functions:
- Zoom (F5): mouse wheel is used for navigation (cam forward-backward)
- Peel (F6): removes layers one by one from the actual PCB top
- Spread (F7): magnifies z-axis of the PCB thereby spreading all layers and drills proportionally.
- Middle Mouse Button: resets layers to base position. NB: this functionality is not available in the right side panel.
- Ctrl-F5,6,7: select the mode and reset immediately. NB: this functionality uses the keyboard.
- Hollow Checkbox: makes excess of copper transparent. This allows unobstructed view.
- Volume Slider: increase core/prepreg volume opacity.
- Volume Slider. The leftmost and rightmost positions of the volume slider have additional functionalities:
- Leftmost - enables one to see and select components that are on the other side of the PCB.
- Rightmost - disables objects such as tracks and drills that are located in the deeper parts of a PCB.
- Components Checkbox: enable or disables component display.
- On-Off layer checkboxes: activates or inactivates the selected layers.
- Double Click on Layer Checkbox – turns on the single layer (Peel) mode for the selected layer layer. Mouse wheel can be used to change the layer.
- Visible copper layer is marked by red color in the On/Off checkbox.
- In addition to the above options, the program offers hover and selected displays. You will get a hover display if you move the cursor over an object. If you make a selection, the window displays the selected and hover is rendered inactive.
Zofzpcb offers some keys as additional mouse buttons. The keys used for this function are C,H, P, E, and N. You can utilize their assigned functions either by using the keyboard or by clicking the right mouse button. It is important to note that the P and N keys can also be used for the Cross-Check function. The program also allows you to redirect all keys to the measurement function by setting Netlist/Crosscheck to Disabled.
5.1 Position Markers
The program offers 2 position markers for distance measurement. Distance is measured by positioning the cursor on a selected object and the clicking a key on the keyboard. The list of keys used for this function is as given below:
- H – Hole
- P – Pad (must be a flash or an IPC356-testpoint)
- E – Edge of the copper or mask
- ESC – reset markers
In case you select 2 markers, the first one will remain at its place while the second one will follow your next selections.
The program allows you to place the first marker again by clicking the object key twice in the same place or by resetting the markers (ESC).
In addition, you can copy the dimensions text to clipboard by pressing Ctrl-C
If you select Net (N), the copper under the cursor and its connections on other layers will be highlighted. You can go to Net (N) either by using the keyboard or by clicking the right mouse button.
The program allows you to adjust the way you view your selection. To make an adjustment, you should go to View and select Net Selection Effect.
The following three options are available: brink color only, uncover selection, and show only selection.
|Blink Color Only||Uncover Selection||Show Only Selection|
5.3 Right-Mouse-Button click menu
Clicking the right mouse button allows you to do the following:
- Go to measurements (and crosscheck) functions without using the keyboard.
- Select mils or millimeters for measurement display.
- Copy the measurement text to clipboard.
- Access Mouse Wheel function switch.
- RMB-click again or ESC to remove this popup.
6.1 Color Presets
The program offers a variety of colors to choose from. You can access color presets by going to View and selecting Color Presets. You will get a menu that unfolds to give you options as shown below:
Besides the predefined options, this program allows you to create and save your own color presets.
Presets are stored under "%appdata%\ZofzPCB\NAME.color. The path is given to enable you to copy, share, or distribute your color presets.
6.2 Color Picker
To access the color picker, you should go to View and select Color Picker.
There are two color tables: one for layer type and the other for individual layer.
The slider at the top allows you to mix colors from both tables in any proportion.
You can modify a table by selecting its table entry in the related drop down box. The color is displayed on the radio buttons. As usual, a color can be selected either by RGB sliders or HSV sliders.
The Net Color is a random color selected for each detected net. The program allows you to modify net color by positioning the cursor over it (on the PCB) and pressing the N-Net key. Furthermore, you can adjust the amount of the Net Color that is mixed with the base color of the Layer Type or the Individual Layer. This option is activated when copper color is adjusted.
7. View Menu - still some more effects
Zofzpcb uses the Direct3D 9c or higher together with a dedicated graphic processor (GPU) and a dedicated memory. Some years ago, such a configuration was dedicated for gaming only. Currently, this hardware is inexpensive and its popularity is growing exponentially. It is being used by operating systems such as Win & Glass to perform graphic effects and it has also found applications in inexpensive laptops. ZofzPCB uses this hardware for PCB rendering. The following are the consequences:
- The PCB image data has to be converted into a suitable format - list of triangles. This process (flattening and triangulation) takes time and it is not 100% stable.
- The GPU draws the complete image from the beginning at a rate of 60 fps. This rate may be reduced to 30 fps (or lower) for more complicated images.
- If the resulting triangle data cannot fit in the graphic memory, the frame rate is decreased. Sometimes this can cause a graphic error.
Therefore, as in many 3D games, the program offers a set of controls that allow you to increase or decrease the amount of details and the required GPU power. Depending on your GPU power and the size of your board, you may need to do adjustments for you to get optimal results.
- Full-Screen - this offers better viewing but has some performance consequences. Memory and bandwidth allocation to the 3D processor is increased. In case the resolution is increased as well, the rendering speed can be affected negatively. The effectiveness of this mode is also determined by the hardware configurations of the computer.
Full screen is optimal because no resources are allocated to 2D processing. In case 2 graphics processors are used, a 2D processor and a 3D one, the configuration may have no effect except power consumption. In addition, non-full-screen modes may have synchronization problems or image tearing problems.
Zofzpcb program allows you to change the resolution and the frame rate in the dedicated graphic mode. It also supports variable refresh rate technology and use of 3D stereoscopic glasses. It is important to note that the amount of rendered pixels greatly influences the speed. A small window is rendered faster than a big one.
- Wireframe – this mode displays surfaces as frames of wires. Apart from helping in debugging, this setting enables the user to easily understand how the program carries out a process.
- SubSampling – increasing the subsampling enhances the image quality but doing so demands more resources.
- Thick layers - thick layers are good-looking if you can afford them. However, it is important to note that increasing the thickness of copper, silkscreen, or soldermask layers can affect the frame rate.
- Camera FOV (Projection)
Camera FOV (Field Of View) enables you to have a clearer view of a section or part of the PCB. This setting works by allowing you to narrow or widen the field of view of the selected section. This features offers the following:
- 3 presets 90°, 45°, 22.5°.
- Variable: a popup containing a scroll-bar shows up.
An Additional effect, Compensate / Dolly Zoom, moves the camera forward and backward thereby allowing compensation of the object’s size change.
The orthogonal mode is based on a simple projection and does not feature a perspective effect.
If you keep camera direction perpendicular to the PCB, by using Home or space-bar buttons, there will be a specific size scale relating the PCB and the viewed image. This scale is saved in the screenshot image to ensure that a 1:1 scale is maintained when the image is printed.
- Net selection effects (see: Net-Marker)
- Color Presets (see: Color Presets)
- Color Picker (see: Color Picker)
- Render Effects - follows:
These are a set of parameters that alter the visual features. They are used during the triangulation phase. It is important to note that the new values will have effect after the next flattening and triangulation.
- Rendering Hollows:
This refers to the distance between the edge of a plane and total transparency.
The copper island may not be hollowed if it has an area that is smaller than a specified size.
In addition, the island must have a simple shape. In case of complicated islands, more surface area is required to trigger the hollowing effect.
- Preventing big triangles:
Big triangles can interfere with some visual features. This effect is caused by the calculations performed "per vertex".
An increase in the size of a triangle leads to an increase in the number of triangulation points.
To prevent this, you should use numbers such as 1,2,4,8,16.. or 0.5, 0.25, 0.125.
- Rendering Arcs to Polygons:
After the flattening process, arcs are converted into straight-line polygons. How exact would you like to have it?
To ensure accuracy, netlist and hit tests are performed on data stored before the flattening process.
- Drill through copper
Should drills make holes in copper? Yes. But sometimes it is useful to simplify and skip this subtraction.
It is also important to note that the parameters involved here affect triangulation as well as flattening.
- Rendering Hollows:
- This feature saves the current view in PNG format - lossless image compression format.
- The user interface elements are removed from the picture.
- Its Resolution Multiplier allows the user to upscale the view up to 10 times.
- The program allows you to save the image in the project folder or in a constant directory. Unique filenames are always generated.
- To print in a 1:1 scale, physical dimensions (DPI) are set in the picture file when the camera orthogonal mode is used. (Ref 7.5)
For good results, please use printing programs with honors DPI settings such as standard paint.
The autopilot offers automatically generated airplane - like camera movements. It is based on the PCB drills and offers the following:
- Speed scroll-bar.
Besides short moments of slowdown when flying through the drills, the camera keeps a constant linear speed that is set using the scrollbar.
- Roll scroll-bar.
It sets the camera roll, thereby defining the bottom of the screen. The program offers two options:
- Centrifugal- down direction is perpendicular to the turn axis.
- Gravity- down direction is perpendicular to the PCB plane.
- PCB is down.
When checked, the direction of gravity is towards the PCB. Otherwise, the direction is always from top to bottom.
- Viaska City.
Enables peeling of all sections except the actual bottom layer of your PCB.
- ➧➧ button
Starts or stops the action.
Enjoy a flight over your PCB with the autopilot!
10. Connection between Program and Website
This is located under menu: F1-Help
On demand starting your Default Browser, directing it to:
- "on-line help" page www.zofzPCB.com/help.htm (this file)
Check for upgradeKindly note that your information is not sent to the website. Only a request is sent to get the https://www.zofzpcb.com/version/info.txt file.
This is the remote file that contains the current version number.
Send a Bug ReportThis command starts an external program that allows you to send your message and log file. The log file is located at %APPDATA%\ZofzPCB\ZofzDebugLogFile.txt.
You can revise the log file before sending. In case you expect a feedback from me, then you should provide your email address.
There is no other information that is sent apart from what you can clearly see in the CrashReport.exe dialog-window.
Automatic version checkOn program start, the 3D Gerber Viewer automatically requests to check for the latest version. However, this does not happen on each program start. This request is to be confirmed by you. You have three options:
- allow it
- allow it for ever
- disallow it this time
11. Bug Reports
Do not hesitate to send me a bug report. To debug the program I need to reproduce the bug at my debugging workbench.
In case the bug is related to the input data, I can request you to provide me with some input data.
I understand the delicacy of the subject - I am designing PCBs myself.
So, if you have time, reduce the Gerbers to the affected region and layers or simply trust me.
Use email@example.com for direct contact.
List of known bugs, version log: bug list