Giter Club home page Giter Club logo

Comments (7)

LingDong- avatar LingDong- commented on August 24, 2024 1

fixed: 7099df3

btw, optimize shouldn't be used with SATIN, since it might flip the order of the centerline and the hatch, see #82

from pembroider.

golanlevin avatar golanlevin commented on August 24, 2024 1

@stephanschulz also, be aware that beginOptimize()/endOptimize() does exist, in case you need to combine SATIN with other stuff.

from pembroider.

LingDong- avatar LingDong- commented on August 24, 2024

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 :)

from pembroider.

stephanschulz avatar stephanschulz commented on August 24, 2024
  • input is a bunch of binary images
  • each image has a different color
  • the missing parts do share the same color but are also part of the same binary image
  • the second image is a illustrator file to show you the different layers.

Embroider_test.zip

from pembroider.

LingDong- avatar LingDong- commented on August 24, 2024

Screen Shot 2020-09-07 at 5 22 58 PM

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);

}

from pembroider.

stephanschulz avatar stephanschulz commented on August 24, 2024

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

from pembroider.

stephanschulz avatar stephanschulz commented on August 24, 2024

thanks for the tips.

I saw E.optimize(); being used in the PEmbroider_satin_hatching_2 example. But now I know better.

thanks.

from pembroider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.