I believe that the File Format section of the documentation is out of
date.  Attached is a patch that updates the parts that I know about and
adds an entirely new section that delves into more detail about the
Thickness, Clearance and Mask parameters.

I think that Via should have Thickness and Mask parameters just as Pin
does but I wasn't sure.  If this is the case only, an additional trivial
addition is necessary.

Thanks,
David Carr
--- pcb/doc/pcb.texi    2005-01-28 18:59:08.000000000 -0600
+++ pcb.new/doc/pcb.texi        2005-06-19 20:03:03.000000000 -0500
@@ -31,7 +31,9 @@
 
 Copyright (C) 2003, 2004 Dan McMahill
 
-Copyright (C) 2004 DJ Delorie
+Copyright (C) 2004, DJ Delorie
+
+Copyright (C) 2005, David Carr
 
 This program is free software; you may redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -86,10 +88,29 @@
 @c ---------------------------------------------------------------------
 @node Copying, History, Top, Top
 @unnumbered Copying
+
[EMAIL PROTECTED]
 Copyright @copyright{} 1994,1995,1996,1997 Thomas Nau
 
[EMAIL PROTECTED]
 Copyright @copyright{} 1998,1999,2000,2001,2002 harry eaton
 
[EMAIL PROTECTED]
+Copyright @copyright{}  1994,1995,1996, 2004 Thomas Nau
+
[EMAIL PROTECTED]
+Copyright @copyright{}  1997, 1998, 1999, 2000, 2001, 2002 harry eaton
+
[EMAIL PROTECTED]
+Copyright @copyright{}  2003, 2004 Dan McMahill
+
[EMAIL PROTECTED]
+Copyright @copyright{}  2004, DJ Delorie
+
[EMAIL PROTECTED]
+Copyright @copyright{}  2005, David Carr
+
+
 This program is free software; you may redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -4206,6 +4227,7 @@
 chapter.
 
 @example
+Clearance       = Number
 Description     = Name
 DeltaAngle      = Number
 DrillingHole    = Number
@@ -4221,6 +4243,9 @@
 Height          = Number
 LayerNumber     = Number
 LayoutName      = Name
+Mask            = Number
+MarkX           = Number
+MarkY           = Number
 Name            = quoted_string
 Number          = decimal | hex
 PinNumber      = quoted_string
@@ -4281,15 +4306,15 @@
 Via             = "Via(" X Y Thickness DrillingHole Name Flags ")"
 
 Element         = "Element(" Flags Description LayoutName Value \
-                     TextX TextY direction scale TextFlags")"
+                     MarkX MarkY TextX TextY direction scale TextFlags")"
                      "(" @[EMAIL PROTECTED] [Mark] ")"
 ElementData     = @{ElementLine | Pad | Pin | ElementArc @}...
 ElementArc      = "ElementArc(" X Y Width Height
                      StartAngle DeltaAngle Thickness ")"
 ElementLine     = "ElementLine(" X1 Y1 X2 Y2 Thickness ")"
 Mark            = "Mark(" X Y ")"
-Pad             = "Pad(" X1 Y1 X2 Y2 Thickness Name PinNumber Flags")"
-Pin             = "Pin(" X Y Thickness DrillingHole Name PinNumber Flags ")"
+Pad             = "Pad(" X1 Y1 X2 Y2 Thickness Clearance Mask Name PinNumber 
Flags")"
+Pin             = "Pin(" X Y Thickness Clearance Mask DrillingHole Name 
PinNumber Flags ")"
 
 Layer           = "Layer(" LayerNumber Name ")"
                      "(" @[EMAIL PROTECTED] ")"
@@ -4422,15 +4447,15 @@
 @example
 File            = @[EMAIL PROTECTED]
 Element         = "Element(" Flags Description LayoutName Value \
-                     TextX TextY direction scale TextFlags")"
+                     MarkX MarkY TextX TextY direction scale TextFlags")"
                      "(" @[EMAIL PROTECTED] [Mark] ")"
 ElementData     = @{ElementLine | Pad | Pin | ElementArc @}...
 ElementArc      = "ElementArc(" X Y Width Height
                      StartAngle DeltaAngle Thickness ")"
 ElementLine     = "ElementLine(" X1 Y1 X2 Y2 Thickness ")"
 Mark            = "Mark(" X Y ")"
-Pad             = "Pad(" X1 Y1 X2 Y2 Thickness Name PinNumber Flags ")"
-Pin             = "Pin(" X Y Thickness DrillingHole Name PinNumber Flags ")"
+Pad             = "Pad(" X1 Y1 X2 Y2 Thickness Clearance Mask Name PinNumber 
Flags ")"
+Pin             = "Pin(" X Y Thickness Clearance Mask DrillingHole Name 
PinNumber Flags ")"
 @end example
 
 @table @samp
@@ -4497,6 +4522,85 @@
 
 @end table
 
[EMAIL PROTECTED]
[EMAIL PROTECTED] Note about Thickness, Clearance and Mask:}
+
+Many of objects that appear in PCB Layout and Element files contain
+one or more of the parameters Thickness, Clearance and Mask.  These
+parameters respectively refer to the width of line-derived object, the
+spacing between an object and any neighboring polygons and finally the
+width of soldermask relief surronding an object.  While these definitions
+may seem relatively straightforward, PCB's representation of these concepts
+makes determining the appropriate value for these parameters rather more
+difficult.
+
+Pads are line-based objects, meaning that a Pad is represented by
+a line segment between points (X1, Y1) and (X2, Y2) that has a width
+given by the Thickness parameter.  
+
+Recall that Pads take the following form:
[EMAIL PROTECTED]
+Pad( X1 Y1 X2 Y2 Thickness Clearance Mask Name PinNumber Flags )
[EMAIL PROTECTED] example
+
+Say that we wish to define a SMD pad that is 30mils long and is 10mils
+wide.  Furthermore, we want 4mils of soldermask relief and 15mils of
+clearance between our pad and any neighboring polygons.  
+
+Something like this seems appropriate:
[EMAIL PROTECTED]
+Pad( -15 0 15 0 10 15 4 "Test Pad" "1" 0x00000100 )
[EMAIL PROTECTED] example
+
+Unfourtunately, this intuitive Pad definition doesn't produce the
+desired result at all.  Instead of a Pad 30mils long and 10 mils long,
+we'll get a Pad that is 40 mils long and 10 mils wide.  The soldermask
+will overlap the pad by 3mils on each side and neighboring polygons
+will only have 7.5mils clearance.
+
+All of the above problems stem from three misconceptions.  Firstly, we
+assumed that a pad of length 30mils and width 10mils is represented by
+a line with endpoints 30mils apart and with a thickness of 10mils.
+This assumption is half correct; a pad of width 10mils is represented
+by a line 10mils wide.  However, if a pad of width 10mils is to be 
+30mils long, it's underlying line needs to be only 20mils long.  This
+number seems odd because so far we've only taken thickness into
+account in one dimension.  In PCB, a line's thickness not only affects
+its width but also its overall length---a line extends (Thickness/2)
+past its endpoints in either direction.  In other words, the a line's
+total length is the distance between its endpoints plus its Thickness.
+
+The second misconception is closely related to the first.  In the
+example, we assumed that if we wanted 4mils of clearance between the
+edge of pad and the soldermask, then the Mask [clearance] would simply
+be 4mils.  However, instead of 4mils relief we got 3mils of overlap.
+Once again, the problem is related to the Thickness parameter.  The
+Mask parameter specifies the thickness of the region around our pad
+that the soldermask must not enter.  To get 4mils of relief between
+the edge of the pad and the soldermask, Mask must be set to the sum of
+the pad's Thickness and twice our desired soldermask clearance from
+the edge, ie:
+
[EMAIL PROTECTED]
+Mask = Thickness(10mils) + 2*4mils = 10mils + 8mils = 18mils.
+
+Our last problem is a simple one.  The clearance between neighboring
+polygons and the edge of our pad was only 7.5mils but we wanted
+15mils.  The issue here is that the Clearance parameter specifies the sum
+of the distances between the pad edge and the polygon on both sides of
+the pad.  So, to get 15mils on each side we have to multiply our
+clearance for each side by two:
+
[EMAIL PROTECTED]
+Clearance = 2*(clearance per side) = 2*15mils = 30mils
+
+To finish up, we'll take these new factors into account and fix our
+previous example.  If we want a Pad 30mils long, 10mils wide, with
+15mils of polygon clearance per side, and 4mils of soldermask relief,
+then this should do it:
[EMAIL PROTECTED]
+Pad( -10 0 10 0 10 30 18 "Test Pad" "1" 0x00000100 )
[EMAIL PROTECTED] example
 
 @node Font File, Netlist File, Element File, File Formats
 @cindex font file, format of
@@ -4534,6 +4638,8 @@
 
 @end table
 
+
+
 @node Netlist File, Library Contents File, Font File, File Formats
 @cindex netlist, file format
 @cindex netlist, reading

Reply via email to