コード例 #1
0
 def point(self, x, y, z):
     if self._n:
         n = self._n
         n.bound = (x, y, z)
     else:
         n = Node(None, (x, y, z))
     (nn, dist) = self.nearest_neighbor(n, self.dist)
     if nn and (dist < self.tolerance):
         self._n = n
         return nn.obj
     else:
         n.obj = (x, y, z)
         self._n = None
         self.insert(n)
         return n.obj
コード例 #2
0
ファイル: PointKdtree.py プロジェクト: zultron/pycam
 def Point(self, x, y, z):
     if self._n:
         n = self._n
         n.bound = (x, y, z)
     else:
         n = Node(None, (x, y, z))
     (nn, dist) = self.nearest_neighbor(n, self.dist)
     if nn and (dist < self.tolerance):
         self._n = n
         return nn.obj
     else:
         n.obj = (x, y, z)
         self._n = None
         self.insert(n)
         return n.obj