summaryrefslogtreecommitdiff
path: root/embroider.py
AgeCommit message (Collapse)Author
2016-10-28remove obselete stitch order optionLex Neva
2016-10-28switch to millimeters and make pixels_per_millimeter an optionLex Neva
2016-10-28remove unnecessary importsLex Neva
2016-10-27tidyLex Neva
2016-10-27studly caps to underscores (pep8)Lex Neva
2016-10-27inline reverseTupleLex Neva
2016-10-27get rid of shapelyLineSegmentToPyTupleLex Neva
2016-10-27simplify polygon sortingLex Neva
2016-10-27remove hatching optionLex Neva
2016-10-26big refactor to untangle embroidery from stitch generationLex Neva
2016-10-26remove PatchList class and use a simple ListLex Neva
2016-10-26remove sortorder bitsLex Neva
2016-10-26be sure to visit selected nodes in the right orderLex Neva
2016-10-24get rid of traveling salesman stuffLex Neva
The algorithm was terrible. In general, it seems to work a lot better to just have the human choose what order things are stitched in than to try to do it automatically.
2016-10-24remove unused row_spacing_px option from EmbroideryObjectLex Neva
2016-10-24get rid of preamble code and featureLex Neva
The code was poorly implemented and unclear. I haven't ever had a need for preamble. I think my machine (brother SE400) might do it automatically.
2016-10-24remove unused functionsLex Neva
2016-10-24tidy up PatchLex Neva
2016-10-24refactor satin a bitLex Neva
2016-10-20proper zigzag underlayLex Neva
2016-10-19add center walk and zigzag underlay for satinLex Neva
the code's a total hack, but it gets the job done
2016-10-19stuffLex Neva
2016-05-16protect from foot-shooting by printing to stdoutLex Neva
2016-05-16bugfixesLex Neva
2016-05-14add pull compensation for satin columnsLex Neva
2016-04-28align rows properly even for rotated regions, also fix float inaccuracyLex Neva
2016-04-27a bunch of features and fixesLex Neva
* added "flip" option for fills to start stitching in upper left rather than right * line up rows in abutting fills properly * handle intersect_with_grating intersection result that is a line or single point (skip row) * skip endpoint marker tags in SVG files (subtags look like paths) * dashed stroke indicates running stitch (<=0.5 width still works but is deprecated) * in running stitches, add a stitch at apex of sharp corners
2016-02-28fix: stitches appearing outside fill in case of very short rowsLex Neva
2016-02-25don't embroider stuff set to invisible (layers, groups, paths, etc)Lex Neva
2016-02-25embroider everything if nothing is selectedLex Neva
2016-02-25add option to preserve absolute object stacking orderLex Neva
2016-02-23rework satin_column to properly handle segments that are less than the ↵Lex Neva
zigzag length
2016-02-23sort line segments to better pick contiguous fill regionsLex Neva
2016-02-23multiple-stagger stitches in fillsLex Neva
Instead of staggering stitches like this: --*--*--*- *--*--*--* stagger like this: ---*-----------*----------- ------*-----------*-------- ---------*-----------*----- ------------*-----------*-- ---*-----------*----------- This ends up looking much prettier on the fabric. The number of staggers is configurable; a value of 2 would behave like the previous commit.
2016-02-18get rid of randomness in fillsLex Neva
Previously, each row in a fill region was offset by a random amount. This looks better than not offsetting at all (which will create visible columns of stitches), but humans are very good at finding patterns in randomness. The result is that fill regions look weird. This commit instead carefully orders the stitches in fill regions such that each row's stitches are offset by half of max_stitch_length from the previous. There are also a couple of other miscellaneous fixes and features in here -- sorry about that.
2016-01-30clean up satin column code and clarify error messagesLex Neva
2016-01-20add variable satin featureLex Neva
Variable satin does zigzag stitches between two arbitrary paths. This lets you do satin stitching of variable width and angles, which is useful for filling smaller regions where tatami filling doesn't make sense. It's also good for doing satin around corners, because it doesn't leave the outer part of the corner sparsely-stitched. To use variable satin, create an object containing two paths in inkscape. Each path should have the same number of vertices. Zigzag satin will be drawn between the two paths such that a stitch always aligns with each corresponding pair of vertices. This lets you control the way the stitches are angled by subdividing the paths appropriately. Tip: you can add a vertex to a path by double-clicking the place on the path where you want the new vertex. Be careful when going around corners, especially sharp ones. The number of stitches is based on the zigzag spacing parameter measured around the _longer_ of the two beziers in each segment. Around corners, even if the outside angle is sharp, you may want to make the inside angle slightly rounded to avoid having a bunch of stitches all land at exactly the same point, which could poke a hole in your fabric.
2016-01-18fix up whitespace errorLex Neva
2016-01-18augment the TSP algorithm by being greedierLex Neva
The greedy algorithm can be fairly effective, and it's not particularly expensive to calculate given the relatively small number of patches in any given set. Instead of doing a greedy algorithm starting from the furthest point from the centroid (what's the theory there...?), just find greedy paths from all possible starting points and pick the best. This gets us pretty close to optimal right out of the gate.
2016-01-18fix gnarly bug in hill-climbing resulting in hill-fallingLex Neva
try_swap occasionally made very bad swaps that increased the overall cost. If asked to swap neighboring patches, the calculations were completely wrong.
2016-01-18fix bug that allowed a patch to be discontiguousLex Neva
2016-01-18rewrite intersect_region_with_grating to resolve TODOLex Neva
2016-01-18convert tabs to spacesLex Neva
2016-01-18really fix "preserve order"Lex Neva
My previous fix didn't really do the job. It took patches in Z-order, but runs of patches of the same color were fed into the TSP algorithm and it could embroider them in whatever order it chose. This resulted in underlays for my fill regions being embroidered AFTER the fill. Now, the "preserve order" option has been changed to "preserve layers". Patches on different layers are gauranteed to be stitched in layer order. Patches of the same color within the same layer can be stitched in any order as chosen by the TSP algorithm.
2016-01-08major revampLex Neva
* properly process transform parameters (ungrouping no longer necessary!) * handle satin on beziers properly * previously beziers were stroked as straight line segments that included control points * allow overriding parameters on individual paths by adding extra svg params * embroider_angle, embroider_stitch_length, embroider_zigzag_spacing, embroider_row_spacing, etc * set using "Edit XML" * default to 10 pixels per millimeter * properly write CSV files in millimeters (was dividing by 10) * always translate pattern to origin to fit in hoop * add "running stitch length" for < 0.5 stroke width) * don't traceback if no paths were selected * add "repeats" option for stroke (satin/running stitch) to go back and forth over the line * good for a double line of center-line underlay below satin
2016-01-06make 'preserve stacking order' actually workLex Neva
2016-01-06set to 10 pixels per mm for embroidermodder CSV outputLex Neva
2015-12-15allow specifying orientationBas Wijnen
2015-11-11Make it work well for FranklinBas Wijnen
Add Franklin G-Code target as output. Fix issue that filled area was treated as one patch per stitch. Don't autodetect orientation; let the user choose by orienting the object. Remove empty stitches. Base generated inkscape path on output from file. Allow maximum stitch length of 10 cm. Save debug output in /tmp. Disable almost all debugging. Let hatching connect the segments.
2015-01-03Fix preamble generation for very short patchesStefan Siegl