Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

culling question. #97

Open
stephanschulz opened this issue Aug 28, 2020 · 3 comments
Open

culling question. #97

stephanschulz opened this issue Aug 28, 2020 · 3 comments

Comments

@stephanschulz
Copy link

I am doing some Anton Stankowski inspired coding with shapes inside shapes.
When using culling the distribution of the stitches is not as even as it is when not using culling. I guess that due to having different start and stop points for the polylines.
Do you have any tips to counter act that effect and get a nice clean distributed look?
Here two image with and without culling.
thx
anton_2020_8_28_10_26_44
anton_2020_8_28_10_26_38

@LingDong-
Copy link
Collaborator

Hi @stephanschulz

I think a better alternative to culling is to use PEmbroiderBooleanGraphics. Culling is done after the whole design is baked into polylines, so it has to make guesses and compromises. It always look nicer if the correct shape is prepared in the first place (with PEmbroiderBooleanGraphics)

See:

#54

#62

@stephanschulz
Copy link
Author

Thanks for the advice.
I am not sure if the library is able to accept PShape objects?
Right now I am constructing my arrow shape from a bunch of vertices.
In this specific case I could combine a triangle and a rectangle, but it would not work for more complicated shapes I guess.

PShape testShape;
BSG.testShape;

Syntax error, insert "VariableDeclarators" to complete LocalVariableDeclaration

@LingDong-
Copy link
Collaborator

HI @stephanschulz ,

Basically PEmbroiderBooleanGraphics is just a wrapper on PGraphics that's more specialized on binary images. It works exactly like regular PGraphics, and the syntax is also exactly the same, so to draw a PShape on it:

PShape testShape;
testShape.disableStyle();
BSG.fill(255);
BSG.image(testShape,0,0);

The idea is to just construct a binary image where white part should be stitched and black part is void. Then feed it to PEmbroider's image() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants