Comments (6)
Hi @tatyanade, could you please test this out so that we can close this issue.
from pembroider.
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 cullGroup
, which is how I make sure the same shape doesn't cull with its own strokes. So theoretically I can pass this info to TSP too.
But may I suggest another interface that I think gives users more clarity and control:
E.optimize()
can be called multiple times. Each time it is called, the polylines that are currently on the canvas are optimized. Then, they're marked as "solidified" and future calls to TSP will treat them as a whole. So users will insert E.optimize()
between what they regard as different "object"s.
What do you think?
from pembroider.
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?
from pembroider.
good idea
from pembroider.
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);
}
from pembroider.
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?
from pembroider.
Related Issues (20)
- compile with Eclipse HOT 3
- non-closed shapes with E.strokeMode(E.PERPENDICULAR) have connecting line HOT 2
- under layer support stitch HOT 1
- Request toggle to enable/disable generation of connecting lines HOT 3
- .jef file format causes machine confusion HOT 1
- Jump stitches not being cut, but stitched HOT 9
- no menu preview (but editor preview!) of .pes files on the Brother NV800E
- SVG Export leave connecting lines between shapes HOT 1
- Concentric fill error on imported images
- Optimize function altering colors
- Potentially helpful sizing function
- In PEmbroider_lines_1.pde example, the bobbin thread gets tangled HOT 4
- .jef file displays badly on machine HOT 2
- simple E.rect problem HOT 2
- Inaccurate license information HOT 4
- layer names as metadata HOT 1
- option to avoid small bridge stitches HOT 10
- culling question. HOT 3
- getting access to PEmbroiderGraphics polylines HOT 2
- satin hatching does not catch all polygons HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pembroider.