inkstitch / inkstitch

Ink/Stitch: an Inkscape extension for machine embroidery design
https://inkstitch.org
GNU General Public License v3.0
911 stars 168 forks source link

Simulate fabric distortion #869

Open sheldonross opened 3 years ago

sheldonross commented 3 years ago

I have a brother 800, and have been exporting in PES.

The issue I've been encountering is a fairly drastic difference in the size of satin columns between simulations, and the end product on the machine. It makes it very difficult to accurately create a design.

For instance, a 2inx2in design, when I scale it on the screen to size, and physically hold a ruler to it, I have a satin column(top satin in example image) that appears ~1/4 in thick. However, when I run it through the machine the satin column is ~3/16 in. Now obviously I can try to mentally compensate, but it would be immensely helpful, if the simulated view more closely matched reality. Even an option to manually scale output would be helpful and reduce trial and error of trying to end up with the design looking as intended.

Perhaps this is something that can be addressed with the push pull compensation, but I'm not having much luck. As it changes the simulation size. Comparison

sheldonross commented 3 years ago

Is it possible to remove the pull compensation from the simulation?

lexelby commented 3 years ago

Welcome to Ink/Stitch, and welcome to the exciting (frustrating) world of embroidery distortion! The size discrepancy you're seeing is because of pull distortion. I love this article series by Mr X Stitch: link.

You can either make the satin bigger or use pull compensation, but the bottom line is that what you see on screen will always be different from how a design sews out. Your idea of removing the pull compensation from the simulation is interesting, but I'm not sure I really want to go down that road. I'd have to think it over.

One reason I'm hesitant is that we can't do a similar thing for push distortion. Try to measure the length of one of sonic's hair satins and you might find that it's longer than you see on screen as well. There's no "push compensation" option, so we couldn't adjust the simulator for push compensation.

Another problem is that the amount of distortion you get is going to vary depending on the fabric, the stabilizer, tension, and other factors. We still can't be sure that what you see on screen is what you would get in reality, if we just didn't render the pull compensation in the simulator. It likely wouldn't be.

The main reason, though, is that I think other software doesn't do this. I'm pretty sure that professional digitizers are just used to the fact that what they see on screen is not what will happen in reality. @wwderw What's your experience in this? Are you used to your embroidery design in software not being exactly like what you want the finished product to look like, because of distortion compensation?

wwderw commented 3 years ago

This is correct. While in the commercial programs, you have options pull comp and column width to help offset push/pull, the truth is always going to be in the stitch out and not all machines stitch out the same. This isn't even getting into other things, some of which were already highlighted above (other factors include, needle (burs or not etc), the digitizing of the design itself, small shapes in tight area with a lot of turning stitches, even speed of the machine).

The way around this comes with experience, both of knowing what your machine can do and where the problem areas are going to be in the design.

The way that I try to think about pull comp, is thinking of laces on a corset and how they "compress" the frame. Those laces are at 180 degree and they compress from the sides. Same thing with stitches. For instance, take a look at a san serif block font that has been professionally digitized. If you notice the capital "O" almost always extends a little bit further on the top and the bottom compared to say a capital "N" and that has to do with where the stitch angles are.

Can go even further and take a look at the letter "A" at different sizes. Using the same san serif block font "A", the letter "A" can be either broken down into 4 parts for a normal size output or broken down to 3 parts at a smaller output(and this goes for other letters as well, the reason is to minimize stitch angles in small spaces, which can cause distortion, "birds nesting", broken needles or various other "wonderful" things to happen).

Embroidery is a "destructive" process and you will get varying results, Even something as small as how you hoop the item (there is no way that we can hoop with the exact tension each and every time) can contribute to different results. Letting a needle continue to wear down before you change it, can also contribute (and ironically even if you do put a new one it, due to the problems with mass production, even a new one can have burs from the get go, doesn't always happen, but can be an issue on occasion).

Bottom line, after 26 yrs of doing this, don't measure with a micrometer and expect the same results every time, there are going to be slight variations, even if the design is perfect and perfect in regard to compensating for push/pull as best as the digitizer can reasonably do. There are just way too many variable (and I can think of others that I haven't mentioned as well) that lend to why this issue is happening and there is no way that the software can compensate for them all.

sheldonross commented 3 years ago

Thanks for the very thorough feedback, it's much appreciated. That link is informative, especially the last paragraph.

The problem many new digitizers have with distortion is that creating an on-screen design that looks so ‘off’ feels wrong.

I have to admit that part of me balks when told there's no good solution.

Just spit-balling here. Each needle point could be thought of as the end point of one(start and finish) or two(or more in overlapping designs) vectors. If you could cludge a formula for the amount of pull based on the length of the stitch, that could be translated into a vector, you could sum the vectors and move the rendered position of the stitch in the simulation to approximate the effect of the distortion. A simple scale factor applied to the result vector could be used to approximate the rigidity of different fabrics. Hmm, the trouble is the tension applied on each stitch isn't all applied at the same time, so it would have to be shifted as each stitch happened. Anyway, I realize that such a process would take a lot of thought and development and probably not really feasible, but it's interesting to ponder.

LochanLoch commented 3 years ago

Don't forget the 1/10mm grid that the software do for the embroidery machine. You can see when reload exported file as new layer over the original svg. ;-)

lexelby commented 3 years ago

I could certainly see the usefulness of an option along the lines of "Simulate fabric distortion". It sounds like you're familiar with the math involved. If you're interested in implementing that feature, I'd be interested to see what you come up with.

All of what I said above makes sense as an argument against trying to simulate the distortion by default, but an optional feature makes a lot of sense.

lexelby commented 3 years ago

I have to admit that part of me balks when told there's no good solution.

This may help:

I like to think of my design in Inkscape not as a picture of what the embroidery should look like, but more as a set of instructions for the machine. Or as a set of instructions to Ink/Stitch to use when producing a set of instructions for the machine.