Open golanlevin opened 4 years ago
Added: 0ca31e8c67d1051d9a891f5ed52f2bc34979fdd2
E.toggleResample(false); //plotter
E.toggleResample(true); //embroidery
We just got an axidraw se/a3 at the studio. What would be the best way to go about interfacing with it and take advantage of the PEmbroider functions? Axidraw works well through Inkspace and also their live draw Processing examples.
I assume I would try to export not to .jef but .svg, open that file again in their live draw Processing examples and have it trace the paths. I wonder though if you have a quicker method ?
If you're controlling the AxiDraw "offline" (from a file), then I would do your designs with toggleResample(false)
set, and then export .SVG files, then load those files in InkScape and control the AxiDraw from there.
If you were controlling the AxiDraw in real-time from Processing (it's possible), then you would need to reach into the PEmbroider object to get the locations of the stitch points, and then (in separate Processing code) tell the AxiDraw to move there. See https://github.com/evil-mad/AxiDraw-Processing, https://github.com/koblin/AxiDrawProcessing2 .
Thanks for the marching directions. For now I will test different fills to see what works best for my use case.
When setting the output file path to use .SVG is there a way to not export the connecting island lines? The Axidraw draw those lines too even though they are not part of the image. I know I could manually delete them, but ...
Hi @LingDong- , Omitting the connecting lines would be very important for plotter stuff! Could you please add this option? Thanks for testing this @stephanschulz! Golan
thx for looking in to this. we are trying to draw in seeds, similar to sand animation.
Hi @golanlevin @stephanschulz
The easiest hack to omit the connecting lines is to use a different color for each stroke. For example, iterate through E.colors
and assign each a different random color. (e.g. alternate between #000000 and #010101 to make it invisible to human eye)
However don't worry about the hack since now SVG and PDF exports will omit the connecting lines in the newest commit: e8a945af3f441bb4aac3528a8f8bad65fdf78214 :)
thanks. Indeed your new commit solved it.
This seems to have solved it for most cases. But when using satin it still safe the connecting lines in the SVG
//E.noStroke();
E.fill(int(red(layerColors[colorIndex])), int(green(layerColors[colorIndex])), int(blue(layerColors[colorIndex])));
E.hatchSpacing(6);
E.PARALLEL_RESAMPLING_OFFSET_FACTOR = 0.5;
E.hatchAngleDeg(0);
E.hatchMode(PEmbroiderGraphics.SATIN);
E.setStitch(10, 50, 0);
E.image(myImage, 0, 0);
Another idea for the PEmbroider library... a modification that removes stitch-down points that break up lines that are otherwise straight. The goal would be to reuse the hatching code for something like an AxiDraw plotter, where there’s no need to make individual “stitches” in a long straight line.
This could take the form of something like noResample() or resample(true/false).