From 6aa1c0567d298dc14fa4ac51fd430d329f95d920 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Wed, 18 Dec 2013 02:57:11 -0200 Subject: Make gerber package --- gerber/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 gerber/__init__.py (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py new file mode 100644 index 0000000..e69de29 -- cgit From 7ee1866b607f5a7227c0fb949fd909f49c1b6334 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Wed, 5 Feb 2014 00:34:57 +0100 Subject: N w modular organization. * parser and render separeted on its own modules. * svn made optional. * PEP-8 compiant. --- gerber/__init__.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index e69de29..0bf7c24 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -0,0 +1,16 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright 2013-2014 Paulo Henrique Silva + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -- cgit From 3a5dbcf1e13704b7352d5fb3c4777d7df3fed081 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Sun, 28 Sep 2014 21:17:13 -0400 Subject: added ExcellonFile class --- gerber/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index 0bf7c24..089d7b6 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -14,3 +14,18 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + + +def read(filename): + """ Read a gerber or excellon file and return a representative object. + """ + import gerber + import excellon + from utils import detect_file_format + fmt = detect_file_format(filename) + if fmt == 'rs274x': + return gerber.read(filename) + elif fmt == 'excellon': + return excellon.read(filename) + else: + return None -- cgit From f8449ad2b60b8a715d0867325e257a8297193b49 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Tue, 30 Sep 2014 23:42:02 -0400 Subject: tests update --- gerber/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index 089d7b6..e31bd6f 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -18,6 +18,17 @@ def read(filename): """ Read a gerber or excellon file and return a representative object. + + Parameters + ---------- + filename : string + Filename of the file to read. + + Returns + ------- + file : CncFile subclass + CncFile object representing the file, either GerberFile or + ExcellonFile. Returns None if file is not an Excellon or Gerber file. """ import gerber import excellon -- cgit From 0b8e2e4b8b552e90d55eabe39aefba0b5b3daef5 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Wed, 1 Oct 2014 14:39:32 -0400 Subject: added numpydoc --- gerber/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index e31bd6f..3197335 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -14,7 +14,12 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +""" +gerber module +============ +**Gerber Tools** +""" def read(filename): """ Read a gerber or excellon file and return a representative object. -- cgit From 1653ae5cbe88757e453bccf499dc1b8ccb278e58 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Wed, 8 Oct 2014 09:27:52 -0400 Subject: Update readme and example --- gerber/__init__.py | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index 3197335..4637713 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -21,27 +21,3 @@ gerber module """ -def read(filename): - """ Read a gerber or excellon file and return a representative object. - - Parameters - ---------- - filename : string - Filename of the file to read. - - Returns - ------- - file : CncFile subclass - CncFile object representing the file, either GerberFile or - ExcellonFile. Returns None if file is not an Excellon or Gerber file. - """ - import gerber - import excellon - from utils import detect_file_format - fmt = detect_file_format(filename) - if fmt == 'rs274x': - return gerber.read(filename) - elif fmt == 'excellon': - return excellon.read(filename) - else: - return None -- cgit From f2f411493ea303075d5dbdd7656c572dda61cf67 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Thu, 9 Oct 2014 22:10:28 -0400 Subject: doc update --- gerber/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index 4637713..fce6483 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -15,9 +15,11 @@ # See the License for the specific language governing permissions and # limitations under the License. """ -gerber module +Gerber Tools ============ **Gerber Tools** +gerber-tools provides utilities for working with Gerber (RS-274X) and Excellon +files in python. """ -- cgit From 18e3b87625ddb739faeddffcaed48e12db6c7e8b Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Sun, 19 Oct 2014 22:23:00 -0400 Subject: Test update --- gerber/__init__.py | 1 + 1 file changed, 1 insertion(+) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index fce6483..1a11159 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -23,3 +23,4 @@ gerber-tools provides utilities for working with Gerber (RS-274X) and Excellon files in python. """ +from .common import read \ No newline at end of file -- cgit From dd63b169f177389602e17bc6ced53bd0f1ba0de3 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Sat, 10 Oct 2015 16:51:21 -0400 Subject: Allow files to be read from strings per #37 Adds a loads() method to the top level module which generates a GerberFile or ExcellonFile from a string --- gerber/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index 1a11159..b5a9014 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -23,4 +23,4 @@ gerber-tools provides utilities for working with Gerber (RS-274X) and Excellon files in python. """ -from .common import read \ No newline at end of file +from .common import read, loads \ No newline at end of file -- cgit From 6f876edd09d9b81649691e529f85653f14b8fd1c Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Tue, 22 Dec 2015 02:45:48 -0500 Subject: Add PCB interface this incorporates some of @chintal's layers.py changes PCB.from_directory() simplifies loading of multiple gerbers the PCB() class should be pretty helpful going forward... the context classes could use some cleaning up, although I'd like to wait until the freecad stuff gets merged, that way we can try to refactor the context base to support more use cases --- gerber/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index b5a9014..5cfdad7 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -23,4 +23,5 @@ gerber-tools provides utilities for working with Gerber (RS-274X) and Excellon files in python. """ -from .common import read, loads \ No newline at end of file +from .common import read, loads +from .pcb import PCB -- cgit From 5df38c014fd09792995b2b12b1982c535c962c9a Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Thu, 28 Jan 2016 12:19:03 -0500 Subject: Cleanup, rendering fixes. fixed rendering of tented vias fixed rendering of semi-transparent layers fixed file type detection issues added some examples --- gerber/__init__.py | 1 + 1 file changed, 1 insertion(+) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index 5cfdad7..1faba53 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -24,4 +24,5 @@ files in python. """ from .common import read, loads +from .layers import load_layer, load_layer_data from .pcb import PCB -- cgit