Embroidery format EXP
EXP format is one of the most pure and simple embroidery formats.
- There is no header only stitches.
- All stitches are relative to previous location.
- The maximum distance in any direction is 127.
- All stitches are stored X,Y in 2s complement 8 bit bytes.
- If the value of X = -128 aka 0b10000000, this triggers a control event, the type being denoted by the Y value.
|?||?||?||?||?||?||?||?||?||?||?||?||?||?||?||?||Stitch X, Y (unless x7-x0 == 0x80)|
|1||0||0||0||0||0||0||0||1||0||0||0||0||0||0||0||0x80, 0x80: END|
|1||0||0||0||0||0||0||0||0||0||0||0||0||1||0||0||0x80, 0x04: JUMP|
|1||0||0||0||0||0||0||0||0||0||0||0||0||0||0||1||0x80, 0x01: COLOR_CHANGE / STOP|
|1||0||0||0||0||0||0||0||0||0||0||0||0||0||1||0||0x80, 0x02: STITCH|
In uncaught cases the odd numbers are color changes, and the even numbers are stop. This seems to work fairly properly. Further study might be required.
There's some instances of other control codes being found. 0x80, 0x06 for example.
To properly not loose the initial position stitch it's correct to add a stitch location 0,0 after a series of jumps. So if we jump +20,+20 several times 0x80, 0x04, 20, 20 -- 0x80, 0x04, 20, 20 -- 0x80, 0x04, 20, 20, -- 0, 0 This means jump +20,+20, three times, then stitch at the new location there. Note, each jump is prefixed with the command codes 0x80 0x04 to say this is not a stitched location.