def run(self): if self.objIds is not None: self.proof_placement() else: print 'No Objects selected' return if self.correctplacement: self.nesting() if self.correctplacement: pass # self.save_stl() else: print 'Please place the parts correct in build space' rs.UnselectAllObjects() return start = time.time() slice_stat = self.slicing() end = time.time() print 'Calculation time: ' + str(end - start) + ' [sec]' if slice_stat: AP = addPoints.addPoints(self.pluginPath, self.corePath) AP.start()
def on_modified(self, event): import addPoints src_path = event.src_path etype = event.event_type if etype == 'modified' and src_path.split('\\')[-1] == 'Mesh.gcode': print 'gcode changed' AP = addPoints.addPoints(self.pluginPath, self.corePath) AP.flush_data()
def run(self): from RhinoInterface import testchecker #terminator_str = r'C:\\MW3D_07\\terminator.exe' #startupinfo = subprocess.STARTUPINFO() #startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW #output = subprocess.Popen(terminator_str, startupinfo=startupinfo, stdout=subprocess.PIPE, # stderr=subprocess.STDOUT, stdin=subprocess.PIPE).communicate() #output = output[0].strip() # filter version number from output #print output #print 'Waiting for termination to end' #print 'Done' if self.objIds is not None: self.proof_placement(checkbuildspace=False) else: print 'No Objects selected' return # if self.correctplacement: # self.nesting() if self.correctplacement: pass # self.save_stl() else: print 'Please place the parts correct in build space' rs.UnselectAllObjects() return start = time.time() slice_stat = self.slicing() end = time.time() print 'Calculation time: ' + str(end - start) + ' [sec]' if slice_stat: AP = addPoints.addPoints(self.pluginPath, self.corePath) AP.start() # start simulation calculation in background os.system(self.corePath + r'\gcode2cutsimFDM.exe ' + self.corePath + r'\Mesh.gcode ' + self.corePath + r'\Mesh.ini -silent')
def uniqNvalue(hands): from itertools import permutations perms = permutations(hands) results = [] for perm in perms: uniHands = [] for hand in perm: alreadyThere = 0 for card in hand: for uh in uniHands: if card in uh: alreadyThere = 1 if not alreadyThere: uniHands.append(hand) if uniHands not in results: results.append(uniHands) highestScore = 0 newResults = [] for res in results: points = 0 for hand in res: points = points + addPoints(hand) newResults.append([points, res]) if points > highestScore: highestScore = points results = [] for thing in newResults: if thing[0] == highestScore: results.append(thing[1]) # if there's duplicate entried, this is not completely random shuffle(results) return results[0]