(self, x, y, z, lim)
| 62 | self.update, self.infoupdate = True, True |
| 63 | |
| 64 | def snap(self, x, y, z, lim): |
| 65 | if not self.issimple():return None |
| 66 | cur, minl = None, 1e8 |
| 67 | for i in self.body[0][0]: |
| 68 | d = (i[0]-x)**2+(i[1]-y)**2 |
| 69 | if d < minl:cur,minl = i,d |
| 70 | if minl**0.5>lim:return None |
| 71 | return self.body[0][0], self.body[0][0].index(cur) |
| 72 | |
| 73 | def pick(self, x, y, z, lim): |
| 74 | rst = self.snap(x, y, z, lim) |