PCB File Format

This page is a work in progress and is out of date with changes made for KiCad 6.0 but will eventually be updated to reflect the latest changes.
This file format was introduced with the launch of KiCad 4.0.

Syntax

  • Syntax is based on the Specctra DSN file format.

  • Token definitions are delimited by opening ( and closing ) parenthesis.

  • All tokens are lowercase.

  • Tokens cannot contain any white space characters or special characters other than the underscore '_' character.

  • All strings are quoted using the double quote character (") and are UTF-8 encoded.

  • Tokens can have zero or more attributes.

  • Human readability is a design goal.

Prior to version 6 of KiCad, strings were only quoted when necessary. Saving an older board file to the latest file format will result in these strings being quoted even though there is no functional change in the board itself.

Conventions

In order to use this document properly, there are a few notation conventions that must be understood.

  • Token attributes are upper case descriptive names. For example (at X Y), X is the horizontal coordinate and Y is the vertical coordinate.

  • Some tokens have a limited number of possible attribute values which are separated by a logical or character '|'. For example (visible yes|no) the only valid attributes for the visible token are yes or no.

  • Some tokens have optional attributes which are enclosed in square braces. For example (paper A0 [portrait]) the page portrait setting is optional.

Coordinates and Sizes

  • All values are given in millimeters.

  • Exponential floating point values are not used for readability purposes.

  • The minimum internal unit is nanometers so there is maximum resolution of six decimal places or 0.000001 mm. Any precision beyond six places will be truncated.

  • All coordinates are relative to the origin of their containing object.

Layers

All drawable board items exist on a layer which is defined in the drawable item definition. All layers can be renamed by the user.

Internally, all layer names are canonical. User defined layer names are only used for display and output purposes.
  (layer
    LAYER_DEFINITION                                            (1)
  )
1 Layer definitions can be specified as a list of one or more canonical layer names or with a '*' wildcard to represent all layers that match the rest of the wildcard. For instance, *.Cu represents all of the copper layers. This only applies to canonical layers names.

Capacity

  • 60 total layers.

  • 32 copper layers.

  • 8 paired technical layers for silk screen, solder mask, solder paste, and adhesive.

  • 4 user pre-defined layers for drawings, engineering change order (ECO), and comments.

  • 1 layer to define the board outline.

  • 1 layer to define the board margins.

  • 9 optional user definable layers.

Canonical Layer Names

The table below list all of the canonical layer names.

Canonical Name Description

F.Cu

Front copper layer

In1.Cu

Inner copper layer 1

In2.Cu

Inner copper layer 2

In3.Cu

Inner copper layer 3

In4.Cu

Inner copper layer 4

In5.Cu

Inner copper layer 5

In6.Cu

Inner copper layer 6

In7.Cu

Inner copper layer 7

In8.Cu

Inner copper layer 8

In9.Cu

Inner copper layer 9

In10.Cu

Inner copper layer 10

In11.Cu

Inner copper layer 11

In12.Cu

Inner copper layer 12

In13.Cu

Inner copper layer 13

In14.Cu

Inner copper layer 14

In15.Cu

Inner copper layer 15

In16.Cu

Inner copper layer 16

In17.Cu

Inner copper layer 17

In18.Cu

Inner copper layer 18

In19.Cu

Inner copper layer 19

In20.Cu

Inner copper layer 20

In21.Cu

Inner copper layer 21

In22.Cu

Inner copper layer 22

In23.Cu

Inner copper layer 23

In24.Cu

Inner copper layer 24

In25.Cu

Inner copper layer 25

In26.Cu

Inner copper layer 26

In27.Cu

Inner copper layer 27

In28.Cu

Inner copper layer 28

In29.Cu

Inner copper layer 29

In30.Cu

Inner copper layer 30

B.Cu

Back copper layer

B.Adhesive

Back adhesive layer

F.Adhesive

Front adhesive layer

B.Paste

Back solder paste layer

F.Paste

Front solder paste layer

B.Silkscreen

Back silk screen layer

F.Silkscreen

Front silk screen layer

B.Mask

Back solder mask layer

F.Mask

Front solder mask layer

User.Drawings

User drawing layer

User.Comments

User comment layer

User.Eco1

User engineering change order layer 1

User.Eco2

User engineering change order layer 2

Edge.Cu

Board outline layer

F.Courtyard

Footprint front courtyard layer

B.Courtyard

Footprint back courtyard layer

F.Fab

Footprint front fabrication layer

B.Fab

Footprint back fabrication layer

User.1

User definable layer 1

User.2

User definable layer 2

User.3

User definable layer 3

User.4

User definable layer 4

User.5

User definable layer 5

User.6

User definable layer 6

User.7

User definable layer 7

User.8

User definable layer 8

User.9

User definable layer 9

Text Effects

All text objects can have an optional effects section that defines how the text is displayed.

  (effects
    (font                                                       (1)
      (size HEIGHT WIDTH)                                       (2)
      [(thickness THICKNESS)]                                   (3)
      [bold]                                                    (4)
      [italic]                                                  (5)
    )
    [(justify [left | right] [top | bottom] [mirror])]          (6)
    [hide]                                                      (7)
  )
1 The font token attributes define how the text is shown.
2 The size token attributes define the font height and width.
3 The thickness token attribute defines the line thickness of the font.
4 The bold token specifies if the font should be bold.
5 The italic token specifies if the font should be italicized.
6 The optional justify token attributesdefine if the text is justified horizontally right or left and/or vertically top or bottom and/or mirrored. If the justification is not defined, then the text is center justified both horizontally and vertically and not mirrored.
7 The optional hide token defines if the text is hidden.

Layout

A board file includes the following sections:

The section order is not critical other than the header must be the first token. Some sections can may omitted.

Header Section

The kicad_pcb token indicates that it is KiCad board file. This section is required.

(kicad_pcb
  (version VERSION)                                             (1)
  (generator GENERATOR)                                         (2)

  ;; contents of board file...                                  (3)
)
1 The version token attribute defines the board version using the YYYYMMDD date format.
2 The generator token attribute defines the program used to write the file.
3 The remaining sections of the board definition goes here.
Third party scripts should not use pcbnew as the generator identifier. Please use some other identifier so that bugs introduced by third party generators are not confused with the board file created by KiCad.

General Section

The general token define general information about the board. This section is required.

Most of the redundant information in the general section prior to version 6 has been removed. The removed information does not affect the board output.
  (general
    (thickness THICKNESS)                                       (1)
  )
1 The thickness token attribute defines the overall board thickness.

Page Section

The paper token defines the board page size and orientation. This section is required.

  (paper
    PAPER_SIZE | WIDTH HEIGHT                                   (1)
    [portrait]                                                  (2)
  )
1 Valid pages sizes are A0, A1, A2, A3, A4, A5, A, B, C, D, and E or the WIDTH and HEIGHT attributes are used for custom user defined page sizes.
2 The portrait token defines if the page is shown in the portrait mode. If not defined, the landscape page layout mode is used.

Layers Section

The layers token defines all of the layers used by the board. This section is required.

  (layers
    (
      ORDINAL                                                   (1)
      "CANONICAL_NAME"                                          (2)
      TYPE                                                      (3)
      ["USER_NAME"]                                             (4)
    )

    ;; remaining layers...
  )
1 The layer ORDINAL is an integer used to associate the layer stack ordering. This is mostly to ensure correct mapping when the number of layers is increased in the future.
2 The CANONICAL_NAME is the layer name defined for internal board use.
3 The layer TYPE defines the type of layer and can be defined as jumper, mixed, power, signal, or user.
4 The optional USER_NAME attribute defines the custom user name.

Setup Section

The setup token is used to store the current settings such as default item sizes and other options used by the board. This section is required.

  (setup
    [(STACK_UP_SETTINGS)]                                       (1)
    (pad_to_mask_clearance CLEARANCE)                           (2)
    [(solder_mask_min_width MINIMUM_WIDTH)]                     (3)
    [(pad_to_paste_clearance CLEARANCE)]                        (4)
    [(pad_to_paste_clearance_ratio RATIO)]                      (5)
    [(aux_axis_origin X Y)]                                     (6)
    [(grid_origin X Y)]                                         (7)
    (PLOT_SETTINGS))                                            (8)
  )
1 The optional board stack up settings define the parameters required to manufacture the board.
2 The pad_to_mask_clearance token defines the clearance between footprint pads and the solder mask.
3 The optional solder_mask_min_width defines the minimum solder mask width. If not defined, the minimum width is zero.
4 The optional pad_to_paste_clearance defines the clearance between footprint pads and the solder paste layer. If not defined, the clearance is zero.
5 The optional pad_to_paste_clearance_ratio is the percentage (from 0 to 100) of the footprint pad to make the solder paste. If not defined, the ratio is 100% (the same size as the pad).
6 The optional aux_axis_origin defines the auxiliary origin if it is set to anything other than (0,0).
7 The optional grid_origin defines the grid original if it is set to anything other than (0,0).
8 The plot settings define how the board was last plotted.

Stack Up Settings

The optional stackup toke defines the board stack up settings and is defined in the setup section.

    (stackup
      (LAYER_STACK_UP_DEFINITIONS)                              (1)
      [(copper_finish "FINISH")]                                (2)
      [(dielectric_constraints yes | no)]                       (3)
      [(edge_connector yes | bevelled)]                         (4)
      [(castellated_pads yes)]                                  (5)
      [(edge_plating yes)]                                      (6)
    )
1 The layer stack up definitions is a list of layer settings for each layer required to manufacture a board including the dielectric material between the actual layers defined in the board editor.
2 The optional copper_finish token is a string that defines the copper finish used to manufacture the board.
3 The optional dielectric_contraints token define if the board should meet all dielectric requirements.
4 The optional edge_connector token defines if the board has an edge connector and if the edge connector is bevelled.
5 The optional castellated_pads token defines if the board edges contain castellated pads.
6 The optional edge_plating token defines if the board edges should be plated.

Stack Up Layer Settings

The layer token defines the stack up setting of a single layer in the board stack up settings.

       (layer
         "NAME" | dielectric                                    (1)
         NUMBER                                                 (2)
         (type "DESCRIPTION")                                   (3)
         [(color "COLOR")]                                      (4)
         [(thickness THICKNESS)]                                (5)
         [(material "MATERIAL")]                                (6)
         [(epsilon_r DIELECTRIC_RESISTANCE)]                    (7)
         [(loss_tangent LOSS_TANGENT)]                          (8)
       )
1 The layer name attribute is either one of the canonical copper or technical layer names listed in the table above or dielectric ID if it is dielectric layer.
2 The layer number attribute defines the stack order of the layer.
3 The layer type token defines a string that describes the layer.
4 The optional layer color token defines a string that describes the layer color. This is only used on solder mask and silkscreen layers.
5 The optional layer thickness token defines the thickness of the layer where appropriate.
6 The optional layer material token defines a string that describes the layer material where appropriate.
7 The optional layer epsilon_r token defines the dielectric constant of the layer material.
8 The optional layer loss_tangent token defines the dielectric loss tangent of the layer

Plot Settings

The pcbplotparams toke defines the plotting and printing settings used for the last plot and is defined in the set up section.

    (pcbplotparams
      (layerselection HEXADECIMAL_BIT_SET)                      (1)
      (disableapertmacros true | false)                         (2)
      (usegerberextensions true | false)                        (3)
      (usegerberattributes true | false)                        (4)
      (usegerberadvancedattributes true | false)                (5)
      (creategerberjobfile true | false)                        (6)
      (svguseinch true | false)                                 (7)
      (svgprecision PRECISION)                                  (8)
      (excludeedgelayer true | false)                           (9)
      (plotframeref true | false)                               (10)
      (viasonmask true | false)                                 (11)
      (mode MODE)                                               (12)
      (useauxorigin true | false)                               (13)
      (hpglpennumber NUMBER)                                    (14)
      (hpglpenspeed SPEED)                                      (15)
      (hpglpendiameter DIAMETER)                                (16)
      (dxfpolygonmode true | false)                             (17)
      (dxfimperialunits true | false)                           (18)
      (dxfusepcbnewfont true | false)                           (19)
      (psnegative true | false)                                 (20)
      (psa4output true | false)                                 (21)
      (plotreference true | false)                              (22)
      (plotvalue true | false)                                  (23)
      (plotinvisibletext true | false)                          (24)
      (sketchpadsonfab true | false)                            (25)
      (subtractmaskfromsilk true | false)                       (26)
      (outputformat FORMAT)                                     (27)
      (mirror true | false)                                     (28)
      (drillshape SHAPE)                                        (29)
      (scaleselection 1)                                        (30)
      (outputdirectory "PATH")                                  (31)
    )
1 The layerselection token defines a hexadecimal bit set of the layers to plot.
2 The disableapertmacros token defines if aperture macros are to be used in gerber plots.
3 The usegerberextensions token defines if the Protel layer file name extensions are to be used in gerber plots.
4 The usegerberattributes token defines if the X2 extensions are used in gerber plots.
5 The usegerberadvancedattributes token defines if the netlist information should be included in gerber plots.
6 The creategerberjobfile token defines if a job file should be created when plotting gerber files.
7 The svguseinch token defines if inch units should be use when plotting SVG files.
8 The svgprecision token defines the units precision used when plotting SVG files.
9 The excludeedgelayer token defines if the board edge layer is plotted on all layers.
10 The plotframeref token defines if the border and title block should be plotted.
11 The viasonmask token defines if the vias are to be tented.
12 The mode token defines the plot mode. An attribute of 1 plots in the normal mode and an attribute of 2 plots in the outline (sketch) mode.
13 The useauxorigin token determines if all coordinates are offset by the defined user origin.
14 The hpglpennumber token defines the integer pen number used for HPGL plots.
15 The hpglpenspeed token defines the integer pen speed used for HPGL plots.
16 The hpglpendiameter token defines the floating point pen size for HPGL plots.
17 The dxfpolygonmode token defines if the polygon mode should be used for DXF plots.
18 The dxfimperialunits token defines if imperial units should be used for DXF plots.
19 The dxfusepcbnewfont token defines if the Pcbnew font (vector font) or the default font should be used for DXF plots.
20 The psnegative token defines if the output should be the negative for PostScript plots.
21 The psa4output token defines if the A4 page size should be used for PostScript plots.
22 The plotreference token defines if hidden reference field text should be plotted.
23 The plotvalue token defines if hidden value field text should be plotted.
24 The plotinvisibletext token defines if hidden text other than the reference and value fields should be plotted.
25 The sketchpadsonfab token defines if pads should be plotted in the outline (sketch) mode.
26 The subtractmaskfromsilk toke defines if the solder mask layers should be subtracted from the silk screen layers for gerber plots.
27 The outputformat token defines the last plot type.
  • 0 - gerber

  • 1 - PostScript

  • 2 - SVG

  • 3 - DXF

  • 4 - HPGL

  • 5 - PDF

28 The mirror token defines if the plot should be mirrored.
29 The drillshape token defines the type of drill marks used for drill files.
30 The scaleselection token defines DOCUMENT ME.
31 The outputdirectory token defines the path relative to the current project path where the plot files will be saved.

Property Section

The property token defines a property for the board. If no properties are defined, this section will not exist.

  (property
    "KEY"                                                       (1)
    "VALUE"                                                     (2)
  )
1 The property key attribute is a string that defines the name of the property. Property keys are unique.
2 The property value attribut is a string associated with the key attribute.

Nets Section

The net token defines a net for the board. This section is required.

  (net
    ORDINAL                                                     (1)
    "NET_NAME"                                                  (2)
  )
1 The oridinal attribute is an integer that defines the net order.
2 The net name is a string that defines the name of the net.
The net class section has been moved out of the board file into the design rules file.

Footprint Section

The footprint token defines a footprint on the board. This section will not exist if there are no footprints on the board.

Prior to version 6, the footprint token was referred to as module.
  (footprint
    "LIBRARY_LINK"                                              (1)
    [locked]                                                    (2)
    [placed]                                                    (3)
    (layer LAYER_DEFINITIONS)                                   (4)
    (tedit TIME_STAMP)                                          (5)
    (tstamp UUID)                                               (6)
    (at X Y [ORIENTATION])                                      (7)
    [(descr "DESCRIPTION")]                                     (8)
    [(tags "NAME")]                                             (9)
    [(property "KEY" "VALUE") ...]                              (10)
    (path "PATH")                                               (11)
    [(autoplace_cost90 COST)]                                   (12)
    [(autoplace_cost180 COST)]                                  (13)
    [(solder_mask_margin MARGIN)]                               (14)
    [(solder_paste_margin MARGIN)]                              (15)
    [(solder_paste_ratio RATIO)]                                (16)
    [(clearance CLEARANCE)]                                     (17)
    [(zone_connect CONNECTION_TYPE)]                            (18)
    [(thermal_width WIDTH)]                                     (19)
    [(thermal_gap DISTANCE)]                                    (20)
    (ATTRIBUTES)                                                (21)
    (GRAPHIC_ITEMS...)                                          (22)
    (PADS...)                                                   (23)
    [(ZONES...)]                                                (24)
    [(GROUPS...)]                                               (25)
    (3D_MODEL)                                                  (26)
  )
1 The "LIBRARY_LINK" attribute defines the link to footprint library of the footprint.
2 The optional locked token defines a flag to indicate the footprint cannot be edited.
3 The optional placed token defines a flag to indicate that the footprint has not been placed.
4 The layer token defines the canonical layer the footprint is placed.
5 The tedit token defines a the last time the footprint was edited.
6 The tstamp token defines the unique identifier for the footprint.
7 The at token defines the position coordinates and rotational angle of the footprint.
8 The optional tags token defines a string of search tags for the footprint.
9 The optional descr token defines a string containing the description of the footprint.
10 The optional property token defines a property for the footprint.
11 The path token defines the hierarchical path of the schematic symbol linked to the footprint.
12 The optional autoplace_cost90 token defines the vertical cost of when using the automatic footprint placement tool. Valid values are integers 1 through 10.
13 The optional autoplace_cost180 token defines the horizontal cost of when using the automatic footprint placement tool. Valid values are integers 1 through 10.
14 The optional solder_mask_margin token defines the solder mask distance from all pads in the footprint. If not set, the board solder_mask_margin setting is used.
15 The optional solder_paste_margin token defines the solder paste distance from all pads in the footprint. If not set, the board solder_paste_margin setting is used.
16 The optional solder_paste_ratio token defines the percentage of the pad size used to define the solder paste for all pads in the footprint. If not set, the board solder_paste_ratio setting is used.
17 The optional clearance token defines the clearance to all board copper objects for all pads in the footprint. If not set, the board clearance setting is used.
18 The optional zone_connect token defines how all pads are connected to filled zone. If not defined, then the zone connect_pads setting is used. Valid connection types are integers values from 0 to 3 which defines:
  • 0 - Pads are not connect to zone.

  • 1 - Pads are connected to zone using thermal reliefs.

  • 2 - Pads are connected to zone using solid fill.

  • 3 - Only through hold pads are connected to zone using thermal reliefs.

19 The optional thermal_width token defined the thermal relief spoke width used for zone connections for all pads in the footprint. This only affects pads connected to zones with thermal reliefs. If not set, the zone thermal_width setting is used.
20 The optional thermal_gap is the distance from the pad to the zone of thermal relief connections for all pads in the footprint. If not set, the zone thermal_gap setting is used. If not set, the zone thermal_gap setting is used.
21 The attributes section defines the attributes of the footprint.
22 The graphic objects section is a list of one or more graphical objects in the footprint. At a minimum, the reference designator and value text objects are defined. All other graphical objects are optional.
23 The optional pads section is a list of pads in the footprint.
24 The optional zones section is a list of keep out zones in the footprint.
25 The optional groups section is a list of grouped objects in the footprint.
26 The 3D model section defines the 3D model object associated with the footprint.

Footprint Attributes

Footprint attr token defines the list of attributes of the footprint.

    (attr
      TYPE                                                      (1)
      [board_only]                                              (2)
      [exclude_from_pos_files]                                  (3)
      [exclude_from_bom]                                        (4)
    )
1 The TYPE token defines the type of footprint. Valid footprint types are smd and through_hole.
2 The optional board_only token indicates that the footprint is only defined in the board and has no reference to any schematic symbol.
3 The optional exclude_from_pos_files token indicates that the footprint position information should not be included when creating position files.
4 The optional exclude_from_bom token indicates that the footprint should be excluded when creating bill of materials (BOM) files.

Footprint Graphics Items

Footprint graphical items define all of the drawing items that are used in the footprint definition. This includes text, lines, rectangles, circles, arcs, polygons, and curves.

Footprint graphic items are not valid outside of a footprint definition.

Footprint Text

The fp_text token defines text in a footprint definition.

    (fp_text
      TYPE                                                      (1)
      "TEXT"                                                    (2)
      (at X Y [ORIENTATION])                                    (3)
      [unlocked]                                                (4)
      (layer LAYER_DEFINITION)                                  (5)
      [hide]                                                    (6)
      (TEXT_EFFECTS)                                            (7)
      (tstamp UUID)                                             (8)
    )
1 The TYPE attribute defines the type of text. Valid types are reference, value, and user.
2 The "TEXT" attribute is a quoted string that defines the text.
3 The at token defines the position coordinates and optional orientation angle of the text.
4 The optional unlocked token indicates if the text orientation can be anything other than the upright orientation.
5 The layer token defines the canonical layer the text resides on.
6 The optional [hide] token, defines if the text is hidden.
7 The TEXT_EFFECTS defines how the text is displayed.
8 The tstamp token defines the unique identifier of the text object.

Footprint Line

The fp_line token defines a graphic line in a footprint definition.

    (fp_line
      (start X Y)                                               (1)
      (end X Y)                                                 (2)
      (layer LAYER_DEFINITION)                                  (3)
      (width WIDTH)                                             (4)
      [(locked)]                                                (5)
      (tstamp UUID)                                             (6)
    )
1 The start token defines the coordinates of the beginning of the line.
2 The end token defines the coordinates of the end of the line.
3 The layer token defines the canonical layer the line resides on.
4 The width token defines the line width.
5 The optional locked token defines if the line cannot be edited.
6 The tstamp token defines the unique identifier of the line object.

Footprint Rectangle

The fp_rect token defines a graphic rectangle in a footprint definition.

    (fp_rect
      (start X Y)                                               (1)
      (end X Y)                                                 (2)
      (layer LAYER_DEFINITION)                                  (3)
      (width WIDTH)                                             (4)
      [(fill TYPE)]                                             (5)
      [(locked)]                                                (6)
      (tstamp UUID)                                             (7)
    )
1 The start token defines the coordinates of the upper left corner of the rectangle.
2 The end token defines the coordinates of the low right corner of the rectangle.
3 The layer token defines the canonical layer the rectangle resides on.
4 The width token defines the line width of the rectangle.
5 The optional fill toke defines how the rectangle is filled. Valid fill types are solid and none. If not defined, the rectangle is not filled.
6 The optional locked token defines if the rectangle cannot be edited.
7 The tstamp token defines the unique identifier of the rectangle object.

Footprint Circle

The fp_circle token defines a graphic circle in a footprint definition.

    (fp_circle
      (center X Y)                                              (1)
      (end X Y)                                                 (2)
      (layer LAYER_DEFINITION)                                  (3)
      (width WIDTH)                                             (4)
      [(fill TYPE)]                                             (5)
      [(locked)]                                                (6)
      (tstamp UUID)                                             (7)
    )
1 The center token defines the coordinates of the center of the circle.
2 The end token defines the coordinates of the end of the radius of the circle.
3 The layer token defines the canonical layer the circle resides on.
4 The width token defines the line width of the circle.
5 The optional fill toke defines how the circle is filled. Valid fill types are solid and none. If not defined, the circle is not filled.
6 The optional locked token defines if the circle cannot be edited.
7 The tstamp token defines the unique identifier of the circle object.

Footprint Arc

The fp_arc token defines a graphic arc in a footprint definition.

    (fp_arc
      (start X Y)                                               (1)
      (end X Y)                                                 (2)
      (angle ANGLE)                                             (3)
      (layer LAYER_DEFINITION)                                  (4)
      (width WIDTH)                                             (5)
      [(locked)]                                                (6)
      (tstamp UUID)                                             (7)
    )
1 The start token defines the coordinates of the start position of the arc radius.
2 The end token defines the coordinates of the end position of the arc radius.
3 The angle token defines the rotation angle from the end position around the start position of the arc.
4 The layer token defines the canonical layer the arc resides on.
5 The width token defines the line width of the arc.
6 The optional locked token defines if the arc cannot be edited.
7 The tstamp token defines the unique identifier of the arc object.

Footprint Polygon

The fp_poly token defines a graphic polygon in a footprint definition.

    (fp_poly
      (pts (xy X Y) ... (xy X Y))                               (1)
      (layer LAYER_DEFINITION)                                  (2)
      (width WIDTH)                                             (3)
      [(fill TYPE)]                                             (4)
      [(locked)]                                                (5)
      (tstamp UUID)                                             (6)
    )
1 The pts token defines the list of xy coordinates of the polygon outline.
2 The layer token defines the canonical layer the polygon resides on.
3 The width token defines the line width of the polygon.
4 The optional fill toke defines how the polygn is filled. Valid fill types are solid and none. If not defined, the polygon is not filled.
5 The optional locked token defines if the polygon cannot be edited.
6 The tstamp token defines the unique identifier of the polygon object.

Footprint Curve

The fp_curve token defines a graphic Qubic Bezier curve in a footprint definition.

    (fp_curve
      (pts (xy X Y) (xy X Y) (xy X Y) (xy X Y))                 (1)
      (layer LAYER_DEFINITION)                                  (2)
      (width WIDTH)                                             (3)
      [(locked)]                                                (4)
      (tstamp UUID)                                             (5)
    )
1 The pts token defines the four xy coordinates of each point of the curve.
2 The layer token defines the canonical layer the curve resides on.
3 The width token defines the line width of the curve.
4 The optional locked token defines if the curve cannot be edited.
5 The tstamp token defines the unique identifier of the curve object.

Footprint Pads

The pad token defines a pad in a footprint definition.

    (pad
      "NUMBER"                                                  (1)
      TYPE                                                      (2)
      SHAPE                                                     (3)
      (at X Y [ORIENTATION])                                    (4)
      [(locked)]                                                (5)
      (size X Y)                                                (6)
      [(drill DRILL_DEFINITION)]                                (7)
      (layers "CANONICAL_LAYER_LIST")                           (8)
      [(property PROPERTY)]                                     (9)
      [(remove_unused_layer)]                                   (10)
      [(keep_end_layers)]                                       (11)
      [(roundrect_rratio RATIO)]                                (12)
      [(chamfer_ratio RATIO)]                                   (13)
      [(chamfer CORNER_LIST)]                                   (14)
      (net NUMBER "NAME")                                       (15)
      (tstamp UUID)                                             (16)
      [(pinfunction "PIN_FUNCTION")]                            (17)
      [(pintype "PIN_TYPE")]                                    (18)
      [(die_length LENGTH)]                                     (19)
      [(solder_mask_margin MARGIN)]                             (20)
      [(solder_paste_margin MARGIN)]                            (21)
      [(solder_paste_margin_ratio RATIO)]                       (22)
      [(clearance CLEARANCE)]                                   (23)
      [(zone_connect ZONE)]                                     (24)
      [(thermal_width WIDTH)]                                   (25)
      [(thermal_gap DISTANCE)]                                  (26)
      [(CUSTOM_PAD_OPTIONS)]                                    (27)
      [(CUSTOM_PAD_PRIMITIVES)]                                 (28)
    )
1 The "NUMBER" attribute is the pad number.
2 The pad TYPE can be defined as thru_hole, smd, connect, or np_thru_hole.
3 The pad SHAPE can be defined as circle, rect, oval, trapezoid, roundrect, or custom.
4 The at token defines the position coordinates and optional orientation angle.
5 The optional locked token defines if the footprint pad can be edited.
6 The size token defines the width and height of the pad.
7 The optional pad DRILL_DEFINITION defines the pad drill requirements.
8 The layers token defines the layer or layers the pad reside on.
9 The optional property token defines any special properties for the pad. Valid properties are pad_prop_bga, pad_prop_fiducial_glob, pad_prop_fiducial_loc, pad_prop_testpoint, pad_prop_heatsink, pad_prop_heatsink, and pad_prop_castellated.
10 The optional remove_unused_layer token specifies that the copper should be removed from any layers the pad is not connected to.
11 The optional keep_end_layers token specifies that the top and bottom layers should be retained when removing the copper from unused layers.
12 The optional roundrect_rratio token defines the scaling factor of the pad to corner radius for rounded rectangular and chamfered corner rectangular pads. The scaling factor is a number between 0 and 1.
13 The optional chamfer_ratio token defines the scaling factor of the pad to chamfer size. The scaling factor is a number between 0 and 1.
14 The optional chamfer token defines a list of one or more rectangular pad corners that get chamfered. Valid chamfer corner attributes are top_left, top_right, bottom_left, and bottom_right.
15 The optional net token defines the integer number and name string of the net connection for the pad.
16 The tstamp token defines the unique identifier of the pad object.
17 The optional pinfunction token attribute defines the associated schematic symbol pin name.
18 The optional pintype token attribute defines the associated schematic pin electrical type.
19 The optional die_length token attribute defines the die length between the component pad and physical chip inside the component package.
20 The optional solder_mask_margin token attribute defines the distance between the pad and the solder mask for the pad. If not set, the footprint solder_mask_margin is used.
21 The optional solder_paste_margin token attribute defines the distance the solder paste should be changed for the pad.
22 The optional solder_paste_margin_ratio token attribute defines the percentage to reduce the pad outline by to generate the solder paste size.
23 The optional clearance token attribute defines the clearance from all copper to the pad. If not set, the footprint clearance is used.
24 The optional zone_connection token attribute defines type of zone connect for the pad. If not defined, the footprint zone_connection setting is used. Valid connection types are integers values from 0 to 3 which defines:
  • 0 - Pad is not connect to zone.

  • 1 - Pad is connected to zone using thermal relief.

  • 2 - Pad is connected to zone using solid fill.

  • 3 - Only through hold pad is connected to zone using thermal relief.

25 The optional thermal_width token attribute defines the thermal relief spoke width used for zone connection for the pad. This only affects a pad connected to a zone with a thermal relief. If not set, the footprint thermal_width setting is used.
26 The optional thermal_gap token attribute defines the distance from the pad to the zone of the thermal relief connection for the pad. This only affects a pad connected to a zone with a thermal relief. If not set, the footprint thermal_gap setting is used.
27 The optional custom pad options defines the options when a custom pad is defined.
28 The optional custom pad primitives defines the drawing objects and options used to define a custom pad.

Pad Drill Definition

The drill token defines the drill attributes for a footprint pad.

      (drill
        [oval]                                                  (1)
        DIAMETER                                                (2)
        [WIDTH]                                                 (3)
        [(offset X Y)]                                          (4)
      )
1 The optional oval token defines if the drill is oval instead of round.
2 The diameter attribute defines the drill diameter.
3 The optional width attribute defines the width of the slot for oval drills.
4 The optional offset token defines the drill offset coordinates from the center of the pad.

Custom Pad Options

The optional options token attributes define the settings used for custom pads. This token is only used when a custom pad is defined.

      (options
        (clearance CLEARANCE_TYPE)                              (1)
        (anchor PAD_SHAPE)                                      (2)
      )
1 The clearance token defines the type of clearance used for a custom pad. Valid clearance types are outline and convexhull.
2 The anchor token defines the anchor pad shape of a custom pad. Valid anchor pad shapes are rect and circle.

Custom Pad Primitives

The optional primitives token defines a list of graphical items used to define the outling of a custom pad shape. This token is only used when a custom pad is defined.

      (primitives
        (GRAPHIC_ITEMS...)                                      (1)
        (width WIDTH)                                           (2)
        [(fill yes)]                                            (3)
      )
1 The graphical items is a list of graphical lines, rectangles, arcs, circles, curves, and Graphical Polygon,polygons>> the define the shape of a custom pad. The item definitions only include the geometrical information that defines the item.
2 The width token defines the line width of the graphical items.
3 The optional fill token attribute yes indicates the geometry defined by the graphical items should be filled.

Footprint 3D Model

The model token defines the 3D model associated with a footprint.

    (model
      "3D_MODEL_FILE"                                           (1)
      (at (xyz X Y Z))                                          (2)
      (scale (xyz X Y Z))                                       (3)
      (rotate (xyz X Y Z))                                      (4)
    )
1 The 3D_MODEL_FILE attribute is the path and file name of the 3D model.
2 The at token specifies the 3D position coordinates of the model relative to the footprint.
3 The scale token specifies the model scale factor for each 3D axis.
4 The rotate token specifies the model rotation for each 3D axis relative to the footprint.

Graphic Items Section

The graphical items section contains all board items that are outside of the connectivity defined in the net section. This includes graphical items on technical, user, and copper layers. Graphical items are also used to define complex pad geometries.

Graphical Text

The gr_text token defines graphical text.

  (gr_text
    "TEXT"                                                      (1)
    (at X Y [ORIENTATION])                                      (2)
    (layer LAYER_DEFINITION)                                    (3)
    (tstamp UUID)                                               (4)
    (effects FONT_EFFECTS)                                      (5)
  )
1 The "TEXT" attribute is a quoted string that defines the text.
2 The at token defines the position coordinates and optional orientation angle of the text.
3 The layer token defines the canonical layer the text resides on.
4 The tstamp token defines the unique identifier of the text object.
5 The TEXT_EFFECTS defines how the text is displayed.

Graphical Line

The gr_line token defines a graphical line.

  (gr_line
    (start X Y)                                                 (1)
    (end X Y)                                                   (2)
    [(angle ANGLE)]                                             (3)
    (layer LAYER_DEFINITION)                                    (4)
    (width WIDTH)                                               (5)
    (tstamp UUID)                                               (6)
  )
1 The start token defines the coordinates of the beginning of the line.
2 The end token defines the coordinates of the end of the line.
3 The optional angle token defines the rotational angle of the line.
4 The layer token defines the canonical layer the line resides on.
5 The width token defines the line width.
6 The tstamp token defines the unique identifier of the line object.

Graphical Rectangle

The gr_rect token defines a graphical rectangle.

  (gr_rect
    (start X Y)                                                 (1)
    (end X Y)                                                   (2)
    (layer LAYER_DEFINITION)                                    (3)
    (width WIDTH)                                               (4)
    [(fill MODE)]                                               (5)
    (tstamp UUID)                                               (6)
  )
1 The start token defines the coordinates of the upper left corner of the rectangle.
2 The end token defines the coordinates of the low right corner of the rectangle.
3 The layer token defines the canonical layer the rectangle resides on.
4 The width token defines the line width of the rectangle.
5 The optional fill toke defines how the rectangle is filled. Valid fill types are solid and none. If not defined, the rectangle is not filled.
6 The tstamp token defines the unique identifier of the rectangle object.

Graphical Circle

The gr_circle token defines a graphical circle.

  (gr_circle
    (center X Y)                                                (1)
    (end X Y)                                                   (2)
    (layer LAYER_DEFINITION)                                    (3)
    (width WIDTH)                                               (4)
    [(fill MODE)]                                               (5)
    (tstamp UUID)                                               (6)
  )
1 The center token defines the coordinates of the center of the circle.
2 The end token defines the coordinates of the end of the radius of the circle.
3 The layer token defines the canonical layer the circle resides on.
4 The width token defines the line width of the circle.
5 The optional fill toke defines how the circle is filled. Valid fill types are solid and none. If not defined, the circle is not filled.
6 The tstamp token defines the unique identifier of the circle object.

Graphical Arc

The gr_arc token defines a graphical arc.

  (gr_arc
    (start X Y)                                                 (1)
    (end X Y)                                                   (2)
    (angle ANGLE)                                               (3)
    (layer LAYER_DEFINITION)                                    (4)
    (width WIDTH)                                               (5)
    (tstamp UUID)                                               (6)
  )
1 The start token defines the coordinates of the start position of the arc radius.
2 The end token defines the coordinates of the end position of the arc radius.
3 The angle token defines the rotation angle from the end position around the start position of the arc.
4 The layer token defines the canonical layer the arc resides on.
5 The width token defines the line width of the arc.
6 The tstamp token defines the unique identifier of the arc object.

Graphical Polygon

The gr_poly token defines a graphical polygon.

  (gr_poly
    (pts (xy X Y) ... (xy X Y))                                 (1)
    (layer LAYER_DEFINITION)                                    (2)
    (width WIDTH)                                               (3)
    [(fill MODE)]                                               (4)
    (tstamp UUID)                                               (5)
  )
1 The pts token defines the list of xy coordinates of the polygon outline.
2 The layer token defines the canonical layer the polygon resides on.
3 The width token defines the line width of the polygon.
4 The optional fill toke defines how the polygn is filled. Valid fill types are solid and none. If not defined, the polygon is not filled.
5 The tstamp token defines the unique identifier of the polygon object.

Graphical Curve

The gr_curve token defines a graphic Qubic Bezier curve.

  (gr_curve
    (pts (xy X Y) (xy X Y) (xy X Y) (xy X Y))                   (1)
    (layer LAYER_DEFINITION)                                    (2)
    (width WIDTH)                                               (3)
    (tstamp UUID)                                               (4)
  )
1 The pts token defines the four xy coordinates of each point of the curve.
2 The layer token defines the canonical layer the curve resides on.
3 The width token defines the line width of the curve.
4 The tstamp token defines the unique identifier of the curve object.

Dimension

The dimension token defines a dimension object.

  (dimension
    [locked]                                                    (1)
    (type DIMENSION_TYPE)                                       (2)
    (layer LAYER_DEFINITION)                                    (3)
    (tstamp UUID)                                               (4)
    (pts (xy X Y) (xy X Y))                                     (5)
    [(height HEIGHT)]                                           (6)
    [(orientation ORIENTATION)]                                 (7)
    [(gr_text GRAPHICAL_TEXT)]                                  (8)
    [(format DIMENSION_FORMAT)]                                 (9)
    (style DIMENSION_STYLE)                                     (10)
  )
1 The optional locked token specifies if the dimension can be moved.
2 The type token attribute defines the type of dimension. Valid dimension types are aligned, leader, center, and orthogonal.
3 The layer token defines the canonical layer the polygon resides on.
4 The tstamp token defines the unique identifier of the dimension object.
5 The pts token attributes define the list of xy coordinates of the dimension.
6 The optional height token attribute defines the height of aligned dimensions.
7 The optional orientation token attribute defines the rotation angle for orthogonal dimensions.
8 The optional gr_text token attributes define the dimension text formatting for all dimension types except center dimensions.
9 The optional format token attributes define the dimension formatting for all dimension types except center dimensions.
10 The style token attributes define the dimension style information.

Dimension Format

The format token attributes define the text formatting of the dimension.

    (format
      [(prefix "PREFIX")]                                       (1)
      [(suffix "SUFFIX")]                                       (2)
      (units UNITS)                                             (3)
      (units_format UNITS_FORMAT)                               (4)
      (precision PRECISION)                                     (5)
      [(override_value "VALUE")]                                (6)
      [suppress_zeros]                                          (7)
    )
1 The optional prefix token attribute defines the string to add to the beginning of the dimension text.
2 The optional suffix token attribute defines the string to add to the end of the dimension text.
3 The units token attribute defines the dimension units used to display the dimension text. Valid units are as follows:
  • 0 - Inches.

  • 1 - Mils.

  • 2 - Millimeters.

  • 3 - Automatic.

4 The units_format token attribute defines how the unit’s suffix is formatted. Valid units formats are as follows:
  • 0 - No suffix.

  • 1 - Bare suffix.

  • 2 - Wrap suffix in parenthesis.

5 The precision token attribute defines the number of significant digits to display.
6 The optional override_value token attribute defines the text to substitute for the actual physical dimension.
7 The optional suppress_zeros token removes all trailing zeros from the dimension text.

Dimension Style

    (style
      (thickness THICKNESS)                                     (1)
      (arrow_length LENGTH)                                     (2)
      (text_position_mode MODE)                                 (3)
      [(extension_height HEIGHT)]                               (4)
      [(text_frame TEXT_FRAME_TYPE)]                            (5)
      [(extension_offset OFFSET)]                               (6)
      [(keep_text_aligned)]                                     (7)
    )
1 The thickness token attribute defines the line thickness of the dimension.
2 The arrow_length token attribute defines the length of the dimension arrows.
3 The text_position_mode token attribute defines the position mode of the dimension text. Valid position modes are as follows:
  • 0 - Text is outside the dimension line.

  • 1 - Text is in line with the dimension line.

  • 2 - Text has been manually placed by the user.

4 The optional extension_height token attribute defines the length of the extension lines past the dimension crossbar.
5 The optional text_frame token attribute defines the style of the frame around the dimension text. This only applies to leader dimensions. Valid text frames are as follows:
  • 0 - No text frame.

  • 1 - Rectangle.

  • 2 - Circle.

  • 3 - Rounded rectangle.

6 The optional extension_offset token attribute defines the distance from feature points to extension line start.
7 The optional keep_text_aligned token indicates that the dimension text should be kept in line with the dimension crossbar. When not defined, the dimension text is shown horizontally regardless of the orientation of the dimension.

Tracks Section

This section lists all of segment, via, and arc objects that make up tracks on the board.

Track Segment

The segment token defines a track segment.

  (segment
    (start X Y)                                                 (1)
    (end X Y)                                                   (2)
    (width WIDTH)                                               (3)
    (layer LAYER_DEFINITION)                                    (4)
    [(locked)]                                                  (5)
    (net NET_NUMBER)                                            (6)
    (tstamp UUID)                                               (7)
  )
1 The start token defines the coordinates of the beginning of the line.
2 The end token defines the coordinates of the end of the line.
3 The width token defines the line width.
4 The layer token defines the canonical layer the track segment resides on.
5 The optional locked token defines if the line cannot be edited.
6 The net token defines by the net ordinal number which net in the net section that the segment is part of.
7 The tstamp token defines the unique identifier of the line object.

Track Via

The via token defines a track via.

  (via
    [TYPE]                                                      (1)
    [(locked)]                                                  (2)
    (at X Y)                                                    (3)
    (size DIAMETER)                                             (4)
    (drill DIAMETER)                                            (5)
    (layers LAYER1 LAYER2)                                      (6)
    [(remove_unused_layers)]                                    (7)
    [(keep_end_layers)]                                         (8)
    [(free)]                                                    (9)
    (net NET_NUMBER)                                            (10)
    (tstamp UUID)                                               (11)
  )
1 The optional type attribute specifies the via type. Valid via types are blind and micro. If no type is defined, the via is a through hole type.
2 The optional locked token defines if the line cannot be edited.
3 The at token attributes define the coordinates of the center of the via.
4 The size token attribute defines the diameter of the via annular ring.
5 The drill token attribute defines the drill diameter of the via.
6 The layers token attributes define the canonical layer set the via connects.
7 The optional remove_unused_layers token specifies DOCUMENT ME.
8 The optional keep_end_layers token specifies DOCUMENT ME. This token is only defined when the remove_unused_layers token is defined.
9 The optional free token indicates that the via is free to be moved outside it’s assigned net.
10 The net token attribute defines by net ordinal number which net in the net section that the segment is part of.
11 The tstamp token defines the unique identifier of the line object.

Track Arc

The arc token defines a track arc.

  (arc
    (start X Y)                                                 (1)
    (mid X Y)                                                   (2)
    (end X Y)                                                   (3)
    (width X Y)                                                 (4)
    (layer LAYER_DEFINITION)                                    (5)
    [(locked)]                                                  (6)
    (net NET_NUMBER)                                            (7)
    (tstamp UUID)                                               (8)
  )
1 The start token defines the coordinates of the beginning of the arc.
2 The mid toke defines the coordinates of the mid point of the radius of the arc.
3 The end token defines the coordinates of the end of the arc.
4 The width token defines the line width.
5 The layer token defines the canonical layer the track arc resides on.
6 The optional locked token defines if the line cannot be edited.
7 The net token defines by the net ordinal number which net in the net section that the segment is part of.
8 The tstamp token defines the unique identifier of the line object.

Zones Section

The zone token defines a zone on the board. This section is omitted if there are no zones on the board. Zones serve two purposes in KiCad: filled copper zones and keep out areas.

  (zone
    (net NET_NUMBER)                                            (1)
    (net_name "NET_NAME")                                       (2)
    (layer LAYER_DEFINITION)                                    (3)
    (tstamp UUID)                                               (4)
    [(name "NAME")]                                             (5)
    (hatch STYLE PITCH)                                         (6)
    [(priority PRIORITY)]                                       (7)
    (connect_pads [CONNECTION_TYPE] (clearance CLEARANCE))      (8)
    (min_thickness THICKNESS)                                   (9)
    [(filled_areas_thickness no)]                               (10)
    [(ZONE_KEEPOUT_SETTINGS)]                                   (11)
    (ZONE_FILL_SETTINGS)]                                       (12)
    (polygon (pts (xy X Y)...(xy X Y)))                         (13)
    [(ZONE_FILL_POLYGONS)]                                      (14)
    [(ZONE_FILL_SEGMENTS)]                                      (15)
  )
1 The net token attribute defines by the net ordinal number which net in the net section that the zone is part of.
2 The net_name token attribute defines the name of the net if the zone is not a keep out area. The net name attribute will be an empty string if the zone is a keep out area.
3 The layer token defines the canonical layer the zone resides on.
4 The tstamp token defines the unique identifier of the zone object.
5 The optional name token attribute defines the name of the zone if one has been assigned.
6 The hatch token attributes define the zone outline display hatch style and pitch. Valid hatch styles are none, edge, and full.
7 The optional priority attribute defines the zone priority if it is not zero.
8 The connect_pads token attributes define the pad connection type and clearance. Valid pad connection types are thru_hole_only, full, and no. If the pad connection type is not defined, thermal relief pad connections are used.
9 The min_thickness token attributed defines the minimum fill width allowed in the zone.
10 The optional filled_areas_thickness attribute no specifies if the zone like width is not used when determining the zone fill area. This is to maintain compatibility with older board files that included the line thickness when performing zone fills when it is not defined.
11 The optional zone keep out settings section defines the keep out items if the zone defines as a keep out area.
12 The zone fill settings section defines how the zone is to be filled.
13 The polygon token attributes define the corners of the zone outline polygon.
14 The optional zone fill polygons section defines all of the polygons used to fill the zone. This section will not exist if the zone has not been filled or is filled with segments.
15 The optional zone fill segments section defines a list of track segments used to fill the zone. This is only used when boards prior to version 4 of KiCad are loaded.

Zone Keep Out Settings

The optional keepout token attributes define which objects should be kept out of the zone. This section only applies to keep out zones.

    (keepout
      (tracks KEEPOUT)                                          (1)
      (vias KEEPOUT)                                            (2)
      (pads KEEPOUT)                                            (3)
      (copperpour KEEPOUT)                                      (4)
      (footprints KEEPOUT)                                      (5)
    )
1 The tracks token attribute defines whether or not tracks should be exlcuded from the keep out area. Valid attributes are allowed and not_allowed.
2 The vias token attribute defines whether or not vias should be exlcuded from the keep out area. Valid attributes are allowed and not_allowed.
3 The pads token attribute defines whether or not pads should be exlcuded from the keep out area. Valid attributes are allowed and not_allowed.
4 The copperpour token attribute defines whether or not copper pours should be exlcuded from the keep out area. Valid attributes are allowed and not_allowed.
5 The footprints token attribute defines whether or not footprintss should be exlcuded from the keep out area. Valid attributes are allowed and not_allowed.

Zone Fill Settings

The fill token attributes define how the zone is to be filled.

    (fill
      [yes]                                                     (1)
      [(mode FILL_MODE)]                                        (2)
      (thermal_gap GAP)                                         (3)
      (thermal_bridge_width WIDTH)                              (4)
      [(smoothing STYLE (radius RADIUS))]                       (5)
      [(island_removal_mode MODE)]                              (6)
      [(island_area_min AREA)]                                  (7)
      [(hatch_thickness THICKNESS)]                             (8)
      [(hatch_gap GAP)]                                         (9)
      [(hatch_orientation ORIENTATION)]                         (10)
      [(hatch_smoothing_level LEVEL)]                           (11)
      [(hatch_smoothing_value VALUE)]                           (12)
      [(hatch_border_algorithm TYPE)]                           (13)
      [(hatch_min_hole_area AREA)]                              (14)
    )
1 The yes token specifies if the zone should be filled. If not specified, the zone is not filled and no additional attributes are required.
2 The optional mode token attribute defines how the zone is filled. The only valid fill mode is hatched. When not defined, the fill mode is solid.
3 The optional thermal_gap token attribute defines the distance from the zone to all pad thermal relief connections to the zone.
4 The optional thermal_bridge_width token attribute defines the spoke width for all pad thermal relief connection to the zone.
5 The optional smoothing token attributes define the style of corner smoothing and the radius of the smoothing. Valid smoothing styles are chamfer and fillet.
6 The optional island_removal_mode token attribute defines the island removal mode. Valid island removal modes are:
  • 0 - Always remove islands.

  • 1 - Never remove islands.

  • 2 - Minimum area island to allow.

7 The optional island_area_min token attribute defines the minimum allowable zone island. This only valid when the remove islands mode is set to 2.
8 The optional hatch_thickness token attribute defines the thickness for hatched fills.
9 The optional hatch_gap token attribute defines the distance between lines for hatched fills.
10 The optional hatch_orientation token attribute defines the line angle for hatched fills.
11 The optional hatch_smoothing_level token attribute defines how hatch outlines are smoothed. Valid hatch smoothing levels are:
  • 0 - No smoothing.

  • 1 - Fillet.

  • 2 - Arc minimum.

  • 3 - Arc maximum.

12 The optional hatch_smoothing_value token attribute defines the ratio between the hole and the chamfer/fillet size.
13 The optional hatch_border_algorithm token attribute defines the if the zone line thickness is used when performing a hatch fill. Valid values for the hatch border algorithm are:
  • 0 - Use zone minimum thickness.

  • 1 - Use hatch thickness.

14 The optional hatch_min_hole_area token attribute defines the minimum area a hatch file hole can be.

Zone Fill Polygons

The filled_polygon token defines the polygons used to fill the zone. This token will not exist if the zone has not been filled.

    (filled_polygon
      (layer LAYER_DEFINITION)                                  (1)
      (pts (xy X Y)...(xy X Y))                                 (2)
    )
1 The layer token attirbute defines the canonical layer the zone fill resides on.
2 The pts token attributes define a list of polygon xy coordinates used to fill the zone.

Zone Fill Segments

The filled_segments token defines the segments used to fill the zone. This is only used when loading boards prior to version 4 which filled zones with segments. Once the zone has been refilled, it will be filled with polygons and this token will not exist.

    (fill_segments
      (layer LAYER_DEFINITION)                                  (1)
      (pts (xy X Y) (xy X Y))                                   (2)
    )
1 The layer token attirbute defines the canonical layer the zone fill resides on.
2 The pts token attributes define a list of segment xy coordinates used to fill the zone.

Group Section

The group token defines a group of items on the board. This section will not exist if no groups have been defined.

  (group
    "NAME"                                                      (1)
    (id UUID)                                                   (2)
    (members UUID1 ... UUIDN)                                   (3)
  )
1 The name attribute defines the name of the group.
2 The id token attribute defines the unique identifier of the group.
3 The members token attributes define a list of unique identifiers of the objects belonging to the group.

Board Example:

(kicad_pcb (version 3) (host pcbnew "(2013-02-20 BZR 3963)-testing")

  (general
    (links 2)
    (no_connects 0)
    (area 57.924999 28.924999 74.075001 42.075001)
    (thickness 1.6)
    (drawings 5)
    (tracks 5)
    (zones 0)
    (modules 2)
    (nets 3)
  )

  (page A4)
  (layers
    (15 top_side.Cu signal)
    (2 Inner2.Cu signal)
    (1 Inner1.Cu signal)
    (0 bottom_side.Cu signal)
    (16 B.Adhes user)
    (17 F.Adhes user)
    (18 B.Paste user)
    (19 F.Paste user)
    (20 B.SilkS user)
    (21 F.SilkS user)
    (22 B.Mask user)
    (23 F.Mask user)
    (24 Dwgs.User user)
    (25 Cmts.User user)
    (26 Eco1.User user)
    (27 Eco2.User user)
    (28 Edge.Cuts user)
  )

  (setup
    (last_trace_width 0.254)
    (trace_clearance 0.254)
    (zone_clearance 0.2)
    (zone_45_only no)
    (trace_min 0.254)
    (segment_width 0.2)
    (edge_width 0.15)
    (via_size 0.889)
    (via_drill 0.635)
    (via_min_size 0.889)
    (via_min_drill 0.508)
    (uvia_size 0.508)
    (uvia_drill 0.127)
    (uvias_allowed no)
    (uvia_min_size 0.508)
    (uvia_min_drill 0.127)
    (pcb_text_width 0.3)
    (pcb_text_size 1.5 1.5)
    (mod_edge_width 0.15)
    (mod_text_size 1.5 1.5)
    (mod_text_width 0.15)
    (pad_size 0.0005 0.0005)
    (pad_drill 0)
    (pad_to_mask_clearance 0.2)
    (aux_axis_origin 0 0)
    (visible_elements 7FFFFFFF)
    (pcbplotparams
      (layerselection 3178497)
      (usegerberextensions true)
      (excludeedgelayer true)
      (linewidth 50000)
      (plotframeref false)
      (viasonmask false)
      (mode 1)
      (useauxorigin false)
      (hpglpennumber 1)
      (hpglpenspeed 20)
      (hpglpendiameter 15)
      (hpglpenoverlay 2)
      (psnegative false)
      (psa4output false)
      (plotreference true)
      (plotvalue true)
      (plotothertext true)
      (plotinvisibletext false)
      (padsonsilk false)
      (subtractmaskfromsilk false)
      (outputformat 1)
      (mirror false)
      (drillshape 1)
      (scaleselection 1)
      (outputdirectory ""))
  )

  (net 0 "")
  (net 1 /SIGNAL)
  (net 2 GND)

  (net_class Default "Ceci est la Netclass par défaut"
    (clearance 0.254)
    (trace_width 0.254)
    (via_dia 0.889)
    (via_drill 0.635)
    (uvia_dia 0.508)
    (uvia_drill 0.127)
    (add_net "")
    (add_net /SIGNAL)
  )

  (net_class POWER ""
    (clearance 0.254)
    (trace_width 0.5)
    (via_dia 1.2)
    (via_drill 0.635)
    (uvia_dia 0.508)
    (uvia_drill 0.127)
    (add_net GND)
  )

  (module R3 (layer top_side.Cu) (tedit 4E4C0E65) (tstamp 5127A136)
    (at 66.04 33.3502)
    (descr "Resitance 3 pas")
    (tags R)
    (path /5127A011)
    (autoplace_cost180 10)
    (fp_text reference R1 (at 0 0.127) (layer F.SilkS) hide
      (effects (font (size 1.397 1.27) (thickness 0.2032)))
    )
    (fp_text value 330K (at 0 0.127) (layer F.SilkS)
      (effects (font (size 1.397 1.27) (thickness 0.2032)))
    )
    (fp_line (start -3.81 0) (end -3.302 0) (layer F.SilkS) (width 0.2032))
    (fp_line (start 3.81 0) (end 3.302 0) (layer F.SilkS) (width 0.2032))
    (fp_line (start 3.302 0) (end 3.302 -1.016) (layer F.SilkS) (width 0.2032))
    (fp_line (start 3.302 -1.016) (end -3.302 -1.016) (layer F.SilkS) (width 0.2032))
    (fp_line (start -3.302 -1.016) (end -3.302 1.016) (layer F.SilkS) (width 0.2032))
    (fp_line (start -3.302 1.016) (end 3.302 1.016) (layer F.SilkS) (width 0.2032))
    (fp_line (start 3.302 1.016) (end 3.302 0) (layer F.SilkS) (width 0.2032))
    (fp_line (start -3.302 -0.508) (end -2.794 -1.016) (layer F.SilkS) (width 0.2032))
    (pad 1 thru_hole circle (at -3.81 0) (size 1.397 1.397) (drill 0.812799)
      (layers *.Cu *.Mask F.SilkS)
      (net 1 /SIGNAL)
    )
    (pad 2 thru_hole circle (at 3.81 0) (size 1.397 1.397) (drill 0.812799)
      (layers *.Cu *.Mask F.SilkS)
      (net 2 GND)
    )
    (model discret/resistor.wrl
      (at (xyz 0 0 0))
      (scale (xyz 0.3 0.3 0.3))
      (rotate (xyz 0 0 0))
    )
  )

  (module CP4 (layer top_side.Cu) (tedit 5127A26C) (tstamp 5127A146)
    (at 66.1416 36.8808)
    (descr "Condensateur polarise")
    (tags CP)
    (path /50FD6D39)
    (fp_text reference C1 (at 0.508 0) (layer F.SilkS)
      (effects (font (size 1.27 1.397) (thickness 0.254)))
    )
    (fp_text value 10uF (at 0.8584 2.1192) (layer F.SilkS) hide
      (effects (font (size 1.27 1.143) (thickness 0.254)))
    )
    (fp_line (start 5.08 0) (end 4.064 0) (layer F.SilkS) (width 0.3048))
    (fp_line (start 4.064 0) (end 4.064 1.016) (layer F.SilkS) (width 0.3048))
    (fp_line (start 4.064 1.016) (end -3.556 1.016) (layer F.SilkS) (width 0.3048))
    (fp_line (start -3.556 1.016) (end -3.556 -1.016) (layer F.SilkS) (width 0.3048))
    (fp_line (start -3.556 -1.016) (end 4.064 -1.016) (layer F.SilkS) (width 0.3048))
    (fp_line (start 4.064 -1.016) (end 4.064 0) (layer F.SilkS) (width 0.3048))
    (fp_line (start -5.08 0) (end -4.064 0) (layer F.SilkS) (width 0.3048))
    (fp_line (start -3.556 0.508) (end -4.064 0.508) (layer F.SilkS) (width 0.3048))
    (fp_line (start -4.064 0.508) (end -4.064 -0.508) (layer F.SilkS) (width 0.3048))
    (fp_line (start -4.064 -0.508) (end -3.556 -0.508) (layer F.SilkS) (width 0.3048))
    (pad 1 thru_hole rect (at -5.08 0) (size 1.397 1.397) (drill 0.812799)
      (layers *.Cu *.Mask F.SilkS)
      (net 1 /SIGNAL)
    )
    (pad 2 thru_hole circle (at 5.08 0) (size 1.397 1.397) (drill 0.812799)
      (layers *.Cu *.Mask F.SilkS)
      (net 2 GND)
    )
    (model discret/c_pol.wrl
      (at (xyz 0 0 0))
      (scale (xyz 0.4 0.4 0.4))
      (rotate (xyz 0 0 0))
    )
  )

  (gr_text TEST (at 62 31) (layer top_side.Cu)
    (effects (font (size 1.5 1.5) (thickness 0.3)))
  )
  (gr_line (start 58 42) (end 58 29) (angle 90) (layer Edge.Cuts) (width 0.15))
  (gr_line (start 74 42) (end 58 42) (angle 90) (layer Edge.Cuts) (width 0.15))
  (gr_line (start 74 29) (end 74 42) (angle 90) (layer Edge.Cuts) (width 0.15))
  (gr_line (start 58 29) (end 74 29) (angle 90) (layer Edge.Cuts) (width 0.15))

  (segment (start 61.0616 36.8808) (end 61.0616 34.5186) (width 0.254) (layer bottom_side.Cu) (net 1))
  (segment (start 61.0616 34.5186) (end 62.23 33.3502) (width 0.254) (layer bottom_side.Cu) (net 1) (tstamp 5127A159))
  (segment (start 69.85 33.3502) (end 70.993 33.3502) (width 0.5) (layer bottom_side.Cu) (net 2))
  (segment (start 71.2216 33.5788) (end 71.2216 36.8808) (width 0.5) (layer bottom_side.Cu) (net 2) (tstamp 5127A156))
  (segment (start 70.993 33.3502) (end 71.2216 33.5788) (width 0.5) (layer bottom_side.Cu) (net 2) (tstamp 5127A155))

  (zone (net 2) (net_name GND) (layer bottom_side.Cu) (tstamp 5127A1B2) (hatch edge 0.508)
    (connect_pads (clearance 0.2))
    (min_thickness 0.1778)
    (fill (arc_segments 16) (thermal_gap 0.254) (thermal_bridge_width 0.4064))
    (polygon
      (pts
        (xy 59 30) (xy 73 30) (xy 73 41) (xy 59 41)
      )
    )
  )
)

Last Modified