We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Shape internal clipping.
Page Index Toggle Pages: 1
Shape internal clipping. (Read 604 times)
Shape internal clipping.
Dec 16th, 2009, 7:19am
 
Posted this a few days ago thinking i had an awnser but to no avail.
I was wondering if its possible to have a shape within a shape set as a knockout to the outer shape. like a boolean.

Think of an "O" as the example.

Working with contour plots and the situation arrises consistently,
any ideas on how to extend the beginshape in processing or use pure java? It seems like the generalpath in java would do the trick but not to sure. Probably a bit over my head on this one.
Re: Shape internal clipping.
Reply #1 - Dec 16th, 2009, 7:57am
 
Just posted this solution yesterday somewhere else. you can use breakshape to cutout holes...

size(400,400);
fill(255);
stroke(0);

beginShape();
// outer shape
vertex(100,100);
vertex(300,100);
vertex(300,300);
vertex(100,300);
vertex(100,100);  

breakShape();
//cutout
vertex(150,150);
vertex(150,250);
vertex(250,250);
vertex(250,150);
endShape(CLOSE);
Re: Shape internal clipping.
Reply #2 - Dec 16th, 2009, 8:38am
 
Thank you! I never saw breakshape in the docs. Mods Might want to link that with beginshape in the online reference, though im sure they have better things to do.
Re: Shape internal clipping.
Reply #3 - Dec 16th, 2009, 9:57am
 
its not mentioned in the reference, thats probably why its not linked Smiley but sure, it could be useful to add it. i will make a post
Page Index Toggle Pages: 1