CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
442 stars 28 forks source link

Please add .EXP, .JEF, and .XXX file export #32

Closed golanlevin closed 4 years ago

golanlevin commented 4 years ago

Hi @LingDong- , I have started to announce PEmbroider on Twitter and there is a strong positive response. We made good choices by selecting .PES and .DST. But there are a few people who would like to help us do testing, whose machines only support other formats. Could you please add support for .EXP, .JEF, and .XXX? Once we do this, we should have all of the necessary formats covered. Here's code for the three formats:

https://github.com/EmbroidePy/EmbroideryIO/blob/master/core/src/main/java/org/embroideryio/embroideryio/ExpWriter.java https://github.com/EmbroidePy/EmbroideryIO/blob/master/core/src/main/java/org/embroideryio/embroideryio/JefWriter.java https://github.com/EmbroidePy/EmbroideryIO/blob/master/core/src/main/java/org/embroideryio/embroideryio/XxxWriter.java

The .XXX format is for Singer sewing machines. It seems inappropriate, but it is true.

The online viewer at https://htmtopdf.herokuapp.com/embroidery/ is able to handle all of these formats, for output verification.

Thank you! Golan

LingDong- commented 4 years ago

@golanlevin Glad to hear people are excited!

JEF format now added: d6ae6a6f802a21ce2a476f168b701255fb9ab316

Screen Shot 2020-06-18 at 5 47 39 PM

One issue is that JEF cannot encode stitches longer than 128 horizontally or vertically (yeah they store dx dy in an Int8). My current hack is to divide up the stitch into smaller steps, which works fine but it might be a problem if it is a connecting stitch that user want to remove afterwards.

Will add the EXP and XXX too!

LingDong- commented 4 years ago

EDIT: I think I fixed the above JEF issue by using JUMP command instead of STITCH command for the small in-between steps. lol.

danzeeeman commented 4 years ago

I'm sure you have seen this for file conversion? https://github.com/EmbroidePy/EmbroideryIO

On Thu, Jun 18, 2020 at 5:59 PM Lingdong Huang notifications@github.com wrote:

EDIT: I think I fixed the above JEF issue by using JUMP command instead of STITCH command for the small in-between steps. lol.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CreativeInquiry/PEmbroider/issues/32#issuecomment-646326725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFPVTANOZSD7CXIB37UFS3RXKE3XANCNFSM4OCC46LA .

-- Dan Moore makeitdoathing.com @theDANtheMAN dan@makeitdoathing.com

LingDong- commented 4 years ago
Screen Shot 2020-06-18 at 6 07 17 PM

3ef0e771ce5b1c17b3773566b6f5281f27088d3e EXP added too! What a simple format

golanlevin commented 4 years ago

@danzeeeman Yes, we are using their code for the conversions.

LingDong- commented 4 years ago

@golanlevin

All done! XXX now added: 41b73b9d0b99a3f1ef5de823c895c807893cd6ab

The Viking app cannot read the XXX output, only the online viewer can. I downloaded some sample XXX which can be opened by Viking app and inspected the raw bytes. Seems like even constant bytes are different from what EmbroideryIO writes, so apparently it's a different "version" of XXX that Viking couldn't understand.

The online viewer can read the output, but there're a couple oddities: XXX encoding for "long stitches" beyond 128 cannot be understood by the online viewer, so I used my JUMP steps trick for JEF again, which solves it. The online viewer seems to misinterpret COLOR_CHANGE command, so I replaced them with TRIM, which should functionally be the same. (?)

I couldn't find any other documentation/specification for XXX online (the name is also hard to search for for some obvious reasons). So we might need people with real hardware to confirm that my writer truly works.

Screen Shot 2020-06-18 at 7 13 37 PM
golanlevin commented 4 years ago

Perfect, thanks @LingDong-! There are some folks with Singer machines interested so we'll have them test the .XXX file format. What a funny situation, looking for xxx files.