Difference between revisions of "Projects/Liberty/File Formats/Viking Pfaff"
Purple-bobby (talk | contribs) (→Thread: add total displacement) |
Purple-bobby (talk | contribs) |
||
Line 1: | Line 1: | ||
== Viking/Husqvarna Pfaff/Singer 3 VP3 == | == Viking/Husqvarna Pfaff/Singer 3 VP3 == | ||
− | The VP3 file format appears to be series of nested sections. | + | The VP3 file format appears to be series of nested tagged sections. The files seen so far, start with a header of signature bytes and "Produced by..." string; followed by a tagged embroidery-summary packet. Like Russian dolls, the embroidery-summary packet contains a tagged hoop-centred packet after some information about stitched area, stitching time, etc. The hoop-centred packet expresses a centred stitch extent and contains several tagged thread packets. Each thread packet has colour and weight information, also containing one stitch-rum packet. |
− | + | The file format could logically contain several embroideries, and each embroidery contain more then one hoop, but this has not been seen. Perhaps to contain a library of patterns, or to split a large design over several hoops. | |
− | + | The tags seen, so far, are, | |
+ | * 0 2 0 - Embroidery-summary packet | ||
+ | * 0 3 0 - Hoop-centred packet | ||
+ | * 0 5 0 - Thread packet | ||
+ | * 0 1 0 - Stitch-run packet | ||
− | |||
− | + | In the style of Backus–Naur Form, | |
− | |||
− | |||
− | + | File = File-header Embroidery-summary | |
− | + | Embroidery-summary = Summary-details {Hoop-centred} | |
− | + | Hoop-centred = Hoop-details {Thread} | |
− | Stitch | + | Thread = Thread-details Stitch-run |
===File-header=== | ===File-header=== | ||
Line 36: | Line 37: | ||
| N1 | | N1 | ||
| N-WStr | | N-WStr | ||
− | | Producer 16 bit big-endian length in bytes followed by 16 bit characters | + | | Producer-string 16 bit big-endian length in bytes followed by 16 bit characters |
|- | |- | ||
| 6+N1 | | 6+N1 | ||
Line 44: | Line 45: | ||
|} | |} | ||
− | === | + | ===Embroidery Summary-details=== |
{| class="wikitable" | {| class="wikitable" | ||
| Offset | | Offset | ||
Line 54: | Line 55: | ||
| 3 | | 3 | ||
| Tag | | Tag | ||
− | | | + | | embroidery-tag 0 2 0 three bytes |
|- | |- | ||
| 3 | | 3 | ||
| 4 | | 4 | ||
| Length | | Length | ||
− | | | + | | embroidery-len remaining bytes in this packet |
|- | |- | ||
− | | | + | | 7 |
| N2 | | N2 | ||
| N-WStr | | N-WStr | ||
− | | | + | | settings-string human readable debugging notes |
|- | |- | ||
| 7+N2 | | 7+N2 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | extent-right right edge of stitching in um starting from 0,0 |
|- | |- | ||
| 11+N2 | | 11+N2 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | extent-top |
|- | |- | ||
| 15+N2 | | 15+N2 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | extent-left |
|- | |- | ||
| 19+N2 | | 19+N2 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | extent-bottom |
|- | |- | ||
| 23+N2 | | 23+N2 | ||
| 4 | | 4 | ||
| Count | | Count | ||
− | | | + | | stitch-time-count time estimate in stitches |
|- | |- | ||
| 27+N2 | | 27+N2 | ||
| 2 | | 2 | ||
| Count | | Count | ||
− | | | + | | thread-change-count |
|- | |- | ||
| 29+N2 | | 29+N2 | ||
Line 107: | Line 108: | ||
|} | |} | ||
− | ===Hoop- | + | ===Hoop-details=== |
{| class="wikitable" | {| class="wikitable" | ||
| Offset | | Offset | ||
Line 117: | Line 118: | ||
| 3 | | 3 | ||
| Tag | | Tag | ||
− | | | + | | hoop-tag = 0 3 0 |
|- | |- | ||
| 3 | | 3 | ||
| 4 | | 4 | ||
| Length | | Length | ||
− | | | + | | hoop-len |
|- | |- | ||
| 7 | | 7 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | centre-x of summary extent above |
|- | |- | ||
| 11 | | 11 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | centre-Y |
|- | |- | ||
| 15 | | 15 | ||
| 3 | | 3 | ||
− | | | + | | Bytes |
− | | | + | | unknown = 00 00 00 may include empty string |
|- | |- | ||
| 18 | | 18 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | hoop-left |
|- | |- | ||
| 22 | | 22 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | hoop-right |
|- | |- | ||
| 26 | | 26 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | hoop-bottom |
|- | |- | ||
| 30 | | 30 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | hoop-top |
|- | |- | ||
| 34 | | 34 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | hoop-width |
|- | |- | ||
| 38 | | 38 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | hoop-height |
|- | |- | ||
| 42 | | 42 | ||
| N3 | | N3 | ||
| N-WStr | | N-WStr | ||
− | | | + | | settings-2 second copy of settings-string |
|- | |- | ||
| 42+N3 | | 42+N3 | ||
Line 203: | Line 204: | ||
| int | | int | ||
| unknown = 4096 | | unknown = 4096 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 60+N3 |
− | | | + | | 1 |
− | | | + | | Byte |
− | | | + | | unknown = 120 or 'x' |
+ | |- | ||
+ | | 61+N3 | ||
+ | | 1 | ||
+ | | Byte | ||
+ | | unknown = 120 or 'x' | ||
+ | |- | ||
+ | | 62+N3 | ||
+ | | 1 | ||
+ | | Byte | ||
+ | | unknown = 80 or 'P' | ||
+ | |- | ||
+ | | 63+N3 | ||
+ | | 1 | ||
+ | | Byte | ||
+ | | unknown = 80 or 'P' | ||
+ | |- | ||
+ | | 64+N3 | ||
+ | | 1 | ||
+ | | Byte | ||
+ | | unknown = 1 | ||
+ | |- | ||
+ | | 65+N3 | ||
+ | | 1 | ||
+ | | Byte | ||
+ | | unknown = 0 | ||
|- | |- | ||
− | | | + | | 66+N3 |
| N4 | | N4 | ||
| N-WStr | | N-WStr | ||
− | | | + | | producer-2 second copy of producer-string |
|- | |- | ||
− | | | + | | 66+N3+N4 |
| 2 | | 2 | ||
| Count | | Count | ||
− | | | + | | thread-count |
|} | |} | ||
− | ===Thread=== | + | ===Thread-details=== |
{| class="wikitable" | {| class="wikitable" | ||
| Offset | | Offset | ||
Line 238: | Line 256: | ||
| 3 | | 3 | ||
| Tag | | Tag | ||
− | | | + | | thread-tag = 0 5 0 |
|- | |- | ||
| 3 | | 3 | ||
| 4 | | 4 | ||
| Length | | Length | ||
− | | | + | | thread-len bytes to next thread |
|- | |- | ||
| 7 | | 7 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | start-x move needle |
|- | |- | ||
| 11 | | 11 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | start-y |
|- | |- | ||
| 15 | | 15 | ||
| 1 | | 1 | ||
| Count | | Count | ||
− | | | + | | colours-per-thread |
|- | |- | ||
| 16 | | 16 | ||
+ | | N5 | ||
+ | | Table | ||
+ | | colour-table = {colour-detail} | ||
+ | |- | ||
+ | | 16+N5 | ||
| 1 | | 1 | ||
| Byte | | Byte | ||
− | | unknown = 0 | + | | unknown = 0 or 10 for multicoloured |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 17+N5 | | 17+N5 | ||
| 1 | | 1 | ||
| Code | | Code | ||
− | | | + | | thread-type-tension (5 rayon, 1 metallic) |
|- | |- | ||
| 18+N5 | | 18+N5 | ||
| 1 | | 1 | ||
| Byte | | Byte | ||
− | | | + | | thread-weight (km/kg) |
|- | |- | ||
| 19+N5 | | 19+N5 | ||
| N6 | | N6 | ||
| Record | | Record | ||
− | | | + | | thread-description human readable thread description |
|- | |- | ||
| 19+N5+N6 | | 19+N5+N6 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | total-displacement-x sum of stitches and jump stitches |
|- | |- | ||
| 23+N5+N6 | | 23+N5+N6 | ||
| 4 | | 4 | ||
| MicroM | | MicroM | ||
− | | | + | | total-displacement-y |
|- | |- | ||
| 27+N5+N6 | | 27+N5+N6 | ||
| N7 | | N7 | ||
| Record | | Record | ||
− | | | + | | stitche-run |
|- | |- | ||
| 27+N5+N6+N7 | | 27+N5+N6+N7 | ||
Line 314: | Line 332: | ||
|- | |- | ||
| 0 | | 0 | ||
+ | | 1 | ||
+ | | Byte | ||
+ | | unknown = 0 or 20 for multicoloured | ||
+ | |- | ||
+ | | 1 | ||
| 3 | | 3 | ||
| RRGGBB | | RRGGBB | ||
− | | | + | | colour-RGB |
|- | |- | ||
− | | | + | | 4 |
| 1 | | 1 | ||
| Byte | | Byte | ||
− | | unknown = 0 or 10 | + | | unknown = 0 or 10 for multicoloured |
|- | |- | ||
− | | | + | | 5 |
| 1 | | 1 | ||
| Byte | | Byte | ||
| unknown = 0 | | unknown = 0 | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===Thread Tension Code=== | ||
+ | {| class="wikitable" | ||
+ | | Code | ||
+ | | Description | ||
|- | |- | ||
| 5 | | 5 | ||
+ | | Rayon | ||
+ | |- | ||
| 1 | | 1 | ||
− | | | + | | Metallic |
− | |||
|} | |} | ||
− | ===Thread | + | ===Thread Description=== |
{| class="wikitable" | {| class="wikitable" | ||
| Offset | | Offset | ||
Line 357: | Line 388: | ||
|} | |} | ||
− | === | + | ===Stitch-run=== |
{| class="wikitable" | {| class="wikitable" | ||
| Offset | | Offset | ||
Line 367: | Line 398: | ||
| 3 | | 3 | ||
| Tag | | Tag | ||
− | | | + | | stitch-tag = 00 01 00 |
|- | |- | ||
| 3 | | 3 | ||
| 4 | | 4 | ||
| Length | | Length | ||
− | | | + | | stitches-len |
|- | |- | ||
| 7 | | 7 | ||
| 1 | | 1 | ||
| Byte | | Byte | ||
− | | | + | | scale-x = 10 |
|- | |- | ||
| 8 | | 8 | ||
| 1 | | 1 | ||
| Byte | | Byte | ||
− | | | + | | scale-y = -10 the y displacement is negative |
|- | |- | ||
| 9 | | 9 | ||
Line 388: | Line 419: | ||
| Byte | | Byte | ||
| unknown = 0 | | unknown = 0 | ||
+ | |- | ||
+ | | 10 | ||
+ | | N8 | ||
+ | | Table | ||
+ | | stitch-table = {Escaped-command | Displacement | disp-x | disp-y} | ||
|} | |} | ||
+ | |||
===Escaped-command=== | ===Escaped-command=== | ||
Line 407: | Line 444: | ||
| Command-code | | Command-code | ||
|} | |} | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 416: | Line 454: | ||
|- | |- | ||
| 1 | | 1 | ||
− | | Move followed by 16 bit displacement- | + | | Move followed by 16 bit displacement-x and 16 bit displacement-y |
|- | |- | ||
| 2 | | 2 | ||
− | | End-move | + | | End-move preceded by 16 bit displacement-y and 16 bit displacement-x for reverse stitching |
|- | |- | ||
| 3 | | 3 | ||
Line 435: | Line 473: | ||
| 1 | | 1 | ||
| Byte | | Byte | ||
− | | | + | | displacement-x -127 to 127 in 0.1 mm |
|- | |- | ||
| 1 | | 1 | ||
| 1 | | 1 | ||
| Byte | | Byte | ||
− | | | + | | displacement-y -127 to 127 in -0.1 mm |
|} | |} | ||
Revision as of 01:43, 24 August 2012
Viking/Husqvarna Pfaff/Singer 3 VP3
The VP3 file format appears to be series of nested tagged sections. The files seen so far, start with a header of signature bytes and "Produced by..." string; followed by a tagged embroidery-summary packet. Like Russian dolls, the embroidery-summary packet contains a tagged hoop-centred packet after some information about stitched area, stitching time, etc. The hoop-centred packet expresses a centred stitch extent and contains several tagged thread packets. Each thread packet has colour and weight information, also containing one stitch-rum packet.
The file format could logically contain several embroideries, and each embroidery contain more then one hoop, but this has not been seen. Perhaps to contain a library of patterns, or to split a large design over several hoops.
The tags seen, so far, are,
- 0 2 0 - Embroidery-summary packet
- 0 3 0 - Hoop-centred packet
- 0 5 0 - Thread packet
- 0 1 0 - Stitch-run packet
In the style of Backus–Naur Form,
File = File-header Embroidery-summary
Embroidery-summary = Summary-details {Hoop-centred}
Hoop-centred = Hoop-details {Thread}
Thread = Thread-details Stitch-run
File-header
Offset | Length | Type | Description |
0 | 6 | ASCIIZ | Signature = "%vsm%" |
6 | N1 | N-WStr | Producer-string 16 bit big-endian length in bytes followed by 16 bit characters |
6+N1 |
Embroidery Summary-details
Offset | Length | Type | Description |
0 | 3 | Tag | embroidery-tag 0 2 0 three bytes |
3 | 4 | Length | embroidery-len remaining bytes in this packet |
7 | N2 | N-WStr | settings-string human readable debugging notes |
7+N2 | 4 | MicroM | extent-right right edge of stitching in um starting from 0,0 |
11+N2 | 4 | MicroM | extent-top |
15+N2 | 4 | MicroM | extent-left |
19+N2 | 4 | MicroM | extent-bottom |
23+N2 | 4 | Count | stitch-time-count time estimate in stitches |
27+N2 | 2 | Count | thread-change-count |
29+N2 | 1 | Byte | unknown = 12 |
30+N2 | 2 | Count | unknown = 1 may be hoop-count |
Hoop-details
Offset | Length | Type | Description |
0 | 3 | Tag | hoop-tag = 0 3 0 |
3 | 4 | Length | hoop-len |
7 | 4 | MicroM | centre-x of summary extent above |
11 | 4 | MicroM | centre-Y |
15 | 3 | Bytes | unknown = 00 00 00 may include empty string |
18 | 4 | MicroM | hoop-left |
22 | 4 | MicroM | hoop-right |
26 | 4 | MicroM | hoop-bottom |
30 | 4 | MicroM | hoop-top |
34 | 4 | MicroM | hoop-width |
38 | 4 | MicroM | hoop-height |
42 | N3 | N-WStr | settings-2 second copy of settings-string |
42+N3 | 1 | Byte | unknown = 100 |
43+N3 | 1 | Byte | unknown = 100 |
44+N3 | 4 | int | unknown = 4096 |
48+N3 | 4 | int | unknown = 0 |
52+N3 | 4 | int | unknown = 0 |
56+N3 | 4 | int | unknown = 4096 |
60+N3 | 1 | Byte | unknown = 120 or 'x' |
61+N3 | 1 | Byte | unknown = 120 or 'x' |
62+N3 | 1 | Byte | unknown = 80 or 'P' |
63+N3 | 1 | Byte | unknown = 80 or 'P' |
64+N3 | 1 | Byte | unknown = 1 |
65+N3 | 1 | Byte | unknown = 0 |
66+N3 | N4 | N-WStr | producer-2 second copy of producer-string |
66+N3+N4 | 2 | Count | thread-count |
Thread-details
Offset | Length | Type | Description |
0 | 3 | Tag | thread-tag = 0 5 0 |
3 | 4 | Length | thread-len bytes to next thread |
7 | 4 | MicroM | start-x move needle |
11 | 4 | MicroM | start-y |
15 | 1 | Count | colours-per-thread |
16 | N5 | Table | colour-table = {colour-detail} |
16+N5 | 1 | Byte | unknown = 0 or 10 for multicoloured |
17+N5 | 1 | Code | thread-type-tension (5 rayon, 1 metallic) |
18+N5 | 1 | Byte | thread-weight (km/kg) |
19+N5 | N6 | Record | thread-description human readable thread description |
19+N5+N6 | 4 | MicroM | total-displacement-x sum of stitches and jump stitches |
23+N5+N6 | 4 | MicroM | total-displacement-y |
27+N5+N6 | N7 | Record | stitche-run |
27+N5+N6+N7 | 1 | Byte | unknown = 0 |
Colour-detail
Offset | Length | Type | Description |
0 | 1 | Byte | unknown = 0 or 20 for multicoloured |
1 | 3 | RRGGBB | colour-RGB |
4 | 1 | Byte | unknown = 0 or 10 for multicoloured |
5 | 1 | Byte | unknown = 0 |
Thread Tension Code
Code | Description |
5 | Rayon |
1 | Metallic |
Thread Description
Offset | Length | Type | Description |
0 | N6a | N-Str | Thread-code 16 bit length followed by ASCII characters part-number |
0+N6a | N6b | N-Str | Thread-name human readable name of thread |
0+N6a+N6b | N6c | N-Str | Thread-manu maker, material and weight |
Stitch-run
Offset | Length | Type | Description |
0 | 3 | Tag | stitch-tag = 00 01 00 |
3 | 4 | Length | stitches-len |
7 | 1 | Byte | scale-x = 10 |
8 | 1 | Byte | scale-y = -10 the y displacement is negative |
9 | 1 | Byte | unknown = 0 |
10 | N8 | Table | Displacement | disp-x | disp-y} |
Escaped-command
Offset | Length | Type | Description |
0 | 1 | Byte | Escape = -128 or 0x80 |
1 | 1 | Byte | Command-code |
Command-code | Description |
0 | Deleted or null stitch |
1 | Move followed by 16 bit displacement-x and 16 bit displacement-y |
2 | End-move preceded by 16 bit displacement-y and 16 bit displacement-x for reverse stitching |
3 | Deleted or null stitch |
Displacement
Offset | Length | Type | Description |
0 | 1 | Byte | displacement-x -127 to 127 in 0.1 mm |
1 | 1 | Byte | displacement-y -127 to 127 in -0.1 mm |
Other References
The VP3 File Format external page contains an overview of this format.