operations — Cam File operations

The operations module provides functions which modify gerber.cam.CamFile objects. All of the functions in this module return a modified copy of the supplied file.

Functions

The operations module defines the following functions:

to_inch(cam_file)

Convert Gerber or Excellon file units to imperial

Parameters:

cam_file : gerber.cam.CamFile subclass

Gerber or Excellon file to convert

Returns:

cam_file : gerber.cam.CamFile subclass

A deep copy of the source file with units converted to imperial.

to_metric(cam_file)

Convert Gerber or Excellon file units to metric

Parameters:

cam_file : gerber.cam.CamFile subclass

Gerber or Excellon file to convert

Returns:

cam_file : gerber.cam.CamFile subclass

A deep copy of the source file with units converted to metric.

offset(cam_file, x_offset, y_offset)

Offset a Cam file by a specified amount in the X and Y directions.

Parameters:

cam_file : gerber.cam.CamFile subclass

Gerber or Excellon file to offset

x_offset : float

Amount to offset the file in the X direction

y_offset : float

Amount to offset the file in the Y direction

Returns:

cam_file : gerber.cam.CamFile subclass

An offset deep copy of the source file.