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()
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
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()
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
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)
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