diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-07-19 22:30:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-19 22:30:15 +0200 |
| commit | ffc0db1ddf2f790fecaa67cdacec87f207e999e8 (patch) | |
| tree | 9938f5a242ca6bb1ac045dd7aed96b6097f6c629 /lib/utils/geometry.py | |
| parent | fdd3dbc956cd9d2be10bcbf4834e47dd89fcb754 (diff) | |
Convert to satin internally (3874)
Diffstat (limited to 'lib/utils/geometry.py')
| -rw-r--r-- | lib/utils/geometry.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils/geometry.py b/lib/utils/geometry.py index 39bbd963..39a1f3fb 100644 --- a/lib/utils/geometry.py +++ b/lib/utils/geometry.py @@ -5,6 +5,7 @@ import math import typing +from itertools import groupby import numpy from shapely.geometry import (GeometryCollection, LinearRing, LineString, @@ -242,6 +243,11 @@ def offset_points(pos1, pos2, offset_px, offset_proportional): return out1, out2 +def remove_duplicate_points(path): + path = [[round(coord, 4) for coord in point] for point in path] + return [point for point, repeats in groupby(path)] + + class Point: def __init__(self, x: typing.Union[float, numpy.float64], y: typing.Union[float, numpy.float64]): self.x = float(x) |
