-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wiki Improvements #1
Comments
@tatarize, great improvements! I’ve collected a couple of notes:
|
The fields on the circle, cembrect and cembline are taken from Josh's work on the subject. But, yeah, I realize that that needs a bit better explanation. The units are 1/10 mm. The angles units are 1 degree. The units within most all embroidery is 1/10mm because that's the minimum you can tell the machine to move. So it gets imbedded in a lot of places. The explanation that Josh gave on the main unit elements gets the block description, he called it a stitch-block-description and it's actually describing the fill applied to that shape. And yes, it honestly appears to store all the settings for all the types of fills even if that type isn't being used. But, that data is enough to be able to parse the files, and figure out the size by skipping the motifs which can have their size read (if they exist) and get to the core elements within the Circ and Rect and Line objects and transcode those to SVG. If you ignore all that fill data, the actual elements themselves are pretty easy. Circles have, Circle, Arc, Fanshape, Arc and String (I think they mean chord, as that's what it draws). You can pretty easily turn a good amount of that in the very basic forms into svg. And it's the only big element I hadn't bothered to look into. There's something with motifs still not listed out. There might be some shapes that aren't shown up, but I think that's everything big. |
Two 16 bit integers with different semantics are defined: the I propose using “PES format” and “PES file” (as opposed to “.pes file”). The PEC format seems to be a subset of the PES format. That is, PES subsumes PEC. However, as you note, the converse is not true since stand-alone PEC files also exist. So what is currently said to be the “PES section” is more accurately the “non-PEC parts of PES”. Eventually, I’d like to clarify this in the text as well as in the documentation structure. Getting accurate content in place is in my opinion clearly more important than the style of writing, which is secondary, but eventually I’d like to edit some wordings. For example, “hijacking” is a colorful way of saying “extending the PES format.” Another example is “the PES part contains the design information ... which only Brother's software reads or cares about” which appears to be overly restrictive given that Bernina Embroidery Software Designer Plus seems to support PES to some extent, and possibly other programs. In this case I’d like to change the wording to say that Brother PE-Design is an example that uses the design data, avoiding the assertion that it is the only program that does this. Similarly, I consider “impossible to do operations” a quite strong wording, and I would prefer “difficult” instead of “impossible.” Another change I’d like to make is to use the proper multiplication sign ‘×’ instead of the asterisk ‘*’. It’s very convenient to cross-link compound types, such as |
Some of that is just an oversight, and yeah, it certainly needs to be more consistent. For the coords, I didn't check but I'm pretty sure they all fit the pattern-number of coords, (x, y)+. Generally because they would sort of need to do it that way. Which would in theory make a nice object of coord array. But, whether that is helpful depends on the reuse it has in the document. For simplicity, since the fill settings (block description) is such a recurring element it might be proper to put all the shapes on the same page rather than giving each a different page. They are generally tiny and a lot of the data is generally redundant and they can be described as a whole. The CSewSeg blocks are certainly different but most of the later blocks (whenever their version came out) are pretty similar, though there is clearly something to putting the CSewSeg block and the CEmbOne block in the same page too. To point out very clearly their strong relationship. The CEmbOne page is basically just an outline and points to the CSewSeg page. It stores the first of potentially several headers within the CSewSeg block. When the project seemed more unwieldy, a bunch of pages one for everything seemed like a solid idea. But, given Josh's description of the information about the fill and how little else is there. It seems pretty simple, and doesn't need all those pages. The CEmbRect and such are basically completely described. The circle likely needs some information on the types and honestly such a thing would require images. PEC does the embroidery machine. PES v.1 has EmbOne/SewSeg blocks containing segment data. Later versions (v6 at a minimum) have shapes, which are a big block of data that describes the fill, and the couple things you need to describe a shape. And tada, that's the format! Mapping out that fill description block thing is the very heavy lifting. I'm fairly sure I could change my javascript fiddle to interpret at least the basic shapes and transcode them into SVG. This would be a solid proof of concept, even though it would be ultimately pointless. Nobody has embroidery files with those shapes in them. If you went SVG -> PES you'd get shapes but no stitches and have to load the file up with PE Design and save them again to generate them. I write embroidery software and I'm still not sure what any of this information is useful for. Except for that solid blank version 1 header as the entire PES document idea you had. That's actually useful. Which doesn't bode well, given that the most useful thing to realize about PES is that you can easily pretend it doesn't exist. I don't have a Brother embroidery machine to test PEC stuff. But, I did get images of a corrupted version of the graphics from a user of Touch Embroidery who took a picture of her embroidery machine and the crazy bitmap it was displaying. And Josh wrote me up a pec image displayer. So I could test such things for their integrity. Which was a big help, in fixing it. -- But, it does show oddly that the frame around the images isn't really needed, it just looks pretty. But, you might be able to answer questions like what if you said you had one more color and never used that claimed color in the stitching but did include a bitmap of a program logo, would any machine throw an issue at that? |
I may be able to add something to this. I've been using PES version 9 as a vehicle for learning python for another job, and I have it probably 90% or more mapped out. I thought someday I'd make the code multi-version compatible, but its been a while getting back to it. My Git-fu is weak, but let's see if this old output file loads... |
Thanks @bungaloretorpedo! |
"element stitch order" is one of the things we didn't have mapped out that was certainly critical. Most of the stuff is backwards compatible so there's things in the 9 header that look to be number of segments-groups too, that you have blanked out. Or are in the right place given the version 6 header. But, then again, maybe they dropped them, I am unsure why but Wilcom Truesizer will only output sections versions 1-6. And generally won't touch the vector shapes no matter what. |
I had a half-dozen or so 'next steps' in the works when I got caught up in other things, V6 header being one of them, as it was the format I digitized in before the new machine and software came home. Depending on how much 6 and 9 have in common in the standard shapes, I think the PDF above takes care of some unknowns. Not obvious because it normally has a zero value, the unknown following the CembCirc block description is the number of 16-byte of data structures to follow before the actual "tail". Those 16 bytes include location and index information for embossings that may have been applied to the CembCirc. Given how long I'd been staring at it, it may never have come to me about the start-end angle fields in the tail. Thank you for that, I've already changed the output display of my own code. |
Yeah, with Josh, and others it's basically mapped out. There might be a couple things left, but I'm pretty sure that's basically all of it. I'd like to see it produced as a better technical document and just published as such. I'm really not sure what else needs to be done. I suppose we could convert the shapes to SVG and convert SVG to the given shapes. But, the software is rare and expensive and I'm not sure the utility therein. As I'm soon going to be writing my own fill these shapes with stitches code, and for the life of me I've looked and never seen any PES with shapes file anywhere other than saving one myself. |
@bungaloretorpedo I fairly recently translated this stuff into python myself for a different effort. But, using the stuff learned here to properly map the formats. While it's mostly intended for version 1 and 6, it would certainly work for other versions. It's mostly for all formats reading and writing. But, has a particularly developed read and write routine even reading the pec graphics. |
And keep in mind the work here and elsewhere also contributed to: https://edutechwiki.unige.ch/en/Embroidery_format_PES Which I think is to date, some of the best work on the subject. |
I properly classed the control codes. They are not parts of the pes blocks. The 0xFFFF0000 between the sections are control codes, they indicate whether the file is over or if there is more to be read. They are not therefore part of the blocks themselves. They are codes to indicate if there is is something more to read it can properly gauge EOF.
I moved some sections around, and added the block description from Josh. If his data is right, it's certainly possible to parse all the higher level objects and transcode them at least naively to SVG. Even though that goal is largely a bit meh, given that nobody has actual PES files with higher level objects.
The text was updated successfully, but these errors were encountered: