Open stephanschulz opened 3 years ago
Hi @stephanschulz , I'm wondering what is your input to SATIN? Is the input polygons vertices, or binary images? Is each color input separately to SATIN, or is each polygon input separately to SATIN, or are they given all at the same time? Do the missing parts share the same color, and of what color should they actually be? What does gray values of the second grayscale image indicate, do they correspond to the colors of the first image?
Thanks and sorry for so many questions, but I need the info to pinpoint the problem :)
import java.io.*;
import processing.embroider.*;
PEmbroiderGraphics E;
void setup(){
size(800,800);
background(0);
E = new PEmbroiderGraphics(this);
String[] filenames = new File(dataPath("")).list(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".png");
}
});
for (int i = 0; i < filenames.length; i++){
println("working on layer "+i+" ...");
PImage img = loadImage(dataPath(filenames[i]));
img.resize(width,height);
E.noStroke();
E.fill((int)random(100,255),(int)random(100,255),(int)random(100,255));
E.hatchSpacing(5);
E.hatchMode(E.SATIN);
E.image(img,0,0);
}
E.visualize(true,false,false);
}
as soon as I add
E.optimize();
E.visualize(true, false, false);
E.printStats();
E.endDraw(); // write out the file
to your code I see the problem again
fixed: 7099df3c873b20ec5cf8851e5a8b2418acf800aa
btw, optimize shouldn't be used with SATIN, since it might flip the order of the centerline and the hatch, see https://github.com/CreativeInquiry/PEmbroider/issues/82
@stephanschulz also, be aware that beginOptimize()/endOptimize() does exist, in case you need to combine SATIN with other stuff.
thanks for the tips.
I saw E.optimize();
being used in the PEmbroider_satin_hatching_2
example. But now I know better.
thanks.
I have many .png images which I all want to be executed with E.SATIN But depending on the size of these images not all polygon shaped images get hatched. Here the resulting file with the missing shapes circled.
this shows all the different shapes that should be executed.
Is it possible that the satin hatch get overwhelmed with too many shapes?
thx