Revamping Non-Uniform Scale
Hey Armorsmithers, I recently took on the task of rewriting the Non-Uniform scale pattern reconstruction algorithm. I had noticed a lot of users confused about the scale moving their patterns around and changing the look of a few of them. This has always been the case with Armorsmith and the reason behind it is that in order to apply a separate scale in all dimensions the triangles in the pattern actually need to be scaled in model space and then the pattern needs to rebuilt from these newly scaled triangles. In the past Armorsmith accomplished this by blowing up the patterns, scaling the triangles and then running the data through the unfolding algorithm again. This meant that all the previous pattern data regarding orientation and position was lost. It also had the downside of changing the looks of patterns if the edges had been welded together in Pepakura. This usually resulted in the following data.
This wasn't a big issue as after a scale you almost always have to redo your layout anyways because pieces no longer fit on pages. I noticed a few users getting their unfolds corrupted after a non-uniform scale so I decided it was time to dig into this a little deeper. After investigating a couple of the corrupted files I discovered that the source was bad geometry data in the source files. There was no way for those files to be unfolded again because of the bad data. While I was figuring out a way to get around the bad geometry I took a different approach to the non uniform scale. Now when a user applies a non uniform scale. Rather than destroy the patterns I collect all of the triangles in a pattern. Scale all those triangles in model space. Then I attempt to rebuild the pattern keeping the same connectivity data. It stitches the patterns back together starting with the largest triangle and then iterating out using the largest edge each iteration to add another triangle back to the pattern. After that it was just a matter of figuring out how much the pattern had rotated and moved by to get it back into the place it was before the scale. This results in a much closer representation of the pattern layout before the scale as seen in this example.
This is nice as now the non-uniform scale behaves much more predictably. I've also taken the same approach with the FFD scale tool. This is all available now in the latest release. Make sure to run the update checker to get the latest version!