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

Does not recognize DST trim command. #2

Closed
tatarize opened this issue Oct 27, 2017 · 3 comments
Closed

Does not recognize DST trim command. #2

tatarize opened this issue Oct 27, 2017 · 3 comments

Comments

@tatarize
Copy link

DSTs have a hacky sort of trim. They do series of jumps.
Jump: +2 +2
Jump: -4 -4
Jump: +2 +2

The net result is a jump of zero but this triggers a machine's trim.

Without libembroidery accepting that or allowing all jumps to be imply a trim (allow an option maybe) for DST it just makes stitches across the converted embroidery.

@tatarize
Copy link
Author

Turns out it's a bit simpler than that. Machines automatically trim after a number of jumps. If you add three jumps it tends to trim anyway. So basically 1 or 2 jumps will sew but between 3-8 or so it will always trim. So one could reasonably just imply a trim for any series of jumps because that's what the machines will do with that.

@JoshVarga
Copy link
Member

Right now in libembroidery this is commented out since it wasn't well tested. If you look in format-dst.c there are the following lines... (which assume 5 jumps is enough, but I believe is configurable on many machines)

/* if(flags & TRIM)
    {
        int v = 5;
        int dx = (int)(x/v), dy = (int)(y/v);
        for(i = 1; i < v; i++)
        {
            encode_record(file, dx, dy, JUMP);
        }
        encode_record(file, x - (dx * (v - 1)), y - (dy * (v - 1)), JUMP);
        return;
    } */

@robin-swift robin-swift added this to the Version 1.0 milestone Oct 27, 2021
@robin-swift
Copy link
Member

I'm making an executive decision to just include this code.

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

3 participants