-
-
Notifications
You must be signed in to change notification settings - Fork 17
Description
TL;DR: I've started to add support for the Brother/PES file format, but I am stuck - and I am looking for other people to help!
First of all, thanks for the nice project!
I've discovered TurtleStitch thanks to Margaret J. Low who posted about it in the fediverse: https://chaos.social/@megjlow@fosstodon.org/113605225298852491
Nice to see it published under an open source license so that everyone can share & improve it.
I am an embedded software engineer and I am a noob with machine embroidery. However, I recently got myself an old Brother PE-150 machine for a reasonable price! The machine is very old and it doesn't have a USB port - instead it has those proprietary memory cards. There are cards which you can program with a card writer sold by Brother and their (free) PED-Basic software for Windows. Long story short: these machines only support the PES file format.
Interestingly, there's https://github.com/EmbroidePy/pyembroidery (CC @tatarize). I guess it could by used to convert the currently supported file formats (i.e. Melco/EXP and Tajima/DST). However, I'd not be too happy with the workflow and I'd prefer to export to Brother/PES directly from TurtleStitch (i.e. the JavaScript code running in the webbrowser).
There's plenty good ressources about the PES and PEC file formats in the web, e.g.:
- https://edutechwiki.unige.ch/en/Embroidery_format_PES
- https://edutechwiki.unige.ch/en/Embroidery_format_PEC
- https://github.com/frno7/libpes/wiki/PES-format (CC @frno7)
I've forked this repository and created a branch to work on the PES format support. You can find it here: https://github.com/maehw/turtlestitch/tree/pes-support (haven't created a PR yet a
s work isn't finished; but I can so that you can easily see the changes I made so far).
I've been able to provide a proof of concept for PES files. Use this artifact at your own risk:
This is what the file preview looks like in the Brother PED-Basic software (for the USB card writer):

I've been able to write the card with above PES file (see zipped attachment). A previous attempt looked like this:
The preview image is still blank - I guess it would be generated by the PED-Basic software itself from the actual PES sections.
In the PEC file, I've included a dummy chessboard alike pattern:

I've also dared to stitch the actual dummy pattern (a few diagonal short stitches)... and it seemed to work!
What did I do? I've added a button to the GUI...

... and a method to stitchcode/turtleShepherd.js to do the PES file format encoding: https://github.com/maehw/turtlestitch/blob/pes-support/stitchcode/turtleShepherd.js#L846
I am looking for other developers who are willing support me in this task.
Where I am currently stuck:
I cannot access this.cache (resp. this.cache.length) in the method. What do I need to change? Consider me being more or less a beginner with JavaScript.
Nice to have but the next steps would also be interesting:
- Support me in the PEC stitchlist encoding (turn the commands that TurtleStitch uses into PEC encoded stitches/ jump stitches)
- Add support for color changes
- Add support to generate PEC thumbnails (48 x 38 pixels for every thread color)
- Add support so that PED-Basic will also generate proper thumbnail images (probably requires to add data in the PES v1 part of the file; I am currently using the bare minimum in the PES part as this should only be really necessary if someone wants to open the files in a design software)