kopia lustrzana https://github.com/inkstitch/inkstitch
fix duplicate point handling
rodzic
3cf7f1547c
commit
9f4f6d85a0
|
@ -1,6 +1,7 @@
|
||||||
from shapely.geometry import LineString, Point as ShapelyPoint
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
from shapely.geometry import LineString, Point as ShapelyPoint
|
||||||
|
|
||||||
|
|
||||||
def cut(line, distance, normalized=False):
|
def cut(line, distance, normalized=False):
|
||||||
""" Cuts a LineString in two at a distance from its starting point.
|
""" Cuts a LineString in two at a distance from its starting point.
|
||||||
|
@ -51,9 +52,8 @@ def cut_path(points, length):
|
||||||
|
|
||||||
|
|
||||||
def collapse_duplicate_point(geometry):
|
def collapse_duplicate_point(geometry):
|
||||||
if hasattr(geometry, 'geoms'):
|
if geometry.area < 0.01:
|
||||||
if geometry.area < 0.01:
|
return geometry.representative_point()
|
||||||
return geometry.representative_point()
|
|
||||||
|
|
||||||
return geometry
|
return geometry
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue