P-CAD

Introduction

P-CAD was a PCB design tool developed by ACCEL Technologies, later acquired by Protel (which became Altium). Altium discontinued P-CAD around 2008-2010, but legacy designs in P-CAD format persist. See also the Altium format documentation for the related but distinct binary format used by Altium Designer.

KiCad supports PCB layout import only. No schematic importer exists for P-CAD.

Supported file type:

  • .pcb — P-CAD ASCII format

File Structure

P-CAD ASCII files use an S-expression-like parenthesized structure with the ACCEL_ASCII identifier on the first line. The importer validates this identifier before processing.

Tokenization and DOM Conversion

The file is tokenized by DSNLEXER, which reads left and right parentheses as structural delimiters. Each (keyword …​) block is converted to an XML element node via the XNODE class. Quoted strings become Name attributes on the current node, and unquoted tokens are appended to the node’s text content. The root of the resulting DOM tree is a synthetic www.lura.sk node (an artifact of the parser’s XML construction).

(ACCEL_ASCII "designname"
  (asciiHeader
    (fileUnits mil)
  )
  (library
    (padStyleDef "pad60cir40d"
      (holeDiam 40)
      (padShape (layerNumRef 1) (padShapeType Oval) (shapeWidth 60) (shapeHeight 60))
    )
    (viaStyleDef "via24d12"
      (holeDiam 12)
      (viaShape (layerNumRef 1) (viaShapeType Oval) (shapeWidth 24) (shapeHeight 24))
    )
    (patternDef "DIP14" ...)
    (compDef "74HC00" ...)
  )
  (netlist
    (net "GND" (node "U1 7"))
  )
  (pcbDesign
    (layerDef "Top" (layerNum 1) (layerType Signal))
    (multiLayer ...)
    (layerContents ...)
  )
)

Character Encoding

The loader opens the file with windows-1251 character conversion.

Coordinate System and Units

P-CAD ASCII files declare their measurement unit in the asciiHeader section via the fileUnits keyword. The default is mil (thousandths of an inch).

P-CAD uses a standard Cartesian coordinate system with Y increasing upward. KiCad uses Y increasing downward, so all Y coordinates are negated during import.

KiCad_x =  pcad_x  (converted from file units to nanometers)
KiCad_y = -pcad_y

Rotation angles throughout the file are specified in tenths of a degree. The importer converts to degrees by dividing by 10.

Document Hierarchy

The DOM tree produced by the loader has the following top-level structure.

asciiHeader

Contains fileUnits which specifies the default measurement unit for coordinate and dimension values throughout the file. The parser reads this value and stores it as m_DefaultMeasurementUnit (defaults to mil if absent).

library

Contains style definitions and component/pattern definitions referenced by the board.

padStyleDef

Named pad style with holeDiam, isHolePlated, and one or more padShape child nodes (one per layer).

viaStyleDef

Named via style with holeDiam and one or more viaShape child nodes (one per layer).

patternDef / patternDefExtended

Footprint pattern definitions. See Old vs New Format for the distinction.

compDef

Component definitions that bind a logical component name to a pattern via attachedPattern / patternName and provide padNum / pin mapping.

netlist

Contains net nodes, each with a Name attribute and one or more node child entries. Each node carries a Name attribute formatted as "compRef pinRef" (space-separated component reference designator and pin name).

The netlist section also contains compInst nodes that associate component instance reference designators with compValue and compRef attributes.

pcbDesign

The main board section. Its children are processed in order.

layersStackup

Optional. Contains layerStackupData children, each with a layerStackupName that defines the physical layer ordering. Used to determine copper layer count and order.

layerDef

Layer definition with Name attribute, layerNum, layerType (Signal, NonSignal, or Plane), and optional netNameRef for plane layers. Multiple layerDef nodes appear as siblings.

multiLayer

Contains board-level pattern placements, standalone pad and via instances, and polyKeepOut regions. See Component Placement and Pads and Vias.

layerContents

Per-layer graphical and electrical content. Each layerContents node has a layerNumRef identifying its layer. Children include line, arc, triplePointArc, text, pcbPoly, copperPour95, polyCutOut, planeObj, boardOutlineObj, and attr nodes.

Old vs New Format

The importer auto-detects two P-CAD file format variants.

Old Format

Pattern definitions use patternDef nodes. The multiLayer section containing pads and vias is a direct child of the pattern definition.

(patternDef "DIP14"
  (originalName "DIP14")
  (multiLayer
    (pad (padNum 1) (padStyleRef "pad60cir40d") (pt 0 0))
    (pad (padNum 2) (padStyleRef "pad60cir40d") (pt 100 0))
  )
  (layerContents ...)
)

New Format

Pattern definitions use patternDefExtended nodes. The multilayer section is nested inside patternGraphicsDef children, selected by patternGraphicsNameDef / patternGraphicsNameRef matching.

(patternDefExtended "DIP14"
  (originalName "DIP14")
  (patternGraphicsDef
    (patternGraphicsNameDef "Default")
    (multiLayer
      (pad (padNum 1) (padStyleRef "pad60cir40d") (pt 0 0))
    )
  )
)

Detection Logic

The parser first searches for patternDef nodes in the library section. If none are found, it searches for patternDefExtended nodes. When placing components, the presence of a patternGraphicsNameRef child in the pattern node indicates new-format behavior. The selected patternGraphicsDef is matched by comparing its patternGraphicsNameDef attribute to the patternGraphicsNameRef from the component placement.

Text property resolution also differs between formats. In new format files, attr nodes for RefDes and Value are searched within the matching patternGraphicsRef section rather than directly within the pattern node.

Component Placement

Component instances appear as pattern children of multiLayer within pcbDesign. Each pattern node contains:

patternRef

Name attribute referencing a patternDef / patternDefExtended in the library.

refDesRef

Name attribute providing the reference designator (e.g., U1).

pt

Position coordinates in file units.

rotation

Rotation angle in tenths of a degree.

isFlipped

True or False indicating back-side placement.

patternGraphicsNameRef

(New format only) selects which patternGraphicsDef to use.

After parsing, the importer resolves compInst nodes from the netlist to assign compValue and compRef to each footprint, then applies pin mapping from the library compDef.

Pads and Vias

Pad Definitions

Standalone pads appear as pad children of multiLayer. Each pad references a padStyleDef from the library by name.

The padStyleDef contains:

Node Description

holeDiam

Drill hole diameter in file units

isHolePlated

True (default) or False for NPTH

padShape

Per-layer shape definition (one or more)

Each padShape child contains:

Node Description

layerNumRef

Target layer number

padShapeType

Shape name (see table below)

shapeWidth

Pad width in file units

shapeHeight

Pad height in file units

shapeOutline / pt

Vertex list for Polygon shapes

Pad Shape Types

P-CAD Shape KiCad Mapping Notes

Oval

PAD_SHAPE::OVAL or CIRCLE if width equals height

Ellipse

PAD_SHAPE::OVAL or CIRCLE if width equals height

Treated identically to Oval

Rect

PAD_SHAPE::RECTANGLE

RndRect

PAD_SHAPE::ROUNDRECT

Polygon

PAD_SHAPE::RECTANGLE

Approximated by bounding box of vertex list

MtHole

PAD_SHAPE::CIRCLE (NPTH)

Solder mask margin derived from shape-to-hole size difference

Additional pad properties parsed from placement context:

  • padNum — pad number (integer)

  • pt — position

  • rotation — orientation in tenths of a degree

  • netNameRef — net assignment

  • defaultPinDes — default pin designator for standalone pads

Via Definitions

Standalone vias appear as via children of multiLayer. Each via references a viaStyleDef from the library by name.

The viaStyleDef contains holeDiam and one or more viaShape children. Each viaShape has layerNumRef, viaShapeType, shapeWidth, and shapeHeight. The viaShapeType values match the pad shape types listed above.

Via properties parsed from placement context:

  • viaStyleRef — references the style definition

  • pt — position

  • netNameRef — net assignment

All vias are imported as VIATYPE::THROUGH with F.Cu to B.Cu layer pair. The via diameter is taken from the first shape on F.Cu or B.Cu.

Layer Contents Objects

Objects within layerContents sections represent per-layer graphical and electrical elements. Each layerContents node carries a layerNumRef identifying its P-CAD layer.

Lines (Tracks and Drawings)

line nodes represent straight segments. On copper layers they become PCB_TRACK objects; on non-copper layers they become PCB_SHAPE segments.

(line (pt 1000 2000) (pt 3000 2000) (width 10) (netNameRef "VCC"))

Properties: two pt children (start and end), width, optional netNameRef.

Arcs

Two arc node types are supported:

triplePointArc

Defined by three pt children in order: center point, start point, end point. If start equals end, the arc is treated as a full circle (360 degrees).

arc

Defined by pt (center), radius, startAngle, and sweepAngle (both in tenths of a degree).

Both types also read a width child for stroke width. Arcs are imported as PCB_SHAPE objects with SHAPE_T::ARC (or SHAPE_T::CIRCLE for 360-degree arcs).

Text

text nodes carry a Name attribute containing the text string (with \r stripped).

(text "BOARD REV A"
  (pt 5000 1000)
  (rotation 0)
  (justify LowerLeft)
  (isFlipped False)
  (textStyleRef "Default")
)

Properties:

  • pt — position

  • rotation — angle in tenths of a degree

  • justify — alignment (LowerLeft, LowerCenter, LowerRight, UpperLeft, UpperCenter, UpperRight, Left, Center, Right)

  • isFlipped — mirror state

  • textStyleRef — references a text style for font height, stroke width, italic, bold, and TrueType properties

Polygons (pcbPoly)

pcbPoly nodes define copper polygon regions. They contain pt children forming the outline vertices and an optional netNameRef. On copper layers these are imported as KiCad ZONE objects with high priority (100000) to match P-CAD behavior where polygons do not avoid other copper pours.

On plane-type layers, pcbPoly nodes are treated as cutouts within the automatically generated plane fill polygon.

Copper Pours (copperPour95)

copperPour95 nodes represent copper fill regions with pour properties.

(copperPour95
  (netNameRef "GND")
  (width 10)
  (pourSpacing 12)
  (thermalWidth 8)
  (pcbPoly (pt 0 0) (pt 1000 0) (pt 1000 1000) (pt 0 1000))
  (island ...)
)

The outline is read from a pcbPoly child node, or from a pourOutline child in older files. The island child, if present, indicates the pour has fill data. Copper pours are converted to KiCad zones with high priority.

Cutouts (polyCutOut)

polyCutOut nodes define regions where copper is removed. They contain a pcbPoly child with outline vertices. Since KiCad does not support standalone cutout primitives, these are converted to rule areas with DoNotAllowZoneFills set to true but allowing tracks, vias, pads, and footprints.

Keepouts (polyKeepOut)

polyKeepOut nodes define restricted regions. They contain a pcbPoly child with outline vertices. These are converted to rule areas that prohibit tracks, vias, pads, and zone fills.

Keepouts appear both as children of layerContents and as direct children of multiLayer in the pcbDesign section.

Plane Objects (planeObj)

planeObj nodes represent explicit power plane polygon regions. They contain a netNameRef, width, and either a pcbPoly or planeOutline child defining the polygon vertices. These are imported as KiCad zones with low priority (1) to sit beneath signal copper pours.

Board Outline (boardOutlineObj)

boardOutlineObj nodes appear on the board layer (layerNumRef 3, mapped to Edge.Cuts). They contain an enhancedPolygon with polyPoint children defining outline vertices. Regular line segments on the board layer also contribute to the board outline.

After collecting all outline points, the importer sorts them by nearest-neighbor distance to form a connected outline polygon.

Attributes (attr)

attr nodes inside layerContents assign text style properties to footprint reference and value fields. An attr with Name="RefDes" applies font properties to the footprint’s reference designator text via textStyleRef.

Power Plane Layers

Layers with layerType set to Plane receive automatic polygon fill. For plane layers that have no explicit content (no pcbPoly, planeObj, or other objects), the importer creates a board-outline-shaped polygon zone assigned to the plane’s netNameRef net.

For plane layers that do have explicit pcbPoly content in their layerContents section, those polygons are treated as cutouts within the board-outline-shaped fill.

Layer Mapping

The importer maps P-CAD layer names and numbers to KiCad layers. The default mapping is initialized from P-CAD layer numbers 1 through 11, then updated by layerDef nodes in the file.

Default Layer Number Mapping

P-CAD Number Default KiCad Layer Type

1

F.Cu

Signal

2

B.Cu

Signal

3

Edge.Cuts

NonSignal

4

F.Mask

NonSignal

5

B.Mask

NonSignal

6

F.SilkS

NonSignal

7

B.SilkS

NonSignal

8

F.Paste

NonSignal

9

B.Paste

NonSignal

10

F.Fab

NonSignal

11

B.Fab

NonSignal

Name-Based Mapping

When layerDef nodes are processed, the importer maps by the uppercased layer name:

P-CAD Name KiCad Layer

TOP

F.Cu

BOTTOM

B.Cu

BOARD

Edge.Cuts

TOP MASK

F.Mask

BOT MASK

B.Mask

TOP SILK

F.SilkS

BOT SILK

B.SilkS

TOP PASTE

F.Paste

BOT PASTE

B.Paste

TOP ASSY

F.Fab

BOT ASSY

B.Fab

Layers not matching any known name are mapped by stackup position. Layer 1 maps to F.Cu, layer 2 maps to B.Cu, and inner layers are assigned sequentially (In1.Cu, In2.Cu, etc.) based on their position in the layersStackup. Layers that cannot be mapped at all default to Dwgs.User.

Layer Type Classification

Each layerDef declares a layerType:

Signal

Copper routing layer.

Plane

Power/ground plane layer (receives automatic fill).

NonSignal

Non-electrical layer (silkscreen, mask, assembly, etc.).

The maximum number of signal layers supported is 32.

Netlist Processing

The importer processes the netlist in three stages:

  1. Net parsing — Each net node in the netlist section is read and assigned a sequential net code starting from 1.

  2. Component pin connectivity — After all components are placed, the importer walks each net’s node entries and calls ConnectPinToNet to assign the net name to the matching pad within the matching footprint.

  3. Board net registration — All nets are registered with the KiCad BOARD object as NETINFO_ITEM entries before component objects are added.

Net names containing tilde (~) characters are converted to KiCad’s overbar syntax (~{name}) during import.

Imported Elements

  • Footprints with reference designator and value text, position, rotation, and mirror state

  • Pads with shapes (oval, ellipse, rectangle, rounded rectangle, polygon), through-hole, SMD, and NPTH types, with hole diameter and per-layer dimensions

  • Vias with style definitions, hole diameter, shape per layer, and net assignment

  • Track segments and drawing lines with width and layer assignment

  • Arcs and full circles

  • Text with font properties (height, stroke width, justification, bold, italic, mirror)

  • Copper polygons converted to KiCad zones

  • Copper pours

  • Cutouts converted to keepout rule areas

  • Keepout regions that prohibit tracks, vias, pads, and zone fills

  • Power plane layers with automatic board-outline-shaped polygon fill

  • Board outline from Edge.Cuts layer content and boardOutlineObj enhanced polygons

  • Netlist with net-to-pin connectivity

  • Layer mapping for up to 32 signal layers plus silkscreen, mask, paste, fabrication, and board outline layers

Limitations

  • Polygon-shaped pads are approximated as rectangles using the bounding box of the polygon’s vertex list.

  • All vias are imported as through-hole type; blind and buried vias are not preserved.

  • Standalone cutouts are converted to rule areas; KiCad does not support standalone cutout primitives.

  • Copper pour zones receive a high priority value (100000) because P-CAD polygons do not avoid other copper pours.

  • Board outline reconstruction uses nearest-neighbor distance sorting, which may mishandle complex or multi-contour outlines.

  • The file loader assumes Windows-1251 character encoding.

  • Design rules, clearances, and constraints from the P-CAD file are not imported.

  • Footprint library browsing is not supported; P-CAD files are board-import only.

  • Pour spacing, thermal relief width, and other copper pour parameters are parsed but not applied to the resulting KiCad zones.

  • The island fill data within copper pours is not reconstructed; KiCad re-fills zones after import.