绣花文件格式?

发布于 2024-09-14 06:45:19 字数 220 浏览 6 评论 0原文

我的妻子有一台 Bernina 刺绣机,我想尝试以编程方式创建设计。我想了解如何以机器软件可接受的格式输出数据,或者找到一个免费或廉价的实用程序,可以将我可以生成的格式(例如 HPGL 或其他记录的格式)转换为机器可以接受的格式。我的目的是输出一个文件,每针一个 XY 坐标,加上换线指令(暂停换线);我不需要一些东西来生成区域填充、调整针迹间距、优化缝合顺序等;我希望自己能处理这些事情。

有人有什么建议吗?

My wife has a Bernina embroidery machine and I'd like to experiment with creating designs programmatically. I'd like to either find out how to output data in a format the machine's software will accept, or else find a free or inexpensive utility that can convert from a format I can produce (such as HPGL, or something else documented) to a format the machine can accept. My intention would be to output a file with one XY coordinate per stitch, plus instructions to change thread (pause for thread change); I don't need something to generate area fills, adjust stitch spacing, optimize stitching order, etc.; I'd expect to handle those things myself.

Anyone have any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

自此以后,行同陌路 2024-09-21 06:45:19

您可以查看开源 Embroidermodder 2 及其底层库 libembroidery。在撰写本文时,它不支持 .ART,但 .DST 是大多数机器支持的常见格式,可能适合您。另外,您可以使用 libembroidery 的 .CSV 格式相当轻松地布置针迹,以便抽象出所有格式细节,然后使用 libembroidery-convert 将文件转换为您的机器支持的刺绣格式。 .CSV 格式具有指定颜色变化、跳针和修剪的功能。

libembroidery 格式

You could look at the open source Embroidermodder 2 and it's underlying library, libembroidery. At the time of writing, it doesn't support .ART, but .DST is a common format that most machines support which may work for you. Also, you could use libembroidery's .CSV format to lay out your stitches fairly easily so that all the format specifics are abstracted away and then convert the file with libembroidery-convert to an embroidery format that your machine supports. The .CSV format has the capability of specifying color changes, jump stitches and trimming.

libembroidery formats

信仰 2024-09-21 06:45:19

Bernina 的.ART 格式确实是专有的,但Berinina 拥有一家软件公司OESD,该公司生产转换软件(例如OESD Magic Box)。您可以使用记录的文件格式(例如 .PES)创建文件,并使用他们的软件将 PES 文件转换为 ART。

这是有关某些刺绣文件格式的布局的资源

免责声明:公司我的工作是销售 OESD 产品。

Bernina's .ART format is indeed proprietary, but Berinina owns a software company, OESD, that makes conversion software (e.g. the OESD Magic Box). You can create files using a documented file format, such as .PES, and use their software to convert the PES files into ART.

Here's a resource on the layout of some of the embroidery file formats

disclaimer: the company I work for sells OESD products.

请叫√我孤独 2024-09-21 06:45:19

根据此帖子(诚然已有几年历史) ,所以也许他们最近开放了).art 文件格式的细节由 Bernina 严密保护,不提供给开发人员,要求所有工作都通过他们的官方设计工具完成。

我认为您可以通过对 .art 文件字节进行一些试错修改来对文件格式进行逆向工程,但诀窍是将这些修改后的文件放回到机器中。也许一个好的开始是修改一些字节,然后尝试让他们的设计软件重新打开文件。这种方法的最大问题是他们是否使用校验和。

According to this thread (admittedly a few years old, so maybe they've opened up recently) the details of the .art file format is closely guarded by Bernina and not made available to developers, requiring that all work is done through their official design tools.

I would think you could reverse engineer the file format with some trial-and-error modification of the .art file bytes, but the trick is getting those modified files back into the machine. Perhaps a good start would be to modify some bytes and then try to get their design software to re-open the file. The big gotcha with this approach would be if they use a checksum.

逐鹿 2024-09-21 06:45:19

我发现 Bernina 刺绣机实际上很有可能接受 .DST 文件。虽然 .ART 在某种程度上是制作此类文件的标准,但许多绣花机都接受 .DST,并且这些文件很容易编码并输出


.art 文件采用“复合文件二进制格式”。你很容易把它们分开。 7zip 可以做到这一点。任何人都可以写任何东西来遍历它。然而,在文件内部,通常有:

  • [5]SummaryInformation
  • [5]WilcomDesignInformationDDD
  • AUX_INFO
  • 内容
  • DESIGN_ICON

不过到目前为止,一切都很好。

请注意,这与 Wilcom 的 .emb 格式相同(.art 将此细分称为 C 级,因为它不包含矢量艺术文件,而矢量艺术文件在 emb 中存在时同样会被压缩)

在 .emb 中,内容文件开始一个 4 字节的小尾数表示未压缩格式的文件大小。接下来是 zlib 压缩流。生成的数据显然有一个刺绣文件,其中包含有关线程的字符串和三元组代码。

所以这当然是可行的,但OP是关于.art的。这里有一个小问题。 00 所在的位置看起来像是 D2,通常建议使用单字节混合。

F1 47 D2 D2 EE 9C 24 --- should be  
46 2B 00 00 78 9C ED --- (the icon file sizes are always the same)

这里的位混合是:XOR D2,循环左移1。

所以CFBF中的内容元素应该是未混合的XOR 0xD2,循环左移1。然后前四个字节是大小,其余是zlib压缩溪流。


import compoundfiles
import zlib


def swizzle(b):
    b ^= 0xD2
    b <<= 1
    b |= b >> 8
    return b & 0xFF


def parse_art_file(file):
    with open(file, 'rb') as f:
        contents = compoundfiles.CompoundFileReader(f).open('Contents')
        contents.seek(4)  # file size
        return zlib.decompress(bytes([swizzle(b) for b in contents.read()]))

.emb 文件是相同的,但内容的混合不存在。

然后你会对文件进行逆向工程,等等。

It occurs to me that there's actually a very strong possibility that a Bernina embroidery machine accepts .DST files. While .ART is somewhat standard to make such files, a lot of embroidery machines accept .DST and those are easy to code up and output.


.art files are in "Compound File Binary Format". You split them up pretty easily. 7zip will do this. And anybody could write anything to traverse this. Inside the files however, there are usually:

  • [5]SummaryInformation
  • [5]WilcomDesignInformationDDD
  • AUX_INFO
  • Contents
  • DESIGN_ICON

So far though, so good.

Do note this is the same as the .emb format by Wilcom (tho .art calls this breakdown Grade C, because it doesn't contain the vector art file which is similarly compressed when it exists in emb)

In .emb the Contents file starts with a 4 byte little endian number indicating the size of the file in uncompressed format. Followed by a zlib compression stream. The resulting data clearly has an embroidery file with strings about the threads and a triplet code.

So that's certainly doable, but the OP is about .art. And here's where there's an slight snag. Where the 00 is it looks like there are D2 which generally would suggest a single byte swizzle.

F1 47 D2 D2 EE 9C 24 --- should be  
46 2B 00 00 78 9C ED --- (the icon file sizes are always the same)

The bit swizzle here is: XOR D2, cycle-shift-left 1.

So the contents element in the CFBF should be unswizzled XOR 0xD2, circular shifted left by 1. Then the first four bytes are size, and the rest are a zlib compression stream.


import compoundfiles
import zlib


def swizzle(b):
    b ^= 0xD2
    b <<= 1
    b |= b >> 8
    return b & 0xFF


def parse_art_file(file):
    with open(file, 'rb') as f:
        contents = compoundfiles.CompoundFileReader(f).open('Contents')
        contents.seek(4)  # file size
        return zlib.decompress(bytes([swizzle(b) for b in contents.read()]))

.emb files are the same but the swizzle for the contents doesn't exist.

Then you'd reverse engineer the file, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文