kopia lustrzana https://github.com/inkstitch/inkstitch
add warning for closed path satins (#2976)
rodzic
9462a05d44
commit
1cc14f7ba6
|
|
@ -48,9 +48,13 @@ class NotStitchableError(ValidationError):
|
||||||
rung_message = _("Each rung should intersect both rails once.")
|
rung_message = _("Each rung should intersect both rails once.")
|
||||||
|
|
||||||
|
|
||||||
class TooManyIntersectionsWarning(ValidationWarning):
|
class ClosedPathWarning(ValidationWarning):
|
||||||
name = _("Rungs intersects too many times")
|
name = _("Rail is a closed path")
|
||||||
description = _("Satin column: A rung intersects a rail more than once.") + " " + rung_message
|
description = _("Rail is a closed path without a definite starting and ending point.")
|
||||||
|
steps_to_solve = [
|
||||||
|
_('* Select the node where you want the satin to start.'),
|
||||||
|
_('* Click on: Break path at selected nodes.')
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class DanglingRungWarning(ValidationWarning):
|
class DanglingRungWarning(ValidationWarning):
|
||||||
|
|
@ -67,6 +71,11 @@ class NoRungWarning(ValidationWarning):
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class TooManyIntersectionsWarning(ValidationWarning):
|
||||||
|
name = _("Rungs intersects too many times")
|
||||||
|
description = _("Satin column: A rung intersects a rail more than once.") + " " + rung_message
|
||||||
|
|
||||||
|
|
||||||
class TwoRungsWarning(ValidationWarning):
|
class TwoRungsWarning(ValidationWarning):
|
||||||
name = _("Satin has exactly two rungs")
|
name = _("Satin has exactly two rungs")
|
||||||
description = _("There are exactly two rungs. This may lead to false rail/rung detection.")
|
description = _("There are exactly two rungs. This may lead to false rail/rung detection.")
|
||||||
|
|
@ -738,6 +747,9 @@ class SatinColumn(EmbroideryElement):
|
||||||
yield DanglingRungWarning(rung.interpolate(0.5, normalized=True))
|
yield DanglingRungWarning(rung.interpolate(0.5, normalized=True))
|
||||||
elif not isinstance(intersection, shgeo.Point):
|
elif not isinstance(intersection, shgeo.Point):
|
||||||
yield TooManyIntersectionsWarning(rung.interpolate(0.5, normalized=True))
|
yield TooManyIntersectionsWarning(rung.interpolate(0.5, normalized=True))
|
||||||
|
paths = self.node.get_path()
|
||||||
|
if any([path.letter == 'Z' for path in paths]):
|
||||||
|
yield ClosedPathWarning(self.flattened_rails[0].coords[0])
|
||||||
|
|
||||||
def validation_errors(self):
|
def validation_errors(self):
|
||||||
# The node should have exactly two paths with the same number of points - or it should
|
# The node should have exactly two paths with the same number of points - or it should
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue