Embroidery format VP3
VP3 format is a Pfaff format. Unlike most other embroidery formats. It's divided into stitchblocks. Conceptually it's typical to think of embroidery rather than the set of low level commands which control the machine but as sets of unbroken stitches in a particular color. While this is quite common at the level of embroidery software, most formats typically consist of large dumps of direct embroidery commands with some various cruft for the machines in question. For example, PEC blocks (in PEC files and PES files) contain 1 bit graphics files.
Header
VP3 consists of: a magic code, some hoop and design information, a number for the number of stitch blocks and stitch blocks.
Type | Bytes | Value | Description |
---|---|---|---|
`string` | 5 | %vsm% | Magic String. |
`s8` | 1 | '\0' | maybe null terminator for the string. |
`16be` | 2 | byte_length | Production String Bytes (N0) |
`UTF-16BE` | N0 | "Produced by ...." | Production String |
020 Location And Data
The 0x0 tags are some of the more recognizable tags as they always denote a location in the file. So I will break at them.
Type | Bytes | Value | Description |
---|---|---|---|
`s8` | 3 | \x00\x02\x00 | Tag indicates the following is a location. |
`32be` | 2 | Bytes_To_EOF | bytes the the end of the file. |
`16be` | 2 | byte_length | unknown string, always 00 (N1) |
`UTF-16BE` | N1 | "" | Rumor has it this is a string. |
Extends Section
VP3 like most embroidery is y-flipped from common programming languages. Most models put the origin point in the upper-left point programming in quadrant III whereas embroidery is almost always Quadrant I with the origin point in the lower-left. Consequently most overt numbers within embroidery have to be y-flipped.
VP3 however stores all position information as multiplied by 100 as a conversion between the standard units of Embroidery 1/10th mm. This actually gives the units therefore in 1*10^-6 and are micron or (micrometers or micrometres).
Type | Bytes | Description |
---|---|---|
`s16be` | 2 | Right * 100 |
`s16be` | 2 | -Top * 100 |
`s16be` | 2 | Left * 100 |
`s16be` | 2 | -Bottom * 100 |
Thread Count and Unknown
Type | Bytes | Value | Description |
---|---|---|---|
`u8` | 1 | \x00 | unknown |
`u8` | 1 | count_threads | the number of expected colorblocks |
`u8` | 1 | \x0C | Unknown |
`u8` | 1 | \x00 | Unknown |
`u8` | 1 | \x01 | Unknown |
030 Location And Hoop.
Type | Bytes | Value | Description |
---|---|---|---|
`s8` | 3 | \x00\x03\x00 | Tag indicates the following is a location. |
`32be` | 2 | Bytes_to_EOF | bytes the the end of the file. |
`s32be` | 4 | center_x | Design center. In microns. max_x - half_width * 100 |
`s32be` | 4 | -center_y | Design center. In microns. max_y - half_height * -100 |
`u8` | 1 | \x00 | Unknown |
`u8` | 1 | \x00 | Unknown |
`u8` | 1 | \x00 | Unknown |
`s32be` | 4 | -half_width | -half_width, If center_x were made zero, this is the extends. |
`s32be` | 4 | half_width | +half_width |
`s32be` | 4 | -half_height | -half_height |
`s32be` | 4 | half_height | +half_height |
`16be` | 2 | byte_length | unknown string, always 00 (N0) |
`UTF-16BE` | N0 | "" | Rumor has it this is a string. |
`u8` | 1 | \x64 | 'd' maybe "dd", maybe 25700 (the 00 in dec end makes that seem like a position) |
`u8` | 1 | \x64 | see above |
`s32be` | 4 | 4096 | Unknown, b'\x00\x00\x10\x00' |
`s32be` | 4 | 0 | Unknown, b'\x00\x00\x00\x00' |
`s32be` | 4 | 0 | Unknown, b'\x00\x00\x00\x00' |
`s32be` | 4 | 4096 | Unknown, b'\x00\x00\x10\x00' |
`string` | 4 | "xxPP" | Magic String? |
`u8` | 1 | \x01 | Unknown |
`u8` | 1 | \x00 | Unknown |
`16be` | 2 | byte_length | Production String Bytes (N1) |
`UTF-16BE` | N1 | "Produced by ...." | Production String |
Color Blocks
Each vp3 stitchblock contains:
Description
Type | Description |
---|---|
`u16be` | Color Blocks Expected (N) |
Color_Block | N Color Blocks |
Color Block
- 050 location to next block.
- \0x00
- start_position_from_center_x
- start_position_from_center_y
- vp3_thread
Thread information. (Brand, Catalog Number, and Description)
The position of the end of the block.
And stitches.
Also See
https://community.kde.org/Projects/Liberty/File_Formats/Viking_Pfaff http://www.jasonweiler.com/VP3FileFormatInfo.html