diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2023-02-22 20:22:49 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-22 20:22:49 -0500 |
| commit | 8cdfaf099864e76a487ce77712ee54682e4a091f (patch) | |
| tree | 6fd43b320f53d4f81a40c0097091f8e4baaa31ac /lib/utils/geometry.py | |
| parent | e559af72480858c32f5df57f7f6a0d653718ebf8 (diff) | |
| parent | 92dff9f359f19c57ce63046a85cbd40746e50a32 (diff) | |
Merge pull request #1803 from inkstitch/lexelby/smoothing
Meander fill
Diffstat (limited to 'lib/utils/geometry.py')
| -rw-r--r-- | lib/utils/geometry.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/utils/geometry.py b/lib/utils/geometry.py index 789f8720..8f34c467 100644 --- a/lib/utils/geometry.py +++ b/lib/utils/geometry.py @@ -220,6 +220,9 @@ class Point: def rotate(self, angle): return self.__class__(self.x * math.cos(angle) - self.y * math.sin(angle), self.y * math.cos(angle) + self.x * math.sin(angle)) + def scale(self, x_scale, y_scale): + return self.__class__(self.x * x_scale, self.y * y_scale) + def as_int(self): return self.__class__(int(round(self.x)), int(round(self.y))) @@ -238,3 +241,7 @@ class Point: def line_string_to_point_list(line_string): return [Point(*point) for point in line_string.coords] + + +def coordinate_list_to_point_list(coordinate_list): + return [Point.from_tuple(coords) for coords in coordinate_list] |
