Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
What is an Aperture File? Gerber Tool Definition Guide
When working with older Gerber formats or legacy manufacturing systems, you’ll encounter a critical companion file that defines the shapes and sizes used to create your PCB artwork. The aperture file (.apt) contains the tool definitions that tell photoplotters exactly what shapes to draw and flash—without it, your Gerber data is essentially meaningless coordinates.
This guide explains what aperture files are, how they work with Gerber data, and why understanding them matters even in modern PCB workflows.
What is an Aperture File?
An aperture file (.apt) is a text-based document that defines the shapes and sizes of tools used to create PCB images from Gerber data. In the original RS-274-D Gerber format, the main Gerber file contains only XY coordinates and command codes—the actual shape definitions live in a separate aperture file, sometimes called a “wheel file.”
Think of apertures as digital stencils. When a photoplotter receives a command to “flash D10 at coordinates X100Y200,” it needs to know what D10 actually looks like. Is it a 50-mil round pad? A 60×80-mil rectangle? A thermal relief pattern? The aperture file provides these definitions, mapping each D-code number to a specific shape and dimension.
The term “aperture” comes from the physical aperture wheels used in early vector photoplotters. These machines had rotating disks with different-shaped holes cut into them. Light would shine through the selected aperture to expose the shape onto photographic film. Modern systems are digital, but the terminology stuck.
Aperture Files vs Embedded Apertures
Understanding when you need a separate aperture file depends on which Gerber format you’re using.
Format Comparison
Gerber Format
Aperture Location
File Extension
RS-274-D (Standard Gerber)
Separate aperture file required
.apt, .apr, .rep
RS-274-X (Extended Gerber)
Embedded in Gerber file
Not needed
Gerber X2
Embedded with metadata
Not needed
RS-274-D, the original Gerber format from the 1960s, requires a separate aperture file (.apt) because the coordinate data and shape definitions are stored independently. RS-274-X, introduced in the 1980s, solved this problem by embedding aperture definitions directly within the Gerber file using special commands.
Today, most PCB software exports RS-274-X or Gerber X2 format by default, making separate aperture files unnecessary. However, you’ll still encounter .apt files when working with legacy designs, certain older manufacturing equipment, or specific CAM software that requires external aperture definitions.
Structure of an Aperture File
An aperture file is plain ASCII text listing D-code assignments and their corresponding shape definitions.
Each line assigns a D-code number to a shape type and dimensions. The file may also include header information specifying units (inches or millimeters) and other parameters.
Aperture Definition Components
Component
Description
Example
D-code
Tool number (D10-D999)
D10
Shape type
Geometric shape
ROUND, RECT
Dimensions
Size parameters
0.050, 0.080×0.040
Hole (optional)
Center hole diameter
X0.025
Standard Aperture Shapes
The Gerber format defines four standard aperture shapes that cover most PCB requirements.
Circle (C)
The most common aperture shape, used for round pads, vias, and drawing traces.
Parameter
Description
Diameter
Outer diameter of circle
Hole diameter
Optional center hole
Definition example: %ADD10C,0.050*% creates a 50-mil diameter circle.
Rectangle (R)
Used for rectangular pads, particularly for surface-mount components.
Parameter
Description
X size
Width of rectangle
Y size
Height of rectangle
Hole diameter
Optional center hole
Definition example: %ADD11R,0.060X0.040*% creates a 60×40-mil rectangle.
Obround (O)
An oval shape consisting of two semicircles connected by straight sides. Common for elongated SMD pads.
Parameter
Description
X size
Overall width
Y size
Overall height
Hole diameter
Optional center hole
Definition example: %ADD12O,0.080X0.040*% creates an obround 80 mils wide and 40 mils tall.
Polygon (P)
Regular polygons with a specified number of sides, useful for hexagonal pads or special shapes.
Parameter
Description
Outer diameter
Circle circumscribing polygon
Vertices
Number of sides (3-12)
Rotation
Angle in degrees
Hole diameter
Optional center hole
Definition example: %ADD13P,0.060X6X0.0*% creates a hexagon with 60-mil outer diameter.
D-Codes Explained
D-codes are the link between Gerber coordinate commands and aperture file definitions. Understanding how they work helps troubleshoot aperture-related problems.
D-Code Categories
D-code Range
Function
D01
Draw (pen down, shutter open)
D02
Move (pen up, shutter closed)
D03
Flash (stamp aperture at location)
D10-D999
Aperture selection
D01, D02, and D03 are operation commands that control how the photoplotter moves and exposes. D10 and higher select which aperture to use for subsequent operations.
How D-Codes Work in Gerber Files
When a Gerber file contains:
D10*X1000Y2000D03*X1500Y2000D03*
This means: select aperture D10, flash it at coordinates (1000,2000), then flash it again at (1500,2000). Without the aperture file defining what D10 looks like, the photoplotter cannot create the image.
Creating and Managing Aperture Files
Most modern PCB software handles aperture definitions automatically, but understanding the manual process helps when troubleshooting or working with legacy data.
Automatic Aperture Generation
Software
Aperture Handling
Altium Designer
Auto-generates embedded or external
KiCad
Embedded apertures in RS-274-X
Eagle
Generates with CAM processor
OrCAD/Allegro
Configurable embedded/external
When using RS-274-X format, aperture definitions are embedded within the Gerber file using AD (Aperture Definition) commands. No separate .apt file is needed.
Manual Aperture File Creation
If you must create a separate aperture file for RS-274-D compatibility:
Export your design to RS-274-D format
Note which D-codes your software assigns
Create a text file listing each D-code with shape and dimensions
Save with .apt extension
Include with your Gerber files
Aperture Matching
When using an existing aperture file (.apt) rather than generating one, the PCB software scans your PCB design primitives and attempts to match them with definitions in the loaded aperture file. If no exact match exists, the software may:
Paint the shape using a smaller aperture
Generate a .MAT (match) file listing missing apertures
Abort Gerber generation if no suitable aperture exists
Common Aperture File Problems
Aperture files are a frequent source of manufacturing issues, particularly with legacy data.
Troubleshooting Guide
Problem
Cause
Solution
Missing apertures
Aperture file not included
Include .apt with Gerbers
Wrong pad sizes
D-code mismatch
Verify aperture definitions match design
Distorted shapes
Unit mismatch
Check inch vs mm settings
Thermal gaps wrong
Incorrect thermal definition
Review thermal aperture parameters
Traces wrong width
Draw aperture incorrect
Check circle diameter for D-code
File Compatibility Issues
Issue
Description
Format variations
Different software uses different aperture file formats
Unit ambiguity
File may not specify inches or millimeters
D-code conflicts
Same D-code defined differently in multiple files
Missing file
Aperture file separated from Gerber during transfer
Aperture Macros for Complex Shapes
Beyond standard apertures, the Gerber format supports aperture macros (AM) for creating custom shapes.
Common Macro Apertures
Shape
Use Case
Thermal
Power/ground plane connections
Donut
Annular ring pads
Target
Fiducial marks
Custom polygon
Specialized pad shapes
Aperture macros are defined using a primitive-based language that combines basic shapes (circles, lines, polygons) into complex patterns. Thermal relief apertures are so common they have dedicated primitives in the macro language.
Thermal Relief Example
A thermal relief connects a pad to a copper pour while providing thermal isolation for easier soldering:
This creates a thermal with outer diameter 0.080, inner diameter 0.040, and four 0.010-wide spokes.
Modern Alternatives to Separate Aperture Files
While aperture files (.apt) remain relevant for legacy compatibility, modern workflows have largely moved beyond them.
Embedded Apertures (RS-274-X)
The RS-274-X format embeds aperture definitions using AD commands within the Gerber file:
%ADD10C,0.050*%%ADD11R,0.060X0.040*%
This eliminates the need for separate files and prevents aperture/Gerber mismatches.
Gerber X2 Attributes
Gerber X2 adds metadata attributes that describe what each aperture represents (pad, via, conductor) in addition to its shape. This provides manufacturing intelligence beyond pure geometry.
IPC-2581 and ODB++
These newer formats include aperture-equivalent information in structured databases, eliminating the ambiguity issues that plagued separate aperture files.
Format
Aperture Handling
IPC-2581
Pad definitions in XML
ODB++
Feature definitions in structured files
Best Practices for Aperture Files
When working with aperture files, follow these guidelines to avoid manufacturing problems.
Export Recommendations
Recommendation
Reason
Use RS-274-X when possible
Eliminates separate aperture file
Include units in aperture file
Prevents inch/mm confusion
Keep aperture file with Gerbers
Prevents separation during transfer
Verify D-code assignments
Ensures apertures match design
Don’t modify auto-generated files
Maintains consistency
Verification Steps
Load Gerber and aperture files in viewer together
Verify pad sizes match design intent
Check trace widths are correct
Confirm thermal reliefs appear properly
Compare against your PCB design software’s preview
Useful Resources for Aperture Files
Documentation
Resource
Description
Ucamco Gerber Specification
Official format documentation
RS-274-X User’s Guide
Extended Gerber format details
IPC-2581 Standard
Modern CAD-to-CAM format
Software Tools
Tool
Function
GC-Prevue
Professional CAM viewer
Gerbv
Free open-source viewer
ViewMate
Free Gerber viewer
CAM350
Industry CAM software
Downloads
Resource
URL
Gerber Format Specification
ucamco.com/gerber
Gerbv Viewer
gerbv.github.io
ViewMate
pentalogix.com
Frequently Asked Questions About Aperture Files
Do I need an aperture file with modern Gerber files?
If your software exports RS-274-X or Gerber X2 format (most modern tools do), aperture definitions are embedded within the Gerber file itself. No separate aperture file (.apt) is required. However, if you’re working with RS-274-D format or legacy equipment, you’ll need to include the aperture file with your Gerber data.
What happens if my aperture file is missing?
Without an aperture file, RS-274-D Gerber data contains only coordinates and D-code references—the actual shapes are undefined. The manufacturing equipment cannot create the PCB image. Most Gerber viewers will show just dots or lines at coordinate locations without proper shape representation. Always verify your aperture file is included when submitting RS-274-D data.
Why do my pads appear the wrong size in the Gerber viewer?
This typically indicates a mismatch between the aperture file and Gerber data, or a unit discrepancy. Check that your aperture file uses the same units (inches or millimeters) as your Gerber coordinates. Also verify that D-code assignments in the aperture file match those used in the Gerber data—a common problem when mixing files from different design revisions.
Can I edit an aperture file manually?
Yes, aperture files are plain text and can be edited with any text editor. However, manual editing is risky—incorrect aperture dimensions directly affect your manufactured board. If you must edit, carefully verify units, D-code assignments, and dimensions. Test by viewing the modified files in a Gerber viewer before sending to manufacturing.
Should I use embedded or separate apertures?
Use embedded apertures (RS-274-X format) whenever your manufacturer supports them—virtually all modern facilities do. Embedded apertures eliminate the risk of aperture file separation or mismatch. Only use separate aperture files (.apt) when required for legacy equipment compatibility or when your manufacturer specifically requests RS-274-D format.
Conclusion
The aperture file (.apt) is a legacy but still relevant component of PCB manufacturing data. While modern RS-274-X and Gerber X2 formats have largely eliminated the need for separate aperture definitions, understanding how apertures work—as D-code mapped shape definitions—helps troubleshoot Gerber issues and work with older designs.
When possible, use embedded apertures through RS-274-X export. When separate aperture files are required, keep them paired with their Gerber data, verify unit consistency, and always check your output in a Gerber viewer before sending to manufacturing. The few minutes spent verifying aperture definitions can save days of manufacturing delays from incorrect pad sizes or missing shapes.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.