diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/elements/satin_column.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index a714ad38..c031f229 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -48,9 +48,13 @@ class NotStitchableError(ValidationError): rung_message = _("Each rung should intersect both rails once.") -class TooManyIntersectionsWarning(ValidationWarning): - name = _("Rungs intersects too many times") - description = _("Satin column: A rung intersects a rail more than once.") + " " + rung_message +class ClosedPathWarning(ValidationWarning): + name = _("Rail is a closed path") + 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): @@ -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): name = _("Satin has exactly two rungs") 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)) elif not isinstance(intersection, shgeo.Point): 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): # The node should have exactly two paths with the same number of points - or it should |
