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

I'm unable to write jump stitches without trims in PES format #156

Open
talljosh opened this issue Nov 1, 2022 · 2 comments
Open

I'm unable to write jump stitches without trims in PES format #156

talljosh opened this issue Nov 1, 2022 · 2 comments

Comments

@talljosh
Copy link

talljosh commented Nov 1, 2022

I have an EverSewn machine which in theory can trim the thread, but in practice, doing so often results in bird nests that jam the machine.

I wrote a small script that uses pyembroidery to duplicate an EmbPattern but filters out any TRIM commands.

The issue I'm facing is that the PES/PEC exporter seems to ignore TRIM commands, and just trim on every JUMP. In PecWriter.py:

        elif data == JUMP:
            jumping = True
            if init:
                write_jump(f, dx, dy)
            else:
                write_trimjump(f, dx, dy)

        …

        elif data == TRIM:
            pass

(I initially thought I was having the same issue with the JEF file format, but it turns out the TRIMs were being added by the JEF importer not the exporter, and I was able to avoid that with the trim_distance setting.)

@tatarize
Copy link
Contributor

tatarize commented Nov 3, 2022

The PES/PEC I think has some flag there. But, it seemed like flagging it trimjump was fairly correct. The trim command itself doesn't have an analog. Only trimjump. I could totally tweak it to allow an option of suppressing that and just writing pure jumps each time. Really I'm not entirely sure of the providence of flag for jump without flagging the trim. Libembroidery had most of this info, and copying other writers and parsing through that data seems to suggest that that is how the data should be written.

I'm more than happy to add in some options if it'll let you tweak around this problem. My best suggestion would be to likely just go ahead and tweak the script and delete the if init: and else: write trimjump bits. That avoid writing the flag. I called the flag there trimjump because that's what libembroidery called it, but wrote it out like that consistently because some writers like Wilcom probably did writing like that.

Trims have always been iffy. Most machines don't have them and when they do they often interpolate them and try to figure out where to put them. So there's a solid chance it's your machine adding them and it might be hard to suppress them, and this might not actually do anything. But, if this fixes any problem you have I'm more than happy add that in as a version or an option to the PES writer. The JEF format doesn't really write trims either, or at least has it's own oddities there.

@talljosh
Copy link
Author

talljosh commented Nov 4, 2022

Ok, I've found a setting on my machine that turns off auto thread trimming on long stitches. So now I just want to make sure that the input file doesn't instruct my machine to trim in other places.

Are you saying that the "trimjump" flag may not actually signal a trim, it might just be a naming convention?

I've updated my local code to this:

    # init = True
    jumping = Truefor stitch in stitches:
        …

        elif data == JUMP:
            jumping = True
            if not trimming:
                write_jump(f, dx, dy)
            else:
                write_trimjump(f, dx, dy)

        …
        elif data == TRIM:
            trimming = True
            continuetrimming = False

It's probably overkill for what I want, but that way I can insert TRIM commands if I choose to.

I guess an option for this may be helpful. But perhaps I should do a few test PES files first with and without the trimjumps and see what my machine does with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants