Commit 62a21957 authored by sumpfralle's avatar sumpfralle

simplified the PolygonCutter code


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@167 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 90a0fe85
...@@ -26,29 +26,21 @@ class PolygonCutter: ...@@ -26,29 +26,21 @@ class PolygonCutter:
def finish(self): def finish(self):
self.pe.finish() self.pe.finish()
paths = [] paths = []
source_paths = []
if self.pe.hor_path_list: if self.pe.hor_path_list:
for path in self.pe.hor_path_list: source_paths.extend(self.pe.hor_path_list)
points = path.points
for i in range(0, (len(points)+1)/2):
p = Path()
if i % 2 == 0:
p.append(points[i])
p.append(points[-i-1])
else:
p.append(points[-i-1])
p.append(points[i])
paths.append(p)
if self.pe.ver_path_list: if self.pe.ver_path_list:
for path in self.pe.ver_path_list: source_paths.extend(self.pe.ver_path_list)
points = path.points for path in source_paths:
for i in range(0, (len(points)+1)/2): points = path.points
p = Path() for i in range(0, (len(points)+1)/2):
if i % 2 == 0: p = Path()
p.append(points[i]) if i % 2 == 0:
p.append(points[-i-1]) p.append(points[i])
else: p.append(points[-i-1])
p.append(points[-i-1]) else:
p.append(points[i]) p.append(points[-i-1])
paths.append(p) p.append(points[i])
paths.append(p)
self.paths = paths self.paths = paths
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