-
Notifications
You must be signed in to change notification settings - Fork 27
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
PERLIN error when rendering in p2d #87
Comments
Hi @tatyanade That is a Processing bug unrelated to PEmbroider. For instance, try this example without PEmbroider: void setup(){
size(400,200,P2D);
PGraphics p1 = createGraphics(200,200,P2D); // remove P2D and it works
PGraphics p2 = createGraphics(200,200);
p1.beginDraw();
p1.background(0);
p1.circle(100,100,40);
p1.endDraw();
p2.beginDraw();
p2.image(p1,0,0);
p2.endDraw();
image(p1,0,0);
image(p2,200,0);
} Expected behavior is that So user has to either convert their P2D to the AWT renderer via pixels[], via IO etc., or tell Processing foundation to fix it. |
hmm, why does it work for other hatch types though? |
Hi @amgadani , depending on the hatch type, the internal algorithm may or may not need to transfer the PGraphics/PImage from one to another some number of times. For some hatch types under certain parameters, 0 transfer is made so it happen to work. |
ahh i see, it feels reasonable to me to expect PEmbroider to do that in these cases and possible output a warning in the console, rather than some cases not work and have it be on the user, what do you think? happy to do the conversion on myside in general but just from a library usage perspective it feels confusing that some would work and some just wouldnt without the user knowing |
I totally agree. However, the problem is that the functions take One possibility is that we overload all functions in the library to catch the particular case of P2D/P3D, which I think is pretty verbose given the number of functions we have. The assumption of the PEmbroider library (or any Processing library) is a working implementation of Processing, so I think it might be a better idea to get Processing to fix their bug in this particular case. Happy to hear about other solutions EDIT: actually, to make above solution work, the user has to initialize their P2D as |
@LingDong- , could you kindly post a bug to https://github.com/processing/processing regarding how Processing's image() function is apparently broken for P2D? |
Hi @LingDong- This came up in the slack channel issue Aashish posted; when using PGraphics as P2D, most of the hatches work fine but Perlin specifically for HatchRaster has issues - (also issues in P3D, not sure if P3D is w.in our scope )
The text was updated successfully, but these errors were encountered: