-
Notifications
You must be signed in to change notification settings - Fork 27
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
stitchwise-TSP vs. objectwise-TSP? #35
Comments
Hi @golanlevin , I think the request totally make sense. Won't be too easy to add, but definitely doable. Currently each polyline is associated with a But may I suggest another interface that I think gives users more clarity and control:
What do you think? |
Hi @LingDong- , this is an interesting proposal. What if there were a beginOptimize() and endOptimize() call, which runs a TSP exclusively on the stitches that were added in between those functions? |
good idea 👍 |
beginOptimize() and endOptimize() were added in this commit: 946609f Sorry forgot to update here. Usage is: import processing.embroider.*;
void setup(){
size(1000,500);
PEmbroiderGraphics E = new PEmbroiderGraphics(this);
E.fill(0);
E.hatchSpacing(20);
// these shapes will be optimized individually
E.beginOptimize();
E.rect(10,10,300,300);
E.endOptimize();
E.beginOptimize();
E.rect(50,50,300,300);
E.endOptimize();
// these shapes will interleave
E.beginOptimize();
E.rect(510,10,300,300);
E.rect(550,50,300,300);
E.endOptimize();
E.visualize(true,true,true);
} |
Hi @tatyanade, could you please test this out so that we can close this issue. |
Wanted to say that this as a feature makes a lot of sense, have had some failed embroideries where issues arose on one specific shape/object but since the embroidery was jumping around multiple shapes I had to re-embroider all of the ones that had been started and not finished instead of just being able to redo the one with an issue. Here are some tests I ran; and then a new one w text text is a weird one to watch be embroidered since it doesn't write left to right and skips around letters and words which is counter intuitive to watch, especially with cursive since you'd expect it to be one line but! It does do the individual text segment individually. This does cause iterating on code to be slower since it takes longer to visualize - when optimize is at the bottom and its you can comment it out till you're ready to write the file but now you'd have to comment out all the begin/ends which might get tedious without a helper function, especially if you have a lot of individual shapes that you want to retain the order of. In the example code you @LingDong- put above, would optimize by itself need to be called and the end of the file or would that be redundant since all the shapes being embroidered have had optimize called already? |
@LingDong- , I see some opportunities in which the TSP solver could have a behavior which, though less "optimal" in one sense, might be more user-friendly in another.
Let's call an "object", a cluster of related stitches. For example: all of the stitches inside some polygon. Sometimes, when rendering several different objects, the TSP will render half of an object; jump to another object; and then (eventually) return to complete the remainder of the first object.
From a user's perspective, it might make more sense to complete each object individually. More precisely, to:
Is this an option that would be easy to add to the TSP solver?
The text was updated successfully, but these errors were encountered: