Code Monkey home page Code Monkey logo

Comments (7)

tatarize avatar tatarize commented on August 20, 2024

Also, I note that Wilcom software rather than a 1:1 ratio for the numbers in 1/10mm actually uses a 5:3 ratio.

from libembroidery.

robin-swift avatar robin-swift commented on August 20, 2024

Also, I note that Wilcom software rather than a 1:1 ratio for the numbers in 1/10mm actually uses a 5:3 ratio.

This seems like it's own issue, does Wilcom do this with all formats for just PCS?

We need a set of reference files that are CC-BY-SA or equivalent so we can resolve issues like this. I'll make that a new issue before resolving this one.

from libembroidery.

fabricocouto avatar fabricocouto commented on August 20, 2024

just ask me to send the files saved in wilcom and embird
[email protected]

from libembroidery.

tatarize avatar tatarize commented on August 20, 2024

Likely just PCS. It might actually be that PCS format is scaled like that natively. There's a few other formats with different coordinate systems that need to be correctly accounted for. I've not checked what the correct number of colors should be. But, the reading and writing didn't match up.

from libembroidery.

fabricocouto avatar fabricocouto commented on August 20, 2024

image
there is an error in the file reader that you haven't seen yet, it keeps the jumps out of the drawing this changes the x y sizes of the files, at least files saved by wilcom. as wilcom I consider it to be still good for development, it would be good to take wilcom as valid files

from libembroidery.

tatarize avatar tatarize commented on August 20, 2024

PCS as a file reader is absolute coordinate system. So I'd guess that that point is likely 0,0 and some 0,0 values are being fed in there.

from libembroidery.

fabricocouto avatar fabricocouto commented on August 20, 2024

I did something for a quick little test on the pcs reader but still with x and y size error but less than it was
of course it's wrong it was just a test, but it came pretty close to what it really had to be
still generates a null color

while (st_count < stitches_count)
    {
        FileSystem.FileGet(file, ref b8);
        FileSystem.FileGet(file, ref b0);
        FileSystem.FileGet(file, ref b1);
        FileSystem.FileGet(file, ref b2);
        FileSystem.FileGet(file, ref b3);
        FileSystem.FileGet(file, ref b4);
        FileSystem.FileGet(file, ref b5);
        FileSystem.FileGet(file, ref b6);
        FileSystem.FileGet(file, ref b7);
        flags = StitchType.fNORMAL;
        if ((b8 & 0x01) == 0x01)
        {

        flags = StitchType.fSTOP;
        }
        else if (b8 == 4 | b5 == 240 | b5 == 104)
        {
             flags = StitchType.fTRIM;
        }
        x = uint32(b0, b1, b2, b3);
        y = uint32(b4, b5, b6, b7);
        if (b1 != 0x0)
        {
            curx = x / 128;
            cury = y / 128 * -1;
            pattern.AddPointAbs(ref curx, ref cury, ref flags);
        }
        st_count++;
    }
  

 internal static long uint32(byte b1, byte b2, byte b3, byte b4)
{
    int x = (b1 & 0xFF) | (b2 & 0xFF) << 8 | (b3 & 0xFF) << 16 | (b4 & 0xFF) << 24;
    if (x > 8388607)
    {
        x = -(short)((int)(~x & 8388607) - 1);
    }
    else
    {
    }
    return x;
}

image

from libembroidery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.