From 4db7302485e65937463c2efe3b3c2945549ca588 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Wed, 18 Feb 2015 23:23:53 -0500 Subject: Doc update --- doc/source/documentation/index.rst | 2 +- doc/source/documentation/operations.rst | 24 ++++++++++++++++++++++++ doc/source/features.rst | 6 +++--- gerber/operations.py | 20 ++++++++++---------- 4 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 doc/source/documentation/operations.rst diff --git a/doc/source/documentation/index.rst b/doc/source/documentation/index.rst index 28ecb99..dec83f9 100644 --- a/doc/source/documentation/index.rst +++ b/doc/source/documentation/index.rst @@ -6,5 +6,5 @@ PCB Tools Reference Gerber (RS-274X) Files Excellon Files + Operations Rendering - \ No newline at end of file diff --git a/doc/source/documentation/operations.rst b/doc/source/documentation/operations.rst new file mode 100644 index 0000000..6551236 --- /dev/null +++ b/doc/source/documentation/operations.rst @@ -0,0 +1,24 @@ +:mod:`operations` --- Cam File operations +========================================= + +.. module:: operations + :synopsis: Functions for modifying CAM files +.. sectionauthor:: Hamilton Kibbe + + +The :mod:`operations` module provides functions which modify +:class:`gerber.cam.CamFile` objects. All of the functions in this module +return a modified copy of the supplied file. + +.. _operations-contents: + +Functions +--------- +The :mod:`operations` module defines the following functions: + +.. autofunction:: gerber.operations.to_inch +.. autofunction:: gerber.operations.to_metric +.. autofunction:: gerber.operations.offset + + + diff --git a/doc/source/features.rst b/doc/source/features.rst index 120fdcd..67d9e2a 100644 --- a/doc/source/features.rst +++ b/doc/source/features.rst @@ -3,11 +3,11 @@ Feature Suppport Currently supported features are as follows: -============ ======== =========== ================ ====== ======= ======= +============ ======== =========== ================ ====== ======= ======= File Format Parsing Rendering Unit Conversion Scale Offset Rotate ============ ======== =========== ================ ====== ======= ======= -RS274-X Yes Yes Yes No No No -Excellon Yes Yes Yes No No No +RS274-X Yes Yes Yes No Yes No +Excellon Yes Yes Yes No Yes No ODB++ No No No No No No ============ ======== =========== ================ ====== ======= ======= diff --git a/gerber/operations.py b/gerber/operations.py index 50df738..4eb10e5 100644 --- a/gerber/operations.py +++ b/gerber/operations.py @@ -27,12 +27,12 @@ def to_inch(cam_file): Parameters ---------- - cam_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass Gerber or Excellon file to convert Returns ------- - gerber_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass A deep copy of the source file with units converted to imperial. """ cam_file = copy.deepcopy(cam_file) @@ -44,12 +44,12 @@ def to_metric(cam_file): Parameters ---------- - cam_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass Gerber or Excellon file to convert Returns ------- - gerber_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass A deep copy of the source file with units converted to metric. """ cam_file = copy.deepcopy(cam_file) @@ -61,7 +61,7 @@ def offset(cam_file, x_offset, y_offset): Parameters ---------- - cam_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass Gerber or Excellon file to offset x_offset : float @@ -72,7 +72,7 @@ def offset(cam_file, x_offset, y_offset): Returns ------- - gerber_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass An offset deep copy of the source file. """ cam_file = copy.deepcopy(cam_file) @@ -84,7 +84,7 @@ def scale(cam_file, x_scale, y_scale): Parameters ---------- - cam_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass Gerber or Excellon file to scale x_scale : float @@ -95,7 +95,7 @@ def scale(cam_file, x_scale, y_scale): Returns ------- - gerber_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass An scaled deep copy of the source file. """ # TODO @@ -106,7 +106,7 @@ def rotate(cam_file, angle): Parameters ---------- - cam_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass Gerber or Excellon file to rotate angle : float @@ -114,7 +114,7 @@ def rotate(cam_file, angle): Returns ------- - gerber_file : `gerber.cam.CamFile` subclass + cam_file : :class:`gerber.cam.CamFile` subclass An rotated deep copy of the source file. """ # TODO -- cgit