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

*.spx as export format #588

Open
Polarigel opened this issue Dec 14, 2019 · 20 comments
Open

*.spx as export format #588

Polarigel opened this issue Dec 14, 2019 · 20 comments
Labels
feature request Tag single request for new features with this file format

Comments

@Polarigel
Copy link

Pfaff Expression Line Sewing Machines can import stitches, but only in *.spx format. Would it be possible to add *.spx as an export format in Inkstitch?

As far as I can see, only really expensive and complicated embroidery software as Embird can save in *.spx.

Thank you

@lexelby
Copy link
Member

lexelby commented Dec 14, 2019

Hi! Thanks for trying Ink/Stitch.

We can add support for SPX format, but the hard part is that Pfaff doesn't document how their file format works. If anyone can find a document explaining the file format, that would make adding it a ton easier.

It's a shame that your machine doesn't support other file formats. Lots of machines support DST, and other Pfaff machines support VP3 (I think).

@Polarigel
Copy link
Author

Polarigel commented Dec 14, 2019

It's a shame that your machine doesn't support other file formats.

I agree.
I just contacted Pfaff and asked for format specifications. Maybe I will get an answer....

@Polarigel
Copy link
Author

I was i contact with Pfaff. They might look into it and asked for a contact person in InkStitch. I gave them the link to this feature request.

@lexelby
Copy link
Member

lexelby commented Dec 21, 2019

Wow, great! You can also give them the email address inkstitch at lex dot gd, which goes to me.

@kaalleen kaalleen added the feature request Tag single request for new features with this label Apr 12, 2020
@kaalleen
Copy link
Collaborator

Great news, @tatarize is working on this issue: EmbroidePy/pyembroidery#92

@kaalleen kaalleen added this to features in Feature Requests May 16, 2020
@kaalleen kaalleen moved this from tasks / features to File Formats / Output in Feature Requests May 19, 2020
@chrikoehn
Copy link

chrikoehn commented Jan 10, 2022

I looked at a few spx files and the reader in EmbroidePy and here's a yet incomplete specification:

  • File starts with format declaration: %spx%
  • The structure between format declaration and pattern start is yet unclear. It contains a comment (program which created the file) and probably size and pattern information.
  • Pattern starts at 0x11E. The rest of the file contains stitch commands.
  • Each stitch command consist of 9 bytes: 2 bytes start marker (0x802f), 2 bytes dy, 2 bytes dx, 1 byte "c" (is substracted from dy in the reader; it's 0x00 in the example files I have), 2 bytes end marker (0x800f)

So, what's the best way to continue from here? Was there any further response from Pfaff? I'm tempted to try a spx file with an empty "comment and info" part of the file and see what the machine does with it.

@LukasGossmann
Copy link

Sorry to respond to such an old issue but i recently got access to a PFAFF quilt expression 720 however the file format you describe does not match the spx files that are included in the firmware of my machine...

Most of the simpler stitches are way shorter then the 0x11E offset at which the pattern starts in your case.
Also i am not able to find the start and end marker of the stitch commands.
The header matches what you describe (%spx% and comment).
BTW. the comment string is prefixed with the length of the comment in bytes (16bit integer).
That might be useful to know in the future if a writer is planned for this file type.

2 Bytes	Produced by length	00 38 (56 Bytes)
56 Bytes	Produced by			(. is hex 00) .P.r.o.d.u.c.e.d. .w.i.t.h. .V.S.M._.S.D. .l.i.b.r.a.r.y

Once my network adapter arrives and i can SSH into the machine i might be able to provide more information on how this file format works. The main executable looks like its really verbose with its logging output.
Meanwhile i can offer to send you some more spx and some sfx (font files for embroidering text) to look at.
If i find out anything about the format i will add the information to my repository on this machine (still very wip)
https://github.com/LukasGossmann/pfaff-quilt-expression

@Polarigel
Copy link
Author

I'm really pleased that you respond to that old issue- as it is still unsolved! I just send another message to Pfaff informing them that there is new activity on this issue.

@LukasGossmann
Copy link

If Pfaff would be willing to at least provide some information on the file structure that would be very helpful. I'm a bit lost on how to start reverse engineering the file format due to having no experience with what kind of data a sewing machine needs to do its job :)
However with SSH access now working i can a least create some custom stitches and extract them from the machines internal storage to be able to look at the data.

@lexelby
Copy link
Member

lexelby commented Apr 30, 2022

Wow, you can SSH into Pfaff embroidery machines??

I'm afraid that at present, we're low on developer time, so we probably won't be able to help you with this effort. But if you do figure out the format, we'd gladly accept a PR over at https://github.com/inkstitch/pyembroidery . Thanks for your interest :)

@LukasGossmann
Copy link

In case of the machine i have yes you can. Its just a (very slow) linux computer in a weird case. The machine itself has a usb host port which allows you to plug in anything you want granted that this very old and cut down version of linux has a driver for it.
If you are interested on how i did figure out all that you can check out my repository about this machine.
I also try put all the information I'm able to find out in there.
https://github.com/LukasGossmann/pfaff-quilt-expression

I don't really have any experience working with python but that should be easy to figure out if i get anywhere with figuring out the format :)

@viceversa3
Copy link

Hello, I don't know anything about coding but I own a PFAFF sewing and embroidery machine. I'd like to be able to design sewing stitches as I actually design embroidery files with Inkstitch. If you're interested, I can download from the machine some stitches at the spx format for you to "dissect". Unfortunately, that all I can do to help, though I could test some files on my machine.

@LukasGossmann
Copy link

Would you mind sharing which exact model your machine is ? If its something else then a quilt expression 710 or 720 id be really interested in getting some sample files from your machine. If so feel free to open an issue in my repo to share your files. Also how are you able to download stitches from your machine ? With the machine (quilt expression 720) i have its not possible to copy stitches to the usb drive.

@viceversa3
Copy link

yes I have a creative 3.0. I'm not at home but will be at the beginning of next week. I have a few spx on my computer (they were shared by a friend). It's possible to copy the stitches on my usb stick I think At least, I can use the stitch creator, or sequencer and then copy them on my USB stick I should think. I'm sorry but I'm not used to github and I don't know how to get to your repo. It will be easier to tell when I'm in front of my machine :)

@LukasGossmann
Copy link

I just had a quick look at the firmware of your machine and I'm not even surprised. Its mostly the same as the one on the 720. That also includes the USB stick "hack" for getting into debug mode and enabling ssh. Interestingly enough the 720 can preview the quilt designs in vp3 format of your machine but not open them. It also looks like most if not all of the hardware in them is exactly the same (cpu and coprocessor) which makes me wonder what would happen if i were to run the creative 3.0 firmware on my quilt expression 720 :D

Here is a link to my repo: https://github.com/LukasGossmann/pfaff-quilt-expression

@viceversa3
Copy link

Do you like me to put some of the spx files I've got on my computer ? I think they come frome a Husqvarna sewing machine (though I'm not 100% sure of where they come from) . A friend of mine gave them to me. They come in the spx format.

@LukasGossmann
Copy link

LukasGossmann commented May 24, 2022 via email

@punchinist
Copy link

I'm coming into this very late from a google search, but if there is still interest here I can provide several types since I am interested in deciphering this format as well, which is how I ended up here.
There are several different "flavors" of spx files as far as I know, the husqvarna viking machines use a form of spx but encoded in a different way so that they are not compatible with pfaff machine stitches, or able to use stitches created externally in software (the ability to create custom stitch files has been exclusive to pfaff even though the same company produces viking and pfaff machines and they share much of the same hardware and software for many years now), and are indicated by having an .sh7 file extension if you export them from the machine, even though they have the spx header within the file.

The pfaff machine stitches that are built-in are significantly more compact data in comparison, if you take the same exported stitch, even a simple one like a zig-zag, the viking "version" will contain significantly more data.

In addition, the spx files that are created in software on the computer to be loaded on the machine are somewhat bigger, I think that maybe there must be some difference between a stitch file that is still editable vs one that is "finalized" for the machine.

There is also probably some way that they are differentiated as either a maxi (large area with side motion) stitch, 9mm stitch, or a standard stitch, as they used to be separated as different format files in their older software (90s/early 00s) but can now all be contained in an spx file.

Let me know if any of you still have interest in getting any of these types of files, and how to get them to you. I exported a lot of basic stitches in hopes of trying to decipher them, but just haven't had the time or brainpower and ended up moving on to other things.

@miaowangtw
Copy link

miaowangtw commented Oct 20, 2023

Very happy to know that someone still interested in this issue. I bought a Pfaff 720 recently. As a software programmer, I am very interested to explore the format of .spx file. @punchinist, could you please send your example files to my email. Thank you.

@viceversa3
Copy link

Hello, I have a creative 3.0 and would be very happy to provide samples of stitch that are build in my machine as, unfortunatelly, I can't code. I'd like to be able to create spx files for my machine with Inkscape and, of course, Inkstitch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Tag single request for new features with this file format
Projects
Feature Requests
File Formats / Output
Development

No branches or pull requests

8 participants