def splitBranch(self,branch, point): self.points.append(point) radius = branch.radius new = Branch(len(self.points)-1, branch.finalPoint, radius) new.root = branch new.son1 = branch.son1 new.son2 = branch.son2 if branch.son1 is not None: new.son1.root = new if branch.son2 is not None: new.son2.root = new branch.son2 = None branch.finalPoint = new.initialPoint branch.son1 = new