Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trims not working in .JEF files #377

Closed
lexelby opened this Issue Jan 10, 2019 · 20 comments

Comments

Projects
None yet
2 participants
@lexelby
Copy link
Member

lexelby commented Jan 10, 2019

Described in #374 (comment), it seems that TRIM commands aren't working in JEF files. The same design saved to DST on the same machine trims properly.

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Jan 10, 2019

@jameskolme What is the model of the Janome machine you were testing on?

@lexelby lexelby referenced this issue Jan 10, 2019

Open

QR code #374

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Jan 10, 2019

Could someone create a simple design in another digitizing program and save it as DST, JEF, and PES? It would need to have a couple of trims in it so that I can see how they're encoded in the JEF file.

@jameskolme

This comment has been minimized.

Copy link

jameskolme commented Jan 10, 2019

Janome MC500

Some example files again with 3 lines theory. This is from Embroideryware, all exports including svg.
EW 3 lines.zip

.jef works and trims from program, but .dst shows 3 different colors on machine, so it might not be best example. There should be only single color, doh!

It might be good to get second example, if possible, using some expensive program that actually works.

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Jan 12, 2019

I just bought a 400e, so I'll be able to debug this issue directly :D

@jameskolme

This comment has been minimized.

Copy link

jameskolme commented Jan 12, 2019

Wohoo \o/

Not much have changed:
http://www.sewvacdirect.com/content/Comparison%20Chart%20400E%20vs%20500E.pdf
Biggest difference is maximum hoop size, but I think 7.9” x 7.9” is plenty. I really like trim and advanced needle threader.

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Jan 12, 2019

How does the needle threader work? Is it a lever you push down?

@jameskolme

This comment has been minimized.

Copy link

jameskolme commented Jan 12, 2019

Yes, seems to be same threader and after I fixed it, now works every time. First it just barely worked time to time, every time small hook hit side of needle and most likely jumped out right side of needle. There are no guides how to fix this, but hook itself is quite soft material at the bottom or place where it starts. Put small flat screwdriver exactly where hook starts and it can be bend slightly, just by twisting screwdriver slightly. I did extensive google for this and seems to be surprisingly common issue to not work properly. I was amazed there was nothing to adjust this properly, like adjustment screw or something behind plastic cover.

@jameskolme

This comment has been minimized.

Copy link

jameskolme commented Jan 15, 2019

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Jan 17, 2019

Oh wow, this machine is so nice :D

I just got it and gave it a go. Super fast, and like you said, trims work great in DST files. I agree that the thing where it doesn't read trims from the file in the auto setting is weird, but whatever. It looks like if you do manual setup and set the jump trim to the max, it just turns off jump trimming, and then you can have only cut commands. Works for me. I'll get the pyembroidery fix merged tomorrow.

About the thread trimmer: I think I need some practice. It seems like most of the time it just tears the thread. Any tips? I'm considering just using a separate wire needle threader :P

@jameskolme

This comment has been minimized.

Copy link

jameskolme commented Jan 17, 2019

I have noticed at certain thread, it will tear it sometimes, hook wants to hold maybe too much, but I'm not complaining :) It might help if thread is not fully inserted to last ymmmm "holding place or gripper" Last gap before routing thread to manual cutting blade.

DST works directly, only thing is, I can make bad DST files too without actual error messages. Not sure if Janome is super picky about file formatting. Something to do with auto route (possibly), but let's fix JEF first and see what is what. I have excellent QR-code ready for test.

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Feb 4, 2019

I was doing it wrong. :) As you know, one is supposed to pass the thread from left to right under the hook, rather than right to left as I had been doing. Works great now.

Sorry I still haven't gotten to the bottom of this JEF issue. Things have been super busy here, but I'm hoping to spend some time working on this soon.

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Feb 4, 2019

Interesting. Looking at the JEF file from Embroideryware in a hex editor, it looks to me like it's encoded as 3 colors, but all with the same thread color. In other words, it's encoding a TRIM as if it's a COLOR CHANGE to the same color. I do see the 0-length jump that tatarize was talking about, but that may be a red herring.

@jameskolme Could you create a JEF file that is 3 lines of different colors? I want to see what a normal color change looks like.

@jameskolme

This comment has been minimized.

Copy link

jameskolme commented Feb 4, 2019

3 colors.zip

I'm wondering is there anything else affected, trim using color change or do actual programmed trim.

Tatarize made it work, hopefully it was this:
3chv-trim.zip

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Feb 5, 2019

I grabbed a trial of EmbroideryWare. How do I set a trim after an object?

@jameskolme

This comment has been minimized.

Copy link

jameskolme commented Feb 5, 2019

Directly from support: just alternate between "TopStitches" and "TackDown" and thread trim will be placed.

(If lucky!)

Sometimes dummy stitches are needed to trigger trim when needed and sometimes there is no way to trim anything. Before this gets 100 pages long rant, I just like to refer this program as my embroidery learning money.

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Feb 6, 2019

Okay, I got it! Just like in a DST file, three jumps in a row equals a trim in a JEF. In fact, it actually seems to be three "commands" in a row that trigger trimming. So "color change, jump, jump" will cause a trim.

This holds true even if the color change is to the same color. If the JEF file has a color change from black to black, the machine will not count that as an actual color change; it just continues sewing.

Just doing a color change to the same color is not enough though. There have to be at least two trims afterward. Embroideryware throws in five jumps after the pretend color change (just to be sure, I guess?).

Those jumps are allowed to be zero-length. That's why tatarize originally thought a zero-length jump is a color change, because embroideryware does use zero-length jumps to ensure that it has enough jumps in a row. This also explains why the current code only sometimes trims: it will only trim if there are a couple more jumps after the trim point, which would force three in a row.

There's one more detail that I've discovered: it's not possible to have two stitches more than 2 inches apart (exactly 2.0") without triggering a trim. The only way to do it is to turn off "trim at cutting command" in the settings. This is because jumps and stitches of 12.7mm, and 2.0 inches is the furthest you can separate stitches before you're forced to put three jumps in a row to get from one stitch to the next.

Okay, I got a little into the weeds there, sorry!

Bottom line is, I've solved it, and now I just need to code it. There really is no substitute for having a real machine in front of me to experiment with!

@jameskolme

This comment has been minimized.

Copy link

jameskolme commented Feb 6, 2019

Excellent work. Have you tested does pause command work?

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Feb 6, 2019

As far as I know, single-needle machines don't support a pause command. You can just create a color change in your design which will pause the machine.

Of course, Janome does have multi-needle machines like the MB-4S, and I believe they also take JEF files. From reading the instruction manual awhile back I think I remember that you assign a pause at the machine, by setting a given color change as a pause. So Ink/Stitch's normal pause handing will work fine, because it inserts an extra color change.

Well, there is one issue. I've seen that the 400e ignores a color change of you change to the same color. JEF has a specific palette of thread colors that it supports. If you have two consecutive colors in your design that are very similar, so that they get encoded in the file as the same color, I bet that the machine will ignore the color change. I'll need to make pyembroidery detect that and shift one of the colors just a bit to force a real color change.

Does anyone have access to an MB-4S or MB-7 that we can test with?

@lexelby lexelby referenced this issue Feb 8, 2019

Merged

bug fixes #364

@jameskolme

This comment has been minimized.

Copy link

jameskolme commented Feb 13, 2019

This is not an issue or anything, but I noticed strange behavior. Machine Janome 500e, if programmed trims are present on program and there still are places where auto trim should work, no programmed trims and jumps over 3mm. This situation makes auto trimming very unreliable, might work on some places and simply jump others. So quick copy/paste with known auto trim program is not good idea to mix it in with programmed trim program. This is probably why programmed trims are disabled by default, undocumented feature or something. Attach trim command now works nicely so this is not so big issue and is related to machine anyway.

@lexelby

This comment has been minimized.

Copy link
Member Author

lexelby commented Feb 15, 2019

Huh, that's weird. Is that the case only for files produced with Ink/Stitch, or with files from other software too? I want to make sure this isn't a case of Ink/Stitch still doing something wrong in the JEF file format.

@lexelby lexelby closed this in #364 Feb 16, 2019

lexelby added a commit that referenced this issue Feb 16, 2019

v1.22.0: tons of bug fixes!
Bug fixes:
  * properly handle black fill (#362)
  * don't create paths with empty "d" attribute when importing DST, PES, etc (#363)
  * properly encode trims in JEF files (#377)
  * significantly improve error messages for crashes in auto-fill
  * informative error message for auto-fill of extremely tiny shapes
  * fix file corruption in "Save As" JEF, DST, etc (all formats) (#387)
    * Ink/Stitch was erroneously adding a carriage return at the end of the file
  * fix print metadata (#372)
  * fix adding presets in Params (#381)
  * fix crash if fill start and end points are very close
  * don't crash on a design with no stitches
  * support manual stitch paths with a single stitch

New feature:
  * option to skip the last stitch in each row of fill stitch
    * usually that stitch is unnecessary and will be very close to the stitch at the start of the next row
    * this can reduce stitch count for "free" in most cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.