diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-03-23 08:18:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-23 08:18:39 +0100 |
| commit | 3bf30f6f260d0eac60116ae3f8a2642665e16c6d (patch) | |
| tree | 9801a1bebbb14b0ecf2ffac57352031071286c6e /lib/elements | |
| parent | 1c2c14912839da59adab5cf458e9fc9f50dc7b9d (diff) | |
add no rung warning (#2791)
Diffstat (limited to 'lib/elements')
| -rw-r--r-- | lib/elements/satin_column.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index bf81fd0d..75d7e259 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -58,11 +58,21 @@ class DanglingRungWarning(ValidationWarning): description = _("Satin column: A rung doesn't intersect both rails.") + " " + rung_message +class NoRungWarning(ValidationWarning): + name = _("Satin has no rungs") + description = _("Rungs control the stitch direction in satin columns. It is best pratice to use them.") + steps_to_solve = [ + _('* With the selected object press "P" to activate the pencil tool.'), + _('* Hold "Shift" while drawing a rung.') + ] + + class TwoRungsWarning(ValidationWarning): name = _("Satin has exactly two rungs") - description = _("Satin column: 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.") steps_to_solve = [ - _("Add an other rung.") + _('* With the selected object press "P" to activate the pencil tool.'), + _('* Hold "Shift" while drawing a rung.') ] @@ -678,9 +688,11 @@ class SatinColumn(EmbroideryElement): def validation_warnings(self): if len(self.csp) == 4: yield TwoRungsWarning(self.flattened_rails[0].interpolate(0.5, normalized=True)) - if len(self.csp) == 2 and len(self.rails[0]) != len(self.rails[1]): - yield UnequalPointsWarning(self.flattened_rails[0].interpolate(0.5, normalized=True)) - if len(self.csp) > 2: + elif len(self.csp) == 2: + yield NoRungWarning(self.flattened_rails[1].representative_point()) + if len(self.rails[0]) != len(self.rails[1]): + yield UnequalPointsWarning(self.flattened_rails[0].interpolate(0.5, normalized=True)) + elif len(self.csp) > 2: for rung in self.flattened_rungs: for rail in self.flattened_rails: intersection = rung.intersection(rail) |
