Last active
July 15, 2019 18:50
-
-
Save jacobian/5b0d04d0a58a6b236e3fa172a969fac5 to your computer and use it in GitHub Desktop.
Revisions
-
jacobian revised this gist
Jul 15, 2019 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,9 +24,7 @@ # / \ # 3 -- 2 remember: +x is to the right, +y is down pattern.move_abs(x * SIZE, y * SIZE) # <--- this sucks at the end of a row, generates a huge jump :( pattern.stitch(SIZE, SIZE) pattern.move(-SIZE, 0) pattern.stitch(SIZE, -SIZE) -
jacobian created this gist
Jul 15, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ import pyembroidery as em pattern = em.EmbPattern() # units are in 1/10mm # max size in DST is 12mm so if we go bigger need to fuck with max_stitch SIZE = 32 # start with a stitch at the origin to get the needle down (see the docs) pattern.stitch_abs(0, 0) # stitch a 10x10 block # do y first so we stitch across then down # this doesn't really matter though for y in range(5): for x in range(5): # A single stitch: # # 1 4 1. jump to start of stitch (1) # \ / 2. 1. stitch diagonal down (1 -> 2) # \/ 3. jump back left (2 -> 3) # /\ 4. stitch diagonal up (3 -> 4) - next stitch starts here usually # / \ # 3 -- 2 remember: +x is to the right, +y is down pattern.move_abs( x * SIZE, y * SIZE ) # <--- this sucks at the end of a row, generates a huge jump :( pattern.stitch(SIZE, SIZE) pattern.move(-SIZE, 0) pattern.stitch(SIZE, -SIZE) # XXX repeat a few times? # causes difficulty in stitch routing # tie off and cut (don't know if cut works) pattern.stitch(0, 0) pattern.trim() pattern.end() em.write_pes(pattern, "pattern.pes")