Copyright Ucamco NV 18
Having a question or remark about the spec? Please contact us at gerber@ucamco.com
2.8 Blocks
A block is a substream of graphics objects that can be added one or more times to the final
graphics objects stream. Blocks can be mirrored, rotated, scaled, shifted and its polarity can be
toggled. By using blocks sub-images that occur multiple times must only be defined once, thus
slashing file size, boosting processing speed and preserving the information that these sub-
images are identical.
A block is not a macro of commands called repeatedly in the command stream. The command
stream is processed sequentially, in one pass, without procedure or macro calls. Gerber is not a
programming language.
Blocks can contain objects with different polarities (LPD and LPC). Blocks can overlap.
The origin of the block is the (0, 0) point of the file coordinate space.
Once a block is added to the graphics objects stream its objects becomes part of the overall
stream. The effect of these objects does not depend on whether they were part of a block or not.
Only their order is important. A clear object in a block clears all objects beneath it, not only the
objects not contained in the block.
There are two commands to create a block: SR and AB.
2.9 Attributes
Attributes add meta-information to a Gerber file. These are akin to labels providing additional
information about the file or features within. Examples of such meta-information are:
The function of the file: is it the top solder mask, or the bottom copper layer etc.
The function of a pad: is the pad a component pad, or a via pad, or a fiducial, etc.
Example:
This command defines an attribute indicating the file represents the top solder mask.
%TF.FileFunction,Soldermask,Top*%
Attributes do not affect the image. A Gerber reader will generate the correct image even if it
ignores the attributes.
Attributes can be attached to objects, apertures or to the complete file.
The attribute syntax provides a flexible and standardized way to add meta-information to the
images, independent of the specific semantics or application.
Attributes are needed when PCB data is transferred from design to fabrication. The PCB
fabricator needs more than just the image: for example, he needs to know what are the via pads
to manufacture the solder mask. The attributes transfer the design intent from CAD to CAM in
an unequivocal and standardized manner. This is sometimes rather grandly called “adding
intelligence to the image”. Without these attributes the fabricator must reverse engineer the
design intent of the features in the file, which is a time-consuming and error-prone process.
Attributes are described in detail in the chapter 5.