def on_fitButton_clicked(self): "Fitting a sphere to the line hoping the sphere to capture a circular movement" ids = [] lps = sl.firstLineAsArray(self.polyLine, ids) slps = sl.smoothLine(lps) dslps = (len(ids) - slps.shape[0]) / 2 pts = self.polyLine.GetPoints() for (idx, j) in enumerate(range(dslps, len(lps) - dslps)): pts.SetPoint(ids[j], slps[idx, :])
def on_fitButton_clicked(self): "Fitting a sphere to the line hoping the sphere to capture a circular movement" ids = [] lps = sl.firstLineAsArray(self.polyLine, ids) slps = sl.smoothLine(lps) dslps = (len(ids) - slps.shape[0]) / 2 pts = self.polyLine.GetPoints() for (idx,j) in enumerate(range(dslps, len(lps)-dslps)): pts.SetPoint(ids[j], slps[idx,:])
def on_smoothButton_clicked(self): ids = [] lps = sl.firstLineAsArray(self.polyLine, ids) slps = sl.smoothLine(lps) dslps = (len(ids) - slps.shape[0]) / 2 pts = self.polyLine.GetPoints() for (idx, j) in enumerate(range(dslps, len(lps) - dslps)): pts.SetPoint(ids[j], slps[idx, :]) self.RenderLine() return
def on_smoothButton_clicked(self): ids = [] lps = sl.firstLineAsArray(self.polyLine, ids) slps = sl.smoothLine(lps) dslps = (len(ids) - slps.shape[0]) / 2 pts = self.polyLine.GetPoints() for (idx,j) in enumerate(range(dslps, len(lps)-dslps)): pts.SetPoint(ids[j], slps[idx,:]) self.RenderLine() return