コード例 #1
0
ファイル: PolygonCutter.py プロジェクト: I--Fox--I/pycam
 def finish(self):
     self.polygon_extractor.finish()
     paths = []
     source_paths = []
     if self.polygon_extractor.hor_path_list:
         source_paths.extend(self.polygon_extractor.hor_path_list)
     if self.polygon_extractor.ver_path_list:
         source_paths.extend(self.polygon_extractor.ver_path_list)
     for path in source_paths:
         points = path.points
         for i in range(0, (len(points)+1)/2):
             new_path = Path()
             if i % 2 == 0:
                 new_path.append(points[i])
                 new_path.append(points[-i-1])
             else:
                 new_path.append(points[-i-1])
                 new_path.append(points[i])
             paths.append(new_path)
     if paths:
         for path in paths:
             simplify_toolpath(path)
             if self.reverse:
                 path.reverse()
         self.paths.extend(paths)
         self.sort_layered()
コード例 #2
0
 def end_scanline(self):
     for path in self.curr_scanline:
         simplify_toolpath(path)
         if self.reverse:
             path.reverse()
         self.paths.append(path)
     self.curr_scanline = None
コード例 #3
0
ファイル: PolygonCutter.py プロジェクト: yummyburger/pycam
 def finish(self):
     self.polygon_extractor.finish()
     paths = []
     source_paths = []
     if self.polygon_extractor.hor_path_list:
         source_paths.extend(self.polygon_extractor.hor_path_list)
     if self.polygon_extractor.ver_path_list:
         source_paths.extend(self.polygon_extractor.ver_path_list)
     for path in source_paths:
         points = path.points
         for i in range((len(points) + 1) // 2):
             new_path = Path()
             if i % 2 == 0:
                 new_path.append(points[i])
                 new_path.append(points[-i-1])
             else:
                 new_path.append(points[-i-1])
                 new_path.append(points[i])
             paths.append(new_path)
     if paths:
         for path in paths:
             simplify_toolpath(path)
             if self.reverse:
                 path.reverse()
         self.paths.extend(paths)
         self.sort_layered()
コード例 #4
0
ファイル: ZigZagCutter.py プロジェクト: weeberp/MakerDroid
 def end_scanline(self):
     for path in self.curr_scanline:
         simplify_toolpath(path)
         if self.reverse:
             path.reverse()
         self.paths.append(path)
     self.curr_scanline = None
コード例 #5
0
 def end_scanline(self):
     if self.curr_path:
         if self.zigzag and (self.scanline % 2 == 0):
             self.curr_path.reverse()
         simplify_toolpath(self.curr_path)
         if self.reverse:
             self.paths.insert(0, self.curr_path)
         else:
             self.paths.append(self.curr_path)
         self.curr_path = None
コード例 #6
0
ファイル: SimpleCutter.py プロジェクト: weeberp/MakerDroid
 def append(self, point):
     curr_path = None
     if self.curr_path == None:
         curr_path = Path()
         self.curr_path = curr_path
     else:
         curr_path = self.curr_path
         self.curr_path = None
     curr_path.append(point)
     if self.curr_path == None:
         simplify_toolpath(curr_path)
         if self.reverse:
             curr_path.reverse()
             self.paths.insert(0, curr_path)
         else:
             self.paths.append(curr_path)
コード例 #7
0
 def append(self, point):
     curr_path = None
     if self.curr_path == None:
         curr_path = Path()
         self.curr_path = curr_path
     else:
         curr_path = self.curr_path
         self.curr_path = None
     curr_path.append(point)
     if self.curr_path == None:
         simplify_toolpath(curr_path)
         if self.reverse:
             curr_path.reverse()
             self.paths.insert(0, curr_path)
         else:
             self.paths.append(curr_path)
コード例 #8
0
 def finish(self):
     self.polygon_extractor.finish()
     if self.polygon_extractor.merge_path_list:
         paths = self.polygon_extractor.merge_path_list
     elif self.polygon_extractor.hor_path_list:
         paths = self.polygon_extractor.hor_path_list
     else:
         paths = self.polygon_extractor.ver_path_list
     if paths:
         for path in paths:
             path.append(path.points[0])
             simplify_toolpath(path)
     if paths:
         self.paths.extend(paths)
         self.sort_layered()
     self.polygon_extractor = None
コード例 #9
0
ファイル: ContourCutter.py プロジェクト: stevegt/pycam
 def finish(self):
     self.polygon_extractor.finish()
     if self.polygon_extractor.merge_path_list:
         paths = self.polygon_extractor.merge_path_list
     elif self.polygon_extractor.hor_path_list:
         paths = self.polygon_extractor.hor_path_list
     else:
         paths = self.polygon_extractor.ver_path_list
     if paths:
         for path in paths:
             path.append(path.points[0])
             simplify_toolpath(path)
     if paths:
         self.paths.extend(paths)
         self.sort_layered()
     self.polygon_extractor = None