libembroidery
libembroidery copied to clipboard
PES to SEW conversion not working
fresh build of libembroiderery on mac 12.1 but conversion from PES to SEW produces invalid results
Ok, can you show me the terminal output from the conversion?
Let's work this out.
%./libembroidery/embroider test.pes test.sew
test.pes
maybe I'm missing -t sew
?
No that should work. What's the file size of the output?
22KB (input PES is 117KB)
Does the sew file not load at all? Or is it incomplete?
using StitchBuddy, the PES previews fine but the SEW is blank. Trying to open it in StitchBuddy yields:
Ah, that's the error message I need. Can you paste the output of:
% xxd test.sew | head
I.e. the first 256bytes in hex format.
00000000: 6004 0000 0a00 0000 1d00 0000 2900 0000 `...........)...
00000010: 0100 0000 3a00 0000 1d00 0000 2900 0000 ....:.......)...
00000020: 0100 0000 4200 0000 1d00 0000 1e00 0000 ....B...........
00000030: 0100 0000 0c00 0000 1d00 0000 1e00 0000 ................
00000040: 0100 0000 4200 0000 1d00 0000 1e00 0000 ....B...........
00000050: 0100 0000 0100 0000 0100 0000 3200 0000 ............2...
00000060: 0100 0000 0100 0000 0100 0000 3200 0000 ............2...
00000070: 0100 0000 3200 0000 1d00 0000 3200 0000 ....2.......2...
00000080: 0100 0000 3200 0000 1d00 0000 3200 0000 ....2.......2...
00000090: 0100 0000 3200 0000 1d00 0000 3200 0000 ....2.......2...
I tried DST conversion but it doesn't work either and I get a lot of screen output:
libembroidery % ./embroider test.pes test.dst
test.pes
0 90.933333 19.111111 909 191 909 191
ERROR: format-t01.c encode_record(), x is not in valid range [-121,121] , x = 909
1 79.566667 16.722222 -113 -24 796 167
2 68.200000 14.333333 -114 -24 682 143
3 56.833333 11.944444 -114 -24 568 119
4 45.466667 9.555556 -113 -23 455 96
5 34.100000 7.166667 -114 -24 341 72
6 22.733333 4.777778 -114 -24 227 48
7 11.366667 2.388889 -113 -24 114 24
8 102.300000 21.500000 909 191 1023 215
ERROR: format-t01.c encode_record(), x is not in valid range [-121,121] , x = 909
[truncated]
Yeah, that's big jumps not being split properly. I know about that bug.
If you hang on 5 minutes I may work out what this colour change bug is.
Can you paste the output of
% ./libembroidery/embroider test.pes test.csv
% head test.csv
% head test.csv
"#","Embroidermodder 2 CSV Embroidery File"
"#","http://embroidermodder.github.io"
"#","General Notes:"
"#","This file can be read by Excel or LibreOffice as CSV (Comma Separated Value) or with a text editor."
"#","Lines beginning with # are comments."
"#","Lines beginning with > are variables: [VAR_NAME], [VAR_VALUE]"
"#","Lines beginning with $ are threads: [THREAD_NUMBER], [RED], [GREEN], [BLUE], [DESCRIPTION], [CATALOG_NUMBER]"
"#","Lines beginning with * are stitch entries: [STITCH_TYPE], [X], [Y]"
So what I want to see is slightly below that:
% head -n40 test.csv
% head -n40 test.csv
"#","Embroidermodder 2 CSV Embroidery File"
"#","http://embroidermodder.github.io"
"#","General Notes:"
"#","This file can be read by Excel or LibreOffice as CSV (Comma Separated Value) or with a text editor."
"#","Lines beginning with # are comments."
"#","Lines beginning with > are variables: [VAR_NAME], [VAR_VALUE]"
"#","Lines beginning with $ are threads: [THREAD_NUMBER], [RED], [GREEN], [BLUE], [DESCRIPTION], [CATALOG_NUMBER]"
"#","Lines beginning with * are stitch entries: [STITCH_TYPE], [X], [Y]"
"#","Stitch Entry Notes:"
"#","STITCH instructs the machine to move to the position [X][Y] and then make a stitch."
"#","JUMP instructs the machine to move to the position [X][Y] without making a stitch."
"#","TRIM instructs the machine to cut the thread before moving to the position [X][Y] without making a stitch."
"#","COLOR instructs the machine to stop temporarily so that the user can change to a different color thread before resuming."
"#","END instructs the machine that the design is completed and there are no further instructions."
"#","UNKNOWN encompasses instructions that may not be supported currently."
"#","[X] and [Y] are absolute coordinates in millimeters (mm)."
"#","[VAR_NAME]","[VAR_VALUE]"
">","STITCH_COUNT:","3896"
">","THREAD_COUNT:","251"
">","EXTENTS_LEFT:","-3499.600000"
">","EXTENTS_TOP:","-2996.000000"
">","EXTENTS_RIGHT:","3458.800000"
">","EXTENTS_BOTTOM:","4564.200000"
">","EXTENTS_WIDTH:","6958.400000"
">","EXTENTS_HEIGHT:","7560.200000"
"#","[THREAD_NUMBER]","[RED]","[GREEN]","[BLUE]","[DESCRIPTION]","[CATALOG_NUMBER]"
"$","1","32","100","120","f. Unimplemented for now.","an the header."
"$","2","58","32","101","mb-polyline.c embArray_create(), ","memory for heapPolylineObj
"
"$","3","0","0","0","Unknown",""
"$","4","58","32","37","d
Name : %s
","on : %s
Description: %s
Reade"
Oh dear, that's a new one. I've not cleared out the memory for the strings so it's got whatever rubbish is there.
I'm writing a patch that should help with this testing and fix some minor bugs, hang on.
Ok, git pull
and rebuild with cmake --build .
.
oh man... I'm not a dev, I'm a hack... this is gonna go horribly wrong :-)
EDIT: how do I git pull
for just libembroidery?
You've followed me to here I've not been confused by your replies at any point.
This is a good real world test of the software, so I'm enjoying it.
You do git pull
from inside the code directory.
So from where your terminal appears to be:
cd libembroidery
git pull
% ./libembroidery/embroider test.pes test.sew
test.pes
Debugging Information
number of colors = 251
number of stitches = 3896
Color: 0 1
Color: 1 1
Color: 2 1
Color: 3 1
Color: 4 1
Color: 5 1
Color: 6 1
[truncated]
same size SEW results file (22KB) and still 'blank' or invalid
Huh, now that's surprising.
How similar to your design is
number of colors = 251
number of stitches = 3896
I doubt it really is a 251 thread color pattern.
lol, indeed not: 2 colors
and how many stitches?

That's useful. I'm thinking...
Ok, so can I see the same hexdump for your input?
xxd test.pes | head
% xxd test.pes | head
00000000: 2350 4553 3030 3031 802f 0100 0100 0100 #PES0001./......
00000010: 0100 ffff 0000 0700 4345 6d62 4f6e 6500 ........CEmbOne.
00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000030: 0080 3f00 0000 0000 0000 0000 0080 3f00 ..?...........?.
00000040: d80e 4480 eba5 4401 0000 0000 0059 038e ..D...D......Y..
00000050: 0200 0000 0000 0000 0062 00ff ff00 0007 .........b......
00000060: 0043 5365 7753 6567 0100 1d00 0200 ac01 .CSewSeg........
00000070: b9fe 0400 51ff 0380 0000 1d00 872c 0400 ....Q........,..
00000080: 51ff 0000 52ff 0400 51ff 0000 52ff 0400 Q...R...Q...R...
00000090: 51ff 0000 52ff 0a00 5cff 1500 67ff 2300 Q...R...\...g.#.
Ok, so I think I can offer your workflow a solution quicker than fixing this. Then fix this at a later date.
Can you output from your design software in Tajima .dst
? Then do the conversion to .sew
.
OK, I'll try that but it will take me some time to wrestle Inkstitch into submission, again. Thanks for your support. I'll post my results here hopefully later tonight.
I'll open an new issue... use #191