Skip to content

Add native support for Brother/PES #138

Description

@maehw

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.:

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:

pes-poc.zip

This is what the file preview looks like in the Brother PED-Basic software (for the USB card writer):
pes-poc

I've been able to write the card with above PES file (see zipped attachment). A previous attempt looked like this:
there is no sewing data

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:
pes-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...
image

... 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:

  1. Support me in the PEC stitchlist encoding (turn the commands that TurtleStitch uses into PEC encoded stitches/ jump stitches)
  2. Add support for color changes
  3. Add support to generate PEC thumbnails (48 x 38 pixels for every thread color)
  4. 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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions