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

= GerbView

_Reference manual_

[[copyright]]
*Copyright*

This document is Copyright (C) 2010-2018 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 (https://www.gnu.org/licenses/gpl.html),
version 3 or later, or the Creative Commons Attribution License
(https://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 24, 2018.

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

== Introduction to GerbView

GerbView is a Gerber file (RS-274X format) and Excellon drill file
viewer. Up to 32 files can be displayed at once.

For more information about the Gerber file format please read
http://www.ucamco.com/files/downloads/file/81/the_gerber_file_format_specification.pdf[the Gerber File Format Specification].
Details about drill file format can be found at
http://web.archive.org/web/20071030075236/http://www.excellon.com/manuals/program.htm[the Excellon format description].

== Interface

=== Main window

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/delete_gerber.png[delete_gerber_png]
|Clear all layers

|image:images/icons/load_gerber.png[load_gerber_png]
|Load Gerber files

|image:images/icons/gerbview_drill_file.png[gerbview_drill_file_png]
|Load Excellon drill files

|image:images/icons/sheetset.png[sheetset_png]
|Set page size

|image:images/icons/print_button.png[print_button_png]
|Print

|image:images/icons/zoom_redraw.png[zoom_redraw_png]
|Redraw view

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

|image:images/icons/zoom_fit_in_page.png[zoom_fit_in_page_png]
|Zoom auto (zoom fit)

|image:images/icons/zoom_area.png[zoom_area_png]
|Zoom to selection

|image:images/gerbview_top_layer.png[scaledwidth="70%",alt="gerbview_top_layer_png"]
|Select active layer

|image:images/gerbview_top_info.png[scaledwidth="70%",alt="gerbview_top_info_png"]
|Display info about active layer

|image:images/gerbview_x2_component.png[scaledwidth="70%",alt="gerbview_x2_component_png"]
|Highlight items belonging to selected component (Gerber X2)

|image:images/gerbview_x2_net.png[scaledwidth="70%",alt="gerbview_x2_net_png"]
|Highlight items belonging to selected net (Gerber X2)

|image:images/gerbview_x2_attribute.png[scaledwidth="70%",alt="gerbview_x2_attributeo_png"]
|Highlight items with the selected attribute (Gerber X2)

|image:images/gerbview_top_dcode.png[scaledwidth="60%",alt="gerbview_top_dcode_png"]
|Highlight items of selected D Code on the active layer
|=======================================================================

<<<<<

=== Left toolbar

[width="100%",cols="10%,5%,85%",]
|=======================================================================
.14+^.^|image:images/gerbview_left_toolbar.png[gerbview_left_toolbar_png]
|image:images/icons/cursor.png[cursor_png]
|Select items

|image:images/icons/measurement.png[measurement_png]
|Measure between two points

|image:images/icons/grid.png[grid_png]
|Toggle grid visibility

|image:images/icons/polar_coord.png[polar_coord_png]
|Toggle polar coordinates display

|image:images/icons/unit_inch.png[unit_inch_png] image:images/icons/unit_mm.png[unit_mm_png]
|Select inch or millimeter units

|image:images/icons/cursor_shape.png[cursor_shape_png]
|Toggle full-screen cursor

|image:images/icons/pad_sketch.png[pad_sketch_png]
|Display flashed items in sketch (outline) mode

|image:images/icons/track_sketch.png[track_sketch_png]
|Display lines in sketch (outline) mode

|image:images/icons/opt_show_polygon.png[opt_show_polygon_png]
|Display polygons in sketch (outline) mode

|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

|image:images/icons/gbr_select_mode2.png[gbr_select_mode2_png]
|Display layers in diff(compare) mode

|image:images/icons/contrast_mode.png[contrast_mode_png]
|Display current layer in high-contrast mode

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

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

<<<<<

=== Layers Manager

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

The Layers Manager controls and displays visibility of all layers. An arrow
indicates the active layer, and each layer can be shown or hidden with
the checkboxes.

Mouse button assignments:

* Left click: select the active layer
* Right click: show/hide/sort layers options
* Middle click or double click (on color swatch): select the layer color

The Layers tab allows you to control the visibility and color of all loaded
Gerber and drill layers.  The Items tab allows you to control the color and
display of the grid, D Codes, and negative objects.

== Commands in menu bar

=== File menu

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

* *Export to Pcbnew* is a limited capability to export Gerber files into
  Pcbnew. The final result depends on what features of the RS-274X format
  are used in the original Gerber files: rasterized items cannot be converted
  (typically negative objects), flashed items are converted to vias, lines are
  converted to track segments (or graphic lines for non-copper layers).

=== Preferences menu

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

==== Toolsets

GerbView now supports the modern graphics toolset that is available in PcbNew.
Enabling the modern toolset brings new features and better performance.  You can
select which toolset to use in the preferences menu.  Using the Modern (Accelerated)
toolset is recommended if your graphics card supports it (requires OpenGL 2.0).
If your graphics card does not support the Accelerated toolset, you can still use
the new features by selecting the Modern (Fallback) toolset.

Using the Legacy toolset is only recommended if you notice that the Modern
toolset does not support a feature you need or if it does not render a Gerber
file correctly.  If you notice such a problem, please notify the KiCad developers
so that it can be fixed in a future release.

The Legacy toolset will be removed in a future version of GerbView.

=== Miscellaneous menu

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

* *List DCodes* shows the D Code information for all layers.
* *Show Source* displays the Gerber file contents of the active layer in a
  text editor.
* *Clear Current Layer* erases the contents of the active layer.
* *Set Text Editor...* allows you to choose which program to show source with.

== Display modes

GerbView has three display modes which are useful for different
situations or requirements.

NOTE: Stacked mode and Transparency mode provide a better graphical
experience, but may be slower then Raw mode on some computers.

=== Raw mode

This mode is selected by
image:images/icons/gbr_select_mode0.png[gbr_select_mode0_png].
Each file and each item in the file are drawn in the order files are
loaded. However, the active layer is drawn last.

When Gerber files have negative items (drawn in black), artifacts may be
visible on already-drawn layers.

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

=== Stacked mode

Invoked by image:images/icons/gbr_select_mode1.png[gbr_select_mode1_png],
each file is drawn in the order files are loaded. Again, the active
layer is drawn last.

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

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

=== Transparency mode

Use image:images/icons/gbr_select_mode2.png[gbr_select_mode2_png] to display in this
mode, where no artifacts are present and layers are blended together with the active
layer on top.

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

=== Layer occlusion

In raw or stacked mode, the active layer will be on top of other layers
and hide items below it.

Here, layer 1 (green) is the active layer (note the triangle next to it)
and so it is drawn on top of layer 2 (blue):

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

Making layer 2 (blue) the active layer brings it to the top:

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

== Moving items

When using the legacy toolset, items may be selected by holding down the left
mouse button and drawing a rectangle. Releasing the button picks up the items.
A click of the left mouse button places the items.

This behavior is deprecated and not available in the modern toolsets.

== Printing

To print layers, use the
image:images/icons/print_button.png[print_button_png]
icon or the *File -> Print* menu.

[CAUTION]
========================================
Be sure items are inside the printable area. Use
image:images/icons/sheetset.png[sheetset_png] to select a
suitable page format.

Note that many photoplotters support a large plottable area, much
bigger than the page sizes used by most printers. Moving the entire
layer set may be required.

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