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
new way better satin algo #607
Conversation
Looks good to me, no errors found yet. |
Do you think this one's ready to merge? |
Awesome, could you post that SVG so I can take a look? |
Here you go: fix-satin-underlay-issue.svg.log |
Honestly, I'm kind of okay with this. The master branch doesn't actually take any care to ensure that the underlay doesn't show, it just got lucky. If you set the contour underlay stitch length to 1.2, it looks great. It's really just a matter of whether the stitches are close enough to avoid cutting that corner. |
Ok, then I think this is ready to be merged. |
Agreed! |
## New Features - New Simulator (#531) - Import Threadlist (#666) - Export Threadlist in ZIP file (#664) - Option to include SVG in ZIP file (#648) - Break Apart and Retain Holes (#653) - G-Code: option to alternate z-value (#659) - New Stitch Plan Extension (#640) - Optionally enable/disable ties (lock down stitches) (#619) - Multiple Fill Underlays - Additional Fonts (#683): * Geneva * DejaVu ## Improvements - Better Algorithm for Satin Columns (#607) - Better Algorithm for Fill Stitches (#606) - Convert to Satin with Loops (#608) - Adding '@ #' to all fonts (#680) ## Bug Fixes - Fix Issue with Troubleshoot Pointer Position (#696) - Inherit Styles (#673) - Fix Color Palette Issues (#660) - Preserve Aspect Ratio (#646) - and more ## Under the Hood - Namespaced Attributes (#657) - Remove stub.py (#629)
I've kept noticing a weird bug in satin columns. On some shapes, the stitches aren't lining up properly with the rungs:
What's happening is that errors are building up, causing one rail to "fall behind" the other. I think it's been this way since we added the "density compensation" code. I redid the satin algorithm, and in the process I accidentally got rid of a very important part of the algorithm that prevented this kind of thing from happening.
Adding that back wasn't so easy. I couldn't really come up with a good way of restoring that part of the algorithm while still having the density compensation, and I feel that the density compensation is quite important.
Instead, I redid the entire algorithm (again). Yikes! But this time I think we've got something really good, and the code is way simpler. It doesn't have the issue with one rail falling behind, and it also does a pretty great job of avoiding density issues. Better yet, I think it's a ton easier to understand what the code is doing.
Here's how it works. It figures out the center-line of the satin, which is pretty much just halfway between each pair of points on the rails. For each stitch, it inches along the rails, measuring how far it's gone along the center line (not either rail). Once it's gone the right distance, it makes a stitch.
This naturally avoids the density issues we saw before, even for a V-like shape. It can still be slightly denser in some places for a shape like this:
| /
but it's not too dense, and it's just as good if not better than the previous density compensation.Test all your satin columns. :) I have high hopes for this, but of course, I don't want to break existing designs.