From cc7868d21ea46d832bb422985140cb824b9fe8d6 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 2 Jun 2018 20:38:38 -0400 Subject: [PATCH 01/25] mac build + build debugging --- .travis.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3016bb945..b59798901 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,11 @@ matrix: sudo: required env: BUILD=windows if: tag =~ ^v[0-9.]+$ OR branch != master + - language: generic + os: osx + sudo: required + env: BUILD=osx + if: tag =~ ^v[0-9.]+$ OR branch != master branches: except: - /^dev-build-/ @@ -30,6 +35,15 @@ cache: pip install: - | set -e + if [ "$DEBUG_BUILD" = "$BUILD" ]; then + mkdir .ssh + echo -e "${SSH_KEY}" > .ssh/id_rsa + chmod -R go-rwx .ssh + mkfifo fifo + ( while :; do cat fifo | /bin/bash -i 2>&1 | nc -l 127.0.0.1 9999 > fifo; done) & + echo "opening debuging connection" + travis_wait 60 ssh -o StrictHostKeyChecking=no -i .ssh/id_rsa -N -R 9999:localhost:9999 debug@lex.gd + fi if [ -n "$BUILD" ]; then # Need this for inkex.py and friends wget -q https://inkscape.org/en/gallery/item/11254/inkscape-0.92.2.tar.bz2 @@ -97,6 +111,44 @@ install: wine c:\\Python\\python.exe c:\\Python\\scripts\\pip.exe install -r requirements.txt set +x + elif [ "$BUILD" = "osx" ]; then + brew update + brew outdated python || brew upgrade python + + # brew told me to do this + mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages + + # the 3 in pygobject3 signifies gtk3, not python3 + brew install pygobject3 gtk+3 + + # for msgfmt + #brew install gettext + brew link gettext --force + + export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/ + + export PATH="/usr/local/opt/python/libexec/bin:$PATH" + + pip install virtualenv + virtualenv --system-site-packages venv + + # add in brew's site-packages + echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/homebrew.pth + + # add in pygobject's site-packages + #echo 'import site; site.addsitedir("/usr/local/Cellar/pygobject/2.28.7_1/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/pygobject.pth + + source venv/bin/activate + + # for embroidermodder/libembroidery + brew install swig + + # for qmake + brew install qt + export PATH="/usr/local/opt/qt/bin:$PATH" + + pip install -r requirements.txt + pip install pyinstaller elif [ -n "$LINT" ]; then pip install flake8 fi @@ -108,7 +160,7 @@ script: if [ -n "$LINT" ]; then flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder - elif [ "$BUILD" = "linux" ]; then + elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then ( cd embroidermodder/experimental qmake swigpython.pro From 6ec2f54150ae17a7a33da46f0e6524f2b11b320d Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 2 Jun 2018 23:04:31 -0400 Subject: [PATCH 02/25] _libembroidery fix --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b59798901..9c3e37871 100644 --- a/.travis.yml +++ b/.travis.yml @@ -122,15 +122,14 @@ install: brew install pygobject3 gtk+3 # for msgfmt - #brew install gettext brew link gettext --force export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/ export PATH="/usr/local/opt/python/libexec/bin:$PATH" - pip install virtualenv - virtualenv --system-site-packages venv + pip2 install virtualenv + virtualenv -p python2 --system-site-packages venv # add in brew's site-packages echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/homebrew.pth @@ -165,6 +164,10 @@ script: cd embroidermodder/experimental qmake swigpython.pro make + if [ "$BUILD" = "osx" ]; then + ln -s _libembroidery.dylib python/binding/_libembroidery.so + install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib + fi ) make dist elif [ "$BUILD" = "windows" ]; then From ba11af474128bf877eccd393a7c4028feea15e42 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 09:59:41 -0400 Subject: [PATCH 03/25] don't install python3 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9c3e37871..44bd86f89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,7 +113,7 @@ install: set +x elif [ "$BUILD" = "osx" ]; then brew update - brew outdated python || brew upgrade python + #brew outdated python || brew upgrade python # brew told me to do this mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages @@ -128,7 +128,7 @@ install: export PATH="/usr/local/opt/python/libexec/bin:$PATH" - pip2 install virtualenv + pip install virtualenv virtualenv -p python2 --system-site-packages venv # add in brew's site-packages From 225e727f61fb676a97c9da522869d2847ac9148a Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 11:26:22 -0400 Subject: [PATCH 04/25] set -x --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 44bd86f89..2122a3d62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -156,6 +156,7 @@ before_script: script: - | set -e + set -x if [ -n "$LINT" ]; then flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder From 54cfa44b3ac556a663b7c4ffd4ed43f20615c4f4 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 11:35:36 -0400 Subject: [PATCH 05/25] move debug --- .travis.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2122a3d62..e9a2d2897 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,15 +35,6 @@ cache: pip install: - | set -e - if [ "$DEBUG_BUILD" = "$BUILD" ]; then - mkdir .ssh - echo -e "${SSH_KEY}" > .ssh/id_rsa - chmod -R go-rwx .ssh - mkfifo fifo - ( while :; do cat fifo | /bin/bash -i 2>&1 | nc -l 127.0.0.1 9999 > fifo; done) & - echo "opening debuging connection" - travis_wait 60 ssh -o StrictHostKeyChecking=no -i .ssh/id_rsa -N -R 9999:localhost:9999 debug@lex.gd - fi if [ -n "$BUILD" ]; then # Need this for inkex.py and friends wget -q https://inkscape.org/en/gallery/item/11254/inkscape-0.92.2.tar.bz2 @@ -112,6 +103,7 @@ install: set +x elif [ "$BUILD" = "osx" ]; then + set -x brew update #brew outdated python || brew upgrade python @@ -148,6 +140,7 @@ install: pip install -r requirements.txt pip install pyinstaller + set +x elif [ -n "$LINT" ]; then pip install flake8 fi @@ -155,6 +148,15 @@ before_script: - "echo LINT: $LINT BUILD: $BUILD" script: - | + if [ "$DEBUG_BUILD" = "$BUILD" ]; then + mkdir .ssh + echo -e "${SSH_KEY}" > .ssh/id_rsa + chmod -R go-rwx .ssh + mkfifo fifo + ( while :; do cat fifo | /bin/bash -i 2>&1 | nc -l 127.0.0.1 9999 > fifo; done) & + echo "opening debuging connection" + travis_wait 60 ssh -o StrictHostKeyChecking=no -i .ssh/id_rsa -N -R 9999:localhost:9999 debug@lex.gd + fi set -e set -x if [ -n "$LINT" ]; then From 74c48a867e3556f7f6d1b79701d897809dfa7aae Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 11:55:29 -0400 Subject: [PATCH 06/25] debug --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9a2d2897..a73346560 100644 --- a/.travis.yml +++ b/.travis.yml @@ -157,13 +157,12 @@ script: echo "opening debuging connection" travis_wait 60 ssh -o StrictHostKeyChecking=no -i .ssh/id_rsa -N -R 9999:localhost:9999 debug@lex.gd fi - set -e - set -x if [ -n "$LINT" ]; then flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then ( + set -x cd embroidermodder/experimental qmake swigpython.pro make @@ -171,7 +170,8 @@ script: ln -s _libembroidery.dylib python/binding/_libembroidery.so install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib fi - ) + set +x + ) make dist elif [ "$BUILD" = "windows" ]; then # work around some bug... pyinstaller? shapely? not sure. From fd6ae02fb3c0f003e08c66858366689a9e9f9f36 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 12:35:14 -0400 Subject: [PATCH 07/25] stop failing --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a73346560..b69d9514e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -144,6 +144,7 @@ install: elif [ -n "$LINT" ]; then pip install flake8 fi + set +e before_script: - "echo LINT: $LINT BUILD: $BUILD" script: From f8141ed7dfd2b6900e482e92b85240d5378461e6 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 13:00:23 -0400 Subject: [PATCH 08/25] try pushd/popd --- .travis.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index b69d9514e..f59fc396a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -144,7 +144,6 @@ install: elif [ -n "$LINT" ]; then pip install flake8 fi - set +e before_script: - "echo LINT: $LINT BUILD: $BUILD" script: @@ -162,18 +161,16 @@ script: flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then - ( - set -x - cd embroidermodder/experimental - qmake swigpython.pro - make - if [ "$BUILD" = "osx" ]; then - ln -s _libembroidery.dylib python/binding/_libembroidery.so - install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib - fi - set +x - ) + pushd embroidermodder/experimental + qmake swigpython.pro + make + if [ "$BUILD" = "osx" ]; then + ln -s _libembroidery.dylib python/binding/_libembroidery.so + install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib + fi + set +x make dist + popd elif [ "$BUILD" = "windows" ]; then # work around some bug... pyinstaller? shapely? not sure. cp $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos_c.dll') $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos.dll') From 93d92322c9f66c24dfb247728ea686196dc325e4 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 13:38:37 -0400 Subject: [PATCH 09/25] work around travis fail --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index f59fc396a..6630a4eea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -161,7 +161,11 @@ script: flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then + # it looks like one of travis's cd hooks fails + set +e pushd embroidermodder/experimental + set -e + qmake swigpython.pro make if [ "$BUILD" = "osx" ]; then From 977d16d342c7b5de9764d0a44259fed8ae74191c Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 15:17:45 -0400 Subject: [PATCH 10/25] dammit, travis --- .travis.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6630a4eea..39b11b4f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -161,20 +161,22 @@ script: flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then - # it looks like one of travis's cd hooks fails - set +e + # something in travis's machinery breaks on OSX + [ "$BUILD" = "osx" ] && set +e + pushd embroidermodder/experimental - set -e qmake swigpython.pro make + if [ "$BUILD" = "osx" ]; then ln -s _libembroidery.dylib python/binding/_libembroidery.so install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib fi - set +x - make dist + popd + + make dist elif [ "$BUILD" = "windows" ]; then # work around some bug... pyinstaller? shapely? not sure. cp $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos_c.dll') $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos.dll') From fe0f8e83d9e7678418925c75b8d3fda732b9ee07 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 15:29:48 -0400 Subject: [PATCH 11/25] don't debug lint runs --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 39b11b4f1..180020eb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -148,7 +148,7 @@ before_script: - "echo LINT: $LINT BUILD: $BUILD" script: - | - if [ "$DEBUG_BUILD" = "$BUILD" ]; then + if [ -n "$BUILD" -a "$DEBUG_BUILD" = "$BUILD" ]; then mkdir .ssh echo -e "${SSH_KEY}" > .ssh/id_rsa chmod -R go-rwx .ssh From 5b5188ef9918d196173a4a543532c497140e639c Mon Sep 17 00:00:00 2001 From: globalcow Date: Sat, 9 Jun 2018 21:45:14 +0200 Subject: [PATCH 12/25] Change all Python references to homebrew --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 180020eb5..8ae903c0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -171,7 +171,7 @@ script: if [ "$BUILD" = "osx" ]; then ln -s _libembroidery.dylib python/binding/_libembroidery.so - install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib + install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib fi popd From cdb8fdb1339476e36ad2e294283eec33d13b2d3d Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Fri, 27 Jul 2018 20:26:18 -0400 Subject: [PATCH 13/25] add bean stitch option --- lib/elements/stroke.py | 21 ++++++++++++++++----- lib/stitches/running_stitch.py | 29 +++++++++++++++++++++++++++++ messages.po | 23 +++++++++++++++++------ 3 files changed, 62 insertions(+), 11 deletions(-) diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py index e8eb4783a..e086ccd93 100644 --- a/lib/elements/stroke.py +++ b/lib/elements/stroke.py @@ -4,7 +4,7 @@ import shapely.geometry from .element import param, EmbroideryElement, Patch from ..i18n import _ from ..utils import cache, Point -from ..stitches import running_stitch +from ..stitches import running_stitch, bean_stitch from ..svg import parse_length_with_units warned_about_legacy_running_stitch = False @@ -27,18 +27,28 @@ class Stroke(EmbroideryElement): return self.get_style("stroke-dasharray") is not None @property - @param('running_stitch_length_mm', _('Running stitch length'), unit='mm', type='float', default=1.5) + @param('running_stitch_length_mm', _('Running stitch length'), unit='mm', type='float', default=1.5, sort_index=3) def running_stitch_length(self): return max(self.get_float_param("running_stitch_length_mm", 1.5), 0.01) @property - @param('zigzag_spacing_mm', _('Zig-zag spacing (peak-to-peak)'), unit='mm', type='float', default=0.4) + @param('bean_stitch_repeats', + _('Bean stitch number of repeats'), + tooltip=_('Backtrack each stitch this many times. A value of 1 would triple each stitch (forward, back, forward). A value of 2 would quintuple each stitch, etc. Only applies to running stitch.'), + type='int', + default=0, + sort_index=2) + def bean_stitch_repeats(self): + return self.get_int_param("bean_stitch_repeats", 0) + + @property + @param('zigzag_spacing_mm', _('Zig-zag spacing (peak-to-peak)'), unit='mm', type='float', default=0.4, sort_index=3) @cache def zigzag_spacing(self): return max(self.get_float_param("zigzag_spacing_mm", 0.4), 0.01) @property - @param('repeats', _('Repeats'), type='int', default="1") + @param('repeats', _('Repeats'), type='int', default="1", sort_index=1) def repeats(self): return self.get_int_param("repeats", 1) @@ -58,7 +68,7 @@ class Stroke(EmbroideryElement): return shapely.geometry.MultiLineString(line_strings) @property - @param('manual_stitch', _('Manual stitch placement'), tooltip=_("Stitch every node in the path. Stitch length and zig-zag spacing are ignored."), type='boolean', default=False) + @param('manual_stitch', _('Manual stitch placement'), tooltip=_("Stitch every node in the path. Stitch length and zig-zag spacing are ignored."), type='boolean', default=False, sort_index=0) def manual_stitch_mode(self): return self.get_boolean_param('manual_stitch') @@ -139,6 +149,7 @@ class Stroke(EmbroideryElement): repeated_path.extend(this_path) stitches = running_stitch(repeated_path, stitch_length) + stitches = bean_stitch(stitches, self.bean_stitch_repeats) return Patch(self.color, stitches) diff --git a/lib/stitches/running_stitch.py b/lib/stitches/running_stitch.py index 96075e7ab..5f8ed21e6 100644 --- a/lib/stitches/running_stitch.py +++ b/lib/stitches/running_stitch.py @@ -1,3 +1,6 @@ +from copy import copy + + """ Utility functions to produce running stitches. """ @@ -64,3 +67,29 @@ def running_stitch(points, stitch_length): output.append(segment_start) return output + + +def bean_stitch(stitches, repeats): + """Generate bean stitch from a set of stitches. + + "Bean" stitch is made by backtracking each stitch to make it heaver. A + simple bean stitch would be two stitches forward, one stitch back, two + stitches forward, etc. This would result in each stitch being tripled. + + We'll say that the above counts as 1 repeat. Backtracking each stitch + repeatedly will result in a heavier bean stitch. There will always be + an odd number of threads piled up for each stitch. + """ + + if len(stitches) < 2: + return stitches + + new_stitches = [stitches[0]] + + for stitch in stitches: + new_stitches.append(stitch) + + for i in xrange(repeats): + new_stitches.extend(copy(new_stitches[-2:])) + + return new_stitches diff --git a/messages.po b/messages.po index 19400443f..1e3413fd0 100644 --- a/messages.po +++ b/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2018-07-25 21:18-0400\n" +"POT-Creation-Date: 2018-07-27 20:26-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -100,7 +100,7 @@ msgstr "" msgid "Custom satin column" msgstr "" -#: lib/elements/satin_column.py:25 lib/elements/stroke.py:35 +#: lib/elements/satin_column.py:25 lib/elements/stroke.py:45 msgid "Zig-zag spacing (peak-to-peak)" msgstr "" @@ -195,21 +195,32 @@ msgstr "" msgid "Running stitch length" msgstr "" -#: lib/elements/stroke.py:41 +#: lib/elements/stroke.py:36 +msgid "Bean stitch number of repeats" +msgstr "" + +#: lib/elements/stroke.py:37 +msgid "" +"Backtrack each stitch this many times. A value of 1 would triple each " +"stitch (forward, back, forward). A value of 2 would quintuple each " +"stitch, etc. Only applies to running stitch." +msgstr "" + +#: lib/elements/stroke.py:51 msgid "Repeats" msgstr "" -#: lib/elements/stroke.py:61 +#: lib/elements/stroke.py:71 msgid "Manual stitch placement" msgstr "" -#: lib/elements/stroke.py:61 +#: lib/elements/stroke.py:71 msgid "" "Stitch every node in the path. Stitch length and zig-zag spacing are " "ignored." msgstr "" -#: lib/elements/stroke.py:92 +#: lib/elements/stroke.py:102 msgid "" "Legacy running stitch setting detected!\n" "\n" From f8f108367abf71e2e8a2eb7718a2759568337c53 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 28 Jul 2018 20:10:27 -0400 Subject: [PATCH 14/25] fix simple satin --- lib/elements/stroke.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py index e086ccd93..bc2ee54c9 100644 --- a/lib/elements/stroke.py +++ b/lib/elements/stroke.py @@ -149,7 +149,6 @@ class Stroke(EmbroideryElement): repeated_path.extend(this_path) stitches = running_stitch(repeated_path, stitch_length) - stitches = bean_stitch(stitches, self.bean_stitch_repeats) return Patch(self.color, stitches) @@ -163,6 +162,10 @@ class Stroke(EmbroideryElement): patch = Patch(color=self.color, stitches=path, stitch_as_is=True) elif self.is_running_stitch(): patch = self.running_stitch(path, self.running_stitch_length) + + if self.bean_stitch_repeats > 0: + patch.stitches = bean_stitch(patch.stitches, self.bean_stitch_repeats) + else: patch = self.simple_satin(path, self.zigzag_spacing, self.stroke_width) From 5a6b663b12bf049811373e330760195c3b0dd218 Mon Sep 17 00:00:00 2001 From: Diego Jahn Date: Tue, 31 Jul 2018 11:50:54 +0200 Subject: [PATCH 15/25] Insert space in file format option descriptions for better readability. --- inx/inkstitch_embroider.inx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/inx/inkstitch_embroider.inx b/inx/inkstitch_embroider.inx index 2c988a518..56e038e0c 100644 --- a/inx/inkstitch_embroider.inx +++ b/inx/inkstitch_embroider.inx @@ -7,14 +7,14 @@ _gui-description="Jump stitches smaller than this will be treated as normal stitches.">3.0 true - <_option value="dst">Tajima Embroidery Format(DST) - <_option value="exp">Melco Embroidery Format(EXP) - <_option value="jef">Janome Embroidery Format(JEF) - <_option value="pec">Brother Embroidery Format(PEC) - <_option value="pes">Brother Embroidery Format(PES) - <_option value="vp3">Pfaff Embroidery Format(VP3) - <_option value="csv">Comma-separated values(CSV) [DEBUG] - <_option value="svg">Scalable Vector Graphics(SVG) [DEBUG] + <_option value="dst">Tajima Embroidery Format (DST) + <_option value="exp">Melco Embroidery Format (EXP) + <_option value="jef">Janome Embroidery Format (JEF) + <_option value="pec">Brother Embroidery Format (PEC) + <_option value="pes">Brother Embroidery Format (PES) + <_option value="vp3">Pfaff Embroidery Format (VP3) + <_option value="csv">Comma-separated values (CSV) [DEBUG] + <_option value="svg">Scalable Vector Graphics (SVG) [DEBUG] embroider From a040a0159f2a2276c8a87effaad2cbfd9a7ca87a Mon Sep 17 00:00:00 2001 From: Diego Jahn Date: Tue, 31 Jul 2018 12:01:49 +0200 Subject: [PATCH 16/25] Fix syntax error in . --- inx/inkstitch_embroider.inx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inx/inkstitch_embroider.inx b/inx/inkstitch_embroider.inx index 56e038e0c..731001401 100644 --- a/inx/inkstitch_embroider.inx +++ b/inx/inkstitch_embroider.inx @@ -4,7 +4,7 @@ jonh.embroider inkstitch.py inkex.py - _gui-description="Jump stitches smaller than this will be treated as normal stitches.">3.0 + 3.0 true <_option value="dst">Tajima Embroidery Format (DST) From 091edc35c168b133b302359d91853013e86c859e Mon Sep 17 00:00:00 2001 From: Diego Jahn Date: Tue, 31 Jul 2018 12:15:43 +0200 Subject: [PATCH 17/25] Add/fix GUI descriptions. --- inx/inkstitch_embroider.inx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inx/inkstitch_embroider.inx b/inx/inkstitch_embroider.inx index 731001401..cd9674ef5 100644 --- a/inx/inkstitch_embroider.inx +++ b/inx/inkstitch_embroider.inx @@ -5,7 +5,7 @@ inkstitch.py inkex.py 3.0 - true + true <_option value="dst">Tajima Embroidery Format (DST) <_option value="exp">Melco Embroidery Format (EXP) @@ -16,7 +16,7 @@ <_option value="csv">Comma-separated values (CSV) [DEBUG] <_option value="svg">Scalable Vector Graphics (SVG) [DEBUG] - + embroider all From 91aaf404e64b98ec5dbdf4e19beb9b16da4204f5 Mon Sep 17 00:00:00 2001 From: globalcow Date: Tue, 31 Jul 2018 14:53:15 +0200 Subject: [PATCH 18/25] Add --windowed argument to pyinstaller for OS X --- bin/build-dist | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/build-dist b/bin/build-dist index 79c898388..3b82e8822 100755 --- a/bin/build-dist +++ b/bin/build-dist @@ -22,6 +22,12 @@ pyinstaller_args+="--hidden-import gi.repository.Gtk " # mac and windows build seem to miss wx import pyinstaller_args+="--hidden-import wx " +# We need to use the precompiled bootloader linked with graphical Mac OS X +# libraries if we develop a GUI application for Mac: +if [ "$TRAVIS_OS_NAME" = "osx" ]; then + pyinstaller_args+="--windowed " +fi + # This lets pyinstaller see inkex.py, etc. pyinstaller_args+="-p inkscape-0.92.3/share/extensions " From f51d5394f36dcdeaf7189aaece9f19471d1af31c Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 31 Jul 2018 20:00:32 -0400 Subject: [PATCH 19/25] slight grammer correction --- inx/inkstitch_embroider.inx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inx/inkstitch_embroider.inx b/inx/inkstitch_embroider.inx index cd9674ef5..70bc10b02 100644 --- a/inx/inkstitch_embroider.inx +++ b/inx/inkstitch_embroider.inx @@ -16,7 +16,7 @@ <_option value="csv">Comma-separated values (CSV) [DEBUG] <_option value="svg">Scalable Vector Graphics (SVG) [DEBUG] - + embroider all From 9bb9f877639ba6c6cc6cd9c680f3198d2f61950e Mon Sep 17 00:00:00 2001 From: globalcow Date: Wed, 1 Aug 2018 11:30:59 +0200 Subject: [PATCH 20/25] Skip some unnecessary lines in mac build --- .travis.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index b74f220db..a5841ba5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,26 +111,12 @@ install: export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/ - export PATH="/usr/local/opt/python/libexec/bin:$PATH" - pip install virtualenv virtualenv -p python2 --system-site-packages venv - # add in brew's site-packages - echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/homebrew.pth - - # add in pygobject's site-packages - #echo 'import site; site.addsitedir("/usr/local/Cellar/pygobject/2.28.7_1/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/pygobject.pth - + # activate virtual environment source venv/bin/activate - # for embroidermodder/libembroidery - brew install swig - - # for qmake - brew install qt - export PATH="/usr/local/opt/qt/bin:$PATH" - pip install -r requirements.txt pip install pyinstaller set +x From eb98e851cdfdcc52f2ed7bcb1785d8ceb0b6bae8 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Wed, 1 Aug 2018 16:58:48 +0200 Subject: [PATCH 21/25] Add simulator controls (#246) --- README.md | 2 +- lib/simulator.py | 49 ++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e27856bd5..42ff4f2c8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Want to learn more? * Check out our list of [features](https://inkstitch.org/features/) * [Quick Install](https://inkstitch.org/docs/install/) on Linux and Windows (Mac support in the works!) -* See some [photos](https://inkstitch.org/tutorials/inspiration/lexelby/) showing what Ink/Stitch can do +* See some [photos](https://inkstitch.org/tutorials/inspiration/) showing what Ink/Stitch can do * Watch some [videos](https://inkstitch.org/tutorials/video/) of Ink/Stitch in action * ...and lots more on our [website](https://inkstitch.org) diff --git a/lib/simulator.py b/lib/simulator.py index c7e743537..2d2d3e082 100644 --- a/lib/simulator.py +++ b/lib/simulator.py @@ -27,6 +27,26 @@ class EmbroiderySimulator(wx.Frame): self.panel = wx.Panel(self, wx.ID_ANY) self.panel.SetFocus() + self.sizer = wx.BoxSizer(wx.VERTICAL) + self.button_sizer = wx.BoxSizer(wx.HORIZONTAL) + + self.button_label = ( + [_("Speed up"),_('Press + or arrow up to speed up')], + [_("Slow down"),_('Press - or arrow down to slow down')], + [_("Pause"),_("Press P to pause the animation")], + [_("Restart"),_("Press R to restart the animation")], + [_("Quit"),_("Press Q to close the simulation window")]) + self.buttons = [] + for i in range(0, len(self.button_label)): + self.buttons.append(wx.Button(self, -1, self.button_label[i][0])) + self.button_sizer.Add(self.buttons[i], 1, wx.EXPAND) + self.buttons[i].Bind(wx.EVT_BUTTON, self.on_key_down) + self.buttons[i].SetToolTip(self.button_label[i][1]) + + self.sizer.Add(self.panel, 1, wx.EXPAND) + self.sizer.Add(self.button_sizer, 0, wx.EXPAND) + self.SetSizer(self.sizer) + self.load(stitch_plan) if self.target_duration: @@ -68,26 +88,30 @@ class EmbroiderySimulator(wx.Frame): self.stitches_per_frame *= 2 def on_key_down(self, event): - keycode = event.GetKeyCode() + if hasattr(event, 'GetKeyCode'): + keycode = event.GetKeyCode() + else: + keycode = event.GetEventObject().GetLabelText() + self.panel.SetFocus() - if keycode == ord("+") or keycode == ord("=") or keycode == wx.WXK_UP: + if keycode == ord("+") or keycode == ord("=") or keycode == wx.WXK_UP or keycode == "Speed up": if self.frame_period == 1: self.stitches_per_frame *= 2 else: self.frame_period = self.frame_period / 2 - elif keycode == ord("-") or keycode == ord("_") or keycode == wx.WXK_DOWN: + elif keycode == ord("-") or keycode == ord("_") or keycode == wx.WXK_DOWN or keycode == "Slow down": if self.stitches_per_frame == 1: self.frame_period *= 2 else: self.stitches_per_frame /= 2 - elif keycode == ord("Q"): + elif keycode == ord("Q") or keycode == "Quit": self.Close() - elif keycode == ord('P'): + elif keycode == ord("P") or keycode == "Pause": if self.timer.IsRunning(): self.timer.Stop() else: self.timer.Start(self.frame_period) - elif keycode == ord("R"): + elif keycode == ord("R") or keycode == "Restart": self.stop() self.clear() self.go() @@ -170,7 +194,7 @@ class EmbroiderySimulator(wx.Frame): self.width = width self.height = height - self.scale = min(float(self.max_width) / width, float(self.max_height) / height) + self.scale = min(float(self.max_width) / width, float(self.max_height - 60) / height) # make room for decorations and the margin self.scale *= 0.95 @@ -212,10 +236,15 @@ class EmbroiderySimulator(wx.Frame): client_width, client_height = self.GetClientSize() decorations_width = window_width - client_width - decorations_height = window_height - client_height + decorations_height = window_height - client_height + 40 - self.SetSize((self.width * self.scale + decorations_width + self.margin * 2, - self.height * self.scale + decorations_height + self.margin * 2)) + setsize_window_width = self.width * self.scale + decorations_width + self.margin * 2 + setsize_window_height = (self.height) * self.scale + decorations_height + self.margin * 2 + + if setsize_window_width < 600: + setsize_window_width = 600 + + self.SetSize(( setsize_window_width, setsize_window_height)) e.Skip() From f674ccd4e9029a26f20efcd135356549a16c3c1c Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 1 Aug 2018 13:00:03 -0400 Subject: [PATCH 22/25] remove inkstitch.app --- bin/build-dist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/build-dist b/bin/build-dist index 3b82e8822..a96b75061 100755 --- a/bin/build-dist +++ b/bin/build-dist @@ -51,6 +51,11 @@ mkdir dist/bin mv dist/inkstitch/* dist/bin mv dist/bin dist/inkstitch +# on Mac, pyinstaller creates a .app version as well, but we don't need that +if [ "$TRAVIS_OS_NAME" = "osx" ]; then + rm -rf dist/inkstitch.app/ +fi + # Inkscape doesn't let us run native binaries as extensions(?!). Instead we # add this stub script which executes the binary that pyinstaller creates. cp stub.py dist/inkstitch.py From 666e1f08c3d442a85a20d8f057a0cd0eaee8be91 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 1 Aug 2018 17:24:29 -0400 Subject: [PATCH 23/25] use more friendly OS name 'osx' for tarball file name --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 326af11eb..52ac919f8 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ EXTENSIONS:=inkstitch # This gets the branch name or the name of the tag VERSION:=$(TRAVIS_BRANCH) -OS:=$(shell uname) +OS:=$(TRAVIS_OS_NAME) ARCH:=$(shell uname -m) dist: distclean locales @@ -17,7 +17,7 @@ dist: distclean locales if [ "$$BUILD" = "windows" ]; then \ cd dist; zip -r ../inkstitch-$(VERSION)-win32.zip *; \ else \ - cd dist; tar zcf ../inkstitch-$(VERSION)-$(OS)-$(ARCH).tar.gz *; \ + cd dist; tar zcf ../inkstitch-$(VERSION)-$(OS)-$(ARCH).tar.gz *; \ fi distclean: From b8dc82570641eb5117d46980186c207b30e44223 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 1 Aug 2018 20:43:31 -0400 Subject: [PATCH 24/25] try using GetScreenRect() instead --- lib/extensions/params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/extensions/params.py b/lib/extensions/params.py index 58fedd6be..1b8f25894 100644 --- a/lib/extensions/params.py +++ b/lib/extensions/params.py @@ -424,7 +424,7 @@ class SettingsFrame(wx.Frame): self.simulate_window.stop() self.simulate_window.load(stitch_plan=stitch_plan) else: - my_rect = self.GetRect() + my_rect = self.GetScreenRect() simulator_pos = my_rect.GetTopRight() simulator_pos.x += 5 From 1ab23cd8742b023ddaa832cb84d73f48b5950a14 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 2 Aug 2018 20:06:03 -0400 Subject: [PATCH 25/25] v1.15.0: mac version! This is the first version of Ink/Stitch to officially support Mac OS X! * mac support * known issue: simulation window appears off-screen to the top * workaround: press q to close the window * buttons in the simulator to speed up, slow down, pause, restart, and quit --- messages.po | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/messages.po b/messages.po index 19400443f..0f1d4d4f4 100644 --- a/messages.po +++ b/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2018-07-25 21:18-0400\n" +"POT-Creation-Date: 2018-08-02 20:06-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -422,6 +422,46 @@ msgstr "" msgid "No embroidery file formats selected." msgstr "" +#: lib/simulator.py:34 +msgid "Speed up" +msgstr "" + +#: lib/simulator.py:34 +msgid "Press + or arrow up to speed up" +msgstr "" + +#: lib/simulator.py:35 +msgid "Slow down" +msgstr "" + +#: lib/simulator.py:35 +msgid "Press - or arrow down to slow down" +msgstr "" + +#: lib/simulator.py:36 +msgid "Pause" +msgstr "" + +#: lib/simulator.py:36 +msgid "Press P to pause the animation" +msgstr "" + +#: lib/simulator.py:37 +msgid "Restart" +msgstr "" + +#: lib/simulator.py:37 +msgid "Press R to restart the animation" +msgstr "" + +#: lib/simulator.py:38 +msgid "Quit" +msgstr "" + +#: lib/simulator.py:38 +msgid "Press Q to close the simulation window" +msgstr "" + #: lib/stitches/auto_fill.py:167 msgid "" "Unable to autofill. This most often happens because your shape is made "