diff options
Diffstat (limited to 'gerbonara/cad/kicad/base_types.py')
-rw-r--r-- | gerbonara/cad/kicad/base_types.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gerbonara/cad/kicad/base_types.py b/gerbonara/cad/kicad/base_types.py index 001138c..11eeb6d 100644 --- a/gerbonara/cad/kicad/base_types.py +++ b/gerbonara/cad/kicad/base_types.py @@ -208,6 +208,9 @@ class XYCoord: else: self.x, self.y = x, y + def within_distance(self, x, y, dist): + return math.dist((x, y), (self.x, self.y)) < dist + def isclose(self, other, tol=1e-3): return math.isclose(self.x, other.x, tol) and math.isclose(self.y, other.y, tol) |