- moved back the ApertureMacro class to camlib for now and made some import changes in the new ParseGerber and ParseExcellon classes
- some changes to the tests - perhaps I will try adding a few tests in the future
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class MyObj():
|
||||
@@ -16,12 +16,12 @@ def parse():
|
||||
raise Exception("Intentional Exception")
|
||||
|
||||
|
||||
class Example(QtGui.QWidget):
|
||||
class Example(QtWidgets.QWidget):
|
||||
|
||||
def __init__(self):
|
||||
super(Example, self).__init__()
|
||||
|
||||
qbtn = QtGui.QPushButton('Raise', self)
|
||||
qbtn = QtWidgets.QPushButton('Raise', self)
|
||||
qbtn.clicked.connect(parse)
|
||||
|
||||
self.setWindowTitle('Quit button')
|
||||
@@ -29,6 +29,6 @@ class Example(QtGui.QWidget):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QtGui.QApplication(sys.argv)
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
ex = Example()
|
||||
sys.exit(app.exec_())
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
os.chdir('../')
|
||||
|
||||
from camlib import *
|
||||
from flatcamParsers.ParseGerber import *
|
||||
|
||||
g = Gerber()
|
||||
g.parse_file(r'C:\Users\jpcaram\Dropbox\CNC\pcbcam\test_files\PlacaReles-F_Cu.gtl')
|
||||
|
||||
@@ -8,12 +8,13 @@ Created on Sun Jan 05 13:30:47 2014
|
||||
import os
|
||||
os.chdir('../')
|
||||
|
||||
from camlib import *
|
||||
#from matplotlib.figure import Figure
|
||||
from flatcamParsers.ParseGerber import *
|
||||
from flatcamParsers.ParseExcellon import *
|
||||
|
||||
from matplotlib import pyplot
|
||||
|
||||
# Gerber. To see if the Excellon is correct
|
||||
project_dir = "tests/"
|
||||
project_dir = "tests/gerber_files"
|
||||
gerber_filename = project_dir + "KiCad_Squarer-F_Cu.gtl"
|
||||
g = Gerber()
|
||||
g.parse_file(gerber_filename)
|
||||
@@ -32,7 +33,7 @@ ax.set_aspect(1)
|
||||
# Plot gerber
|
||||
for geo in g.solid_geometry:
|
||||
x, y = geo.exterior.coords.xy
|
||||
plot(x, y, 'k-')
|
||||
pyplot.plot(x, y, 'k-')
|
||||
for ints in geo.interiors:
|
||||
x, y = ints.coords.xy
|
||||
ax.plot(x, y, 'k-')
|
||||
@@ -40,7 +41,7 @@ for geo in g.solid_geometry:
|
||||
# Plot excellon
|
||||
for geo in ex.solid_geometry:
|
||||
x, y = geo.exterior.coords.xy
|
||||
plot(x, y, 'r-')
|
||||
pyplot.plot(x, y, 'r-')
|
||||
for ints in geo.interiors:
|
||||
x, y = ints.coords.xy
|
||||
ax.plot(x, y, 'g-')
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from shapely.geometry import LineString, Polygon
|
||||
from shapely.ops import cascaded_union, unary_union
|
||||
from matplotlib.pyplot import plot, subplot, show
|
||||
from matplotlib.pyplot import plot, subplot, show, axes
|
||||
from matplotlib.axes import *
|
||||
from camlib import *
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user