:author: The KiCad Team
:doctype: article
:toc:
:ascii-ids:

= GerbView

_Reference manual_

[[copyright]]
*Copyright*

This document is Copyright (C) 2010-2015 by it's contributors as listed
below. You may distribute it and/or modify it under the terms of either
the GNU General Public License (http://www.gnu.org/licenses/gpl.html),
version 3 or later, or the Creative Commons Attribution License
(http://creativecommons.org/licenses/by/3.0/), version 3.0 or later.

All trademarks within this guide belong to their legitimate owners.

[[contributors]]
*Contributors*

The KiCad Team.

[[feedback]]
*Feedback*

Please direct any bug reports, suggestions or new versions to here:

- About KiCad document: https://github.com/KiCad/kicad-doc/issues

- About KiCad software: https://bugs.launchpad.net/kicad

- About KiCad software i18n: https://github.com/KiCad/kicad-i18n/issues


[[publication_date_and_software_version]]
*Publication date and software version*

Published on February 14, 2015.

//Since docbook "article" is more compact, I have to separate this page
<<<<

== Introduction to GerbView

GerbView is a Gerber file viewer (RS 274 X format), and is also able
to display drill files from Pcbnew (in Excellon format).

It accepts up to 32 files (Gerber and/or Drill files)

Files can be displayed using a transparency mode or stacked mode.

For more information about the Gerber file format please have a read
at the specification in
http://www.ucamco.com/files/downloads/file/81/the_gerber_file_format_specification.pdf[The Gerber File Format Specification - Ucamco].

== Main Screen

image::images/gerbview_main_screen.png[scaledwidth="95%",alt="gerbview_main_screen_png"]

<<<<<

== Top toolbar

image::images/gerbview_top_toolbar.png[scaledwidth="95%",alt="gerbview_top_toolbar_png"]

[width="100%",cols="41%,59%",]
|=======================================================================
|image:images/icons/gerbview_clear_layers.png[gerbview_clear_layers_png]
|Clear all layers

|image:images/icons/gerber_file.png[gerber_file_png]
|Load Gerber files

|image:images/icons/gerbview_drill_file.png[gerbview_drill_file_png]
|Load drill files (Excellon format from Pcbnew)

|image:images/icons/sheetset.png[sheetset_png]
|Set page size for printing and show/hide page limits

|image:images/icons/print_button.png[print_button_png]
|Open print dialog

|image:images/icons/zoom_in.png[zoom_in_png] image:images/icons/zoom_out.png[zoom_out_png]
|Zoom in and out

|image:images/icons/zoom_redraw.png[zoom_redraw_png]
|Refresh screen

|image:images/icons/zoom_fit_in_page.png[zoom_fit_in_page_png]
|Zoom fit in page

|image:images/gerbview_top_layer.png[width="70%",alt="gerbview_top_layer_png"]
|Layer selection

|image:images/gerbview_top_dcode.png[width="70%",alt="gerbview_top_dcode_png"]
|D Code selection (hight light items that use this dcode)

|image:images/gerbview_top_info.png[width="70%",alt="gerbview_top_info_png"]
|Info about Gerber file options loaded in the current layer
|=======================================================================

<<<<<

== Left toolbar

[width="100%",cols="10%,5%,85%",]
|=======================================================================
.10+^.^|image:images/gerbview_left_toolbar.png[gerbview_left_toolbar_png]
|image:images/icons/grid.png[grid_png]
|Grid on / off

|image:images/icons/polar_coord.png[polar_coord_png]
|Display polar coordinates on / off

|image:images/icons/unit_inch.png[unit_inch_png] image:images/icons/unit_mm.png[unit_mm_png]
|Units selection to display coordinates

|image:images/icons/cursor_shape.png[cursor_shape_png]
|On grid cursor shape selection

|image:images/icons/pad_sketch.png[pad_sketch_png]
|Display mode selection (solid or outlines) for flashed items

|image:images/icons/track_sketch.png[track_sketch_png]
|Display mode selection (solid or outlines) for lines

|image:images/icons/opt_show_polygon.png[opt_show_polygon_png]
|Display mode selection (solid or outlines) for polygons

|image:images/icons/gerbview_show_negative_objects.png[gerbview_show_negative_objects_png]
|Show negative objects in ghost color

|image:images/icons/show_dcodenumber.png[show_dcodenumber_png]
|Show / hide D Codes values (for items using a dcode)

|image:images/icons/gbr_select_mode0.png[gbr_select_mode0_png]
 image:images/icons/gbr_select_mode1.png[gbr_select_mode1_png]
 image:images/icons/gbr_select_mode2.png[gbr_select_mode2_png]
|Mode used by Gerbview to show layers.

|image:images/icons/layers_manager.png[layers_manager_png]
|Show / hide the layer manager

|=======================================================================

<<<<<

== Commands in menu bar

=== File menu

image::images/gerbview_file_menu.png[scaledwidth="45%",alt="gerbview_file_menu_png"]

It is possible to load gerber and drill files into Gerbview. There is
also an auxiliary option to export gerbers to pcbnew. Previously (a long
time ago) it was also possible to load so called Dcodes, but those are
now obsolete and is therefore not possible anymore.

==== Export to Pcbnew

GerbView has a limited capability to export Gerber files to Pcbnew.

The final result depends on what features of RS 274 X format are used in
Gerber Files.

RS 274 X format has raster oriented features that cannot be converted
(mainly all features relative to negative objects).

Flashed items are converted to vias.

Lines items are converted to track segments (or graphic lines for non
copper layers)

So the usability of the converted file is very dependent upon the way
each Gerber file was built by the original Pcb tool.

=== Preferences menu

image::images/gerbview_preferences_menu.png[scaledwidth="33%",alt="gerbview_preferences_menu_png"]

Gives access to the hot keys editor, and some options to display items.

=== Miscellaneous menu

image::images/gerbview_misc_menu.png[scaledwidth="25%",alt="gerbview_misc_menu_png"]

* List Dcodes shows the Dcodes in use and some of Dcode parameters.
* Show Source displays the Gerber file contents of the active layer in a
  text editor.
* Clear Layer erases the contents of the active layer.

<<<<<

== Layer Manager

The layer manager has 2 purposes:

* Select the active layer
* Show/hide layers

image::images/gerbview_layer_manager.png[scaledwidth="40%",alt="gerbview_layer_manager_png"]

The active layer is drawn after the other layers.

When loading a new file, the active layer is used (the new data replace
the previous data)

Note:

* Mouse left click on a line: select the active layer
* Mouse right click on the layer manager: show/hide all layers
* Mouse middle click on a icon: select the layer color.

<<<<<

=== Modes to show Gerber layers


* Raw mode image:images/icons/gbr_select_mode0.png[gbr_select_mode0_png]

Each gerber file and each item in files are drawn in the order files are
loaded.

However the *active layer* is draw last.

When Gerber files have negative items (drawn in black) artefacts are
visible on already drawn layers

image::images/gerbview_mode_raw_stack.png[scaledwidth="60%",alt="gerbview_mode_raw_stack_png"]


* Stacked mode image:images/icons/gbr_select_mode1.png[gbr_select_mode1_png]

Each gerber file is drawn in the order files are loaded.

The *active layer* is draw last.

When Gerber files have negative items (drawn in black) there are no
artefacts on already drawn layers, because this mode draws each file in
a local buffer before it is shown on screen. Negative items do not create
artefacts.

image::images/gerbview_mode_raw_stack.png[scaledwidth="60%",alt="gerbview_mode_raw_stack_png"]


* Transparency mode image:images/icons/gbr_select_mode2.png[gbr_select_mode2_png]

image::images/gerbview_mode_transparency.png[scaledwidth="60%",alt="gerbview_mode_transparency_png"]


=== Effect of layer selection for drawings

This effect is visible only in raw or stacked mode.

The layer 1 (green layer) is drawn after the layer 2

image::images/gerbview_layer_select_1.png[scaledwidth="60%",alt="gerbview_layer_select_1_png"]

The layer 2 (blue layer) is drawn after the layer 1

image::images/gerbview_layer_select_2.png[scaledwidth="60%",alt="gerbview_layer_select_2_png"]


<<<<<

== Print layers

=== Print dialog access

To print layers, use the
image:images/icons/print_button.png[print_button_png]
tool, or the main menu (files)

[CAUTION]
========================================
But be sure items are inside the printable area (select by
image:images/icons/sheetset.png[sheetset_png]
a suitable page format).

Do not forget photoplotters can use a large plottable area, much bigger than the page
sizes used by printers)

Moving (by block move command) the entire layers is often needed.

========================================

=== Move block command

You can move items by selecting them (drag the mouse with left button down) and then
moving the selected area on screen.

Click the left button to finally place the area you are moving.

