Commit 93ba4797 authored by sumpfralle's avatar sumpfralle

fixed some code-style issues


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@490 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent b1ff9172
......@@ -20,8 +20,7 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
from pycam.Geometry import *
from pycam.Geometry.PolygonExtractor import *
from pycam.Geometry.PolygonExtractor import PolygonExtractor
class ContourCutter:
def __init__(self):
......@@ -34,11 +33,11 @@ class ContourCutter:
def append(self, p):
self.points.append(p)
def new_direction(self, dir):
def new_direction(self, direction):
if self.pe == None:
self.pe = PolygonExtractor(PolygonExtractor.CONTOUR)
self.pe.new_direction(dir)
self.pe.new_direction(direction)
def end_direction(self):
self.pe.end_direction()
......
......@@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
from pycam.Geometry import *
from pycam.Geometry import Path
def _check_colinearity(p1, p2, p3):
v1 = p2.sub(p1)
......@@ -36,18 +36,20 @@ class PathAccumulator:
self.paths = []
self.curr_path = None
self.zigzag = zigzag
self.scanline = None
def append(self, p):
if self.curr_path == None:
self.curr_path = Path()
if (len(self.curr_path.points) >= 2) and \
(_check_colinearity(self.curr_path.points[-2], self.curr_path.points[-1], p)):
(_check_colinearity(self.curr_path.points[-2],
self.curr_path.points[-1], p)):
# remove the previous point since it is in line with its
# predecessor and the new point
self.curr_path.points.pop()
self.curr_path.append(p)
def new_direction(self, dir):
def new_direction(self, direction):
self.scanline = 0
def end_direction(self):
......
......@@ -21,8 +21,9 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
from pycam.Geometry import *
from pycam.Geometry.PolygonExtractor import *
from pycam.Geometry import Path
from pycam.Geometry.PolygonExtractor import PolygonExtractor
class PolygonCutter:
def __init__(self):
......@@ -34,8 +35,8 @@ class PolygonCutter:
def append(self, p):
self.pe.append(p)
def new_direction(self, dir):
self.pe.new_direction(dir)
def new_direction(self, direction):
self.pe.new_direction(direction)
def end_direction(self):
self.pe.end_direction()
......
......@@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
from pycam.Geometry import *
from pycam.Geometry import Path
class SimpleCutter:
def __init__(self):
......@@ -39,7 +39,7 @@ class SimpleCutter:
if self.curr_path == None:
self.paths.append(curr_path)
def new_direction(self, dir):
def new_direction(self, direction):
pass
def end_direction(self):
......
......@@ -20,13 +20,14 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
from pycam.Geometry import *
from pycam.Geometry import Path
class ZigZagCutter:
def __init__(self):
self.paths = []
self.curr_path = None
self.scanline = None
self.curr_scanline = None
def append(self, p):
curr_path = None
......@@ -46,7 +47,7 @@ class ZigZagCutter:
curr_path.reverse()
self.curr_scanline.insert(0, curr_path)
def new_direction(self, dir):
def new_direction(self, direction):
self.scanline = 0
def end_direction(self):
......
......@@ -20,13 +20,12 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
list = ["PathAccumulator", "SimpleCutter", "ZigZagCutter", "PolygonCutter", "ContourCutter"]
__all__ = list
from PathAccumulator import PathAccumulator
from SimpleCutter import SimpleCutter
from ZigZagCutter import ZigZagCutter
from PolygonCutter import PolygonCutter
from ContourCutter import ContourCutter
__all__ = ["PathAccumulator", "SimpleCutter", "ZigZagCutter", "PolygonCutter",
"ContourCutter"]
from pycam.PathProcessors.PathAccumulator import PathAccumulator
from pycam.PathProcessors.SimpleCutter import SimpleCutter
from pycam.PathProcessors.ZigZagCutter import ZigZagCutter
from pycam.PathProcessors.PolygonCutter import PolygonCutter
from pycam.PathProcessors.ContourCutter import ContourCutter
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment