CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
468 stars 27 forks source link

Jump stitches not being cut, but stitched #105

Open ddnnggmm opened 4 years ago

ddnnggmm commented 4 years ago

Please tell me if this is a "feature", or a bug, or a misunderstanding.

Tested on a Brother PR1050X.

The render of the Hello World shows red lines between shapes, implying that these are jump stitches that will be cut (unless I misunderstand).

Screenshot 2020-10-05 at 14 29 29

But the machine stitched the jump stitches.

IMG_0084

I checked on the machine's interface to make sure that "Thread Trimming" was enabled (see here).

Do I misunderstand something?

Thanks! David

stephanschulz commented 4 years ago

I am only a user of PE (not developer) but with a much simpler machine than yours. On my Janome I need to cut those jump threads by hand, which is easy since they are only attached on start and end points.

golanlevin commented 4 years ago

Sorry about the inconvenience. We have not had access to higher-end machines with e.g. automatic trimming features in order to test our library. I would guess that thread trimming is probably an "unimplemented feature" in PEmbroider, i.e. a place where our code is unfinished. There may be special jump codes that can be added to DST files in order to properly trigger the trimmer. We can have a look into this, but would be unable to test without your assistance.
One way you could help would be to process the DST file through your preferred software until it correctly trims the thread. Then we (well... @LingDong-) could do a bytewise diff to identify the magic codes.

ddnnggmm commented 4 years ago

Thanks for your input, Stephan. I snipped the threads, but the remaining thread isn't fixed to the fabric and starts to come loose with just a little movement of the fabric. This was especially noticeable on the single-line lettering, less so for the larger shapes.

ddnnggmm commented 4 years ago

Hi Golan! I'd be happy to help you test this. So I have PEmbroider export a DST, open it in PE Design, resave it as a DST, test that the threads are trimmed, and send to you if it works?

golanlevin commented 4 years ago

@ddnnggmm If I understand you correctly, we have a special command to help with the thread-coming-loose. Please check out the repeatEnd() command described here: https://github.com/CreativeInquiry/PEmbroider/issues/28.

Regarding the testing: YES, that would be the procedure, thank you for your generosity in helping us test. Please make sure the design is as simple and as minimal as possible, so that any changes in the file are easy to spot. Then upload both files (before/after) here, and we'll try to figure it out.

ddnnggmm commented 4 years ago

@golanlevin , PE Design reports "There is no sewing data" when I try to import the PEmbroider-generated DST. :-/ Running it through that online embroider converter produced a file that still had the jump stitches. I'd be happy to try other options you suggest.

Tried repeatEnd() but The function repeatEnd(int) does not exist. Do I need to compile the library from source?

LingDong- commented 4 years ago

Hi @ddnnggmm , cc @golanlevin

The correct functions are beginRepeatEnd(int) and endRepeatEnd(). There's an example here: https://github.com/CreativeInquiry/PEmbroider/blob/master/examples/PEmbroider_ruler/PEmbroider_ruler.pde

The DST format does support jumps, so I just added the feature to the encoder: f99966aa48c39db12078fd65b1bc9ab41021a6f2

Before this commit, jumps were already encoded when the distance between two stitches is too far, and DST cannot hold the offset value in one byte. So this commit only affects shorter jumps, which were previously ignored.

However I don't have the hardware to confirm.

Please let me know if there're any issues, thank you very much!

ddnnggmm commented 4 years ago

Thanks, @LingDong-, I'll give beginRepeatEnd() a shot. But do I understand that it only works for lines? It wouldn't cover, for example, the jumps in the cursive script that I showed in my screenshot above?

Is the DST update something I can test for you?

ddnnggmm commented 4 years ago

Hi @LingDong- and @golanlevin, I got around to trying a few things. Three things to report back.

1) Whatever @LingDong- did with the DST updates, PE Design 10 could now import a PEmbroider-generated DST without complaint. I then re-exported it as a DST, and am attaching that file here. However, when I embroidered that file there was no change in behaviour from before. It still stitched between shapes.

ruler20201027_resavedInPE.DST.zip

2) The PEmbroider-generated DST could not be opened by our Brother PR1050X. The display rendered a correct preview, but when I tried to import it, it produced the error

Cannot recognize the data for the selected pattern. The data may be corrupted.

So there's something it doesn't like in the file.

3) I tried embroidering the standard PEmbroider_ruler sketch, and the machine did not do any of the double-stitched repeatEnds that it was supposed to, either when it was fed a .PES, or when it was fed a .DST that had been resaved by PE Design.