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.
Page Index Toggle Pages: 1
2d shape subtraction (Read 1803 times)
2d shape subtraction
May 14th, 2010, 4:25pm
 
is there an equivalent of this:

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


that works with OPENGL rendering?

S

Re: 2d shape subtraction
Reply #1 - May 15th, 2010, 12:02am
 
Are thinking about creating a menger sponge perchance If so it has been done before see-
http://www.openprocessing.org/visuals/?visualID=8332
for a recent version or check out the processing archive for a version by Tom Carden. I hadn't even come across the 2D breakshape before seeing your post, but I don't think there is 3D version.

And here is were to find the the real answer, don't you check the documentation/discourse This only the start of the thread make sure you read FRY's answer.
No wonder I hadn't heard of it before!!!

Cedric wrote on Dec 16th, 2009, 10:01am:
This question was asked several times the last few days and i always give the same answer.
I know breakshape is not documented yet but works pretty good most of the times. So maybe we can add it to the reference page.

it was first mentioned by davebollinger on his flickr account :
http://www.flickr.com/photos/davebollinger/3598281488/

Re: 2d shape subtraction
Reply #2 - May 15th, 2010, 2:22am
 
no, I do read the discourse Martin; hence I asked if there was an equivalent

and also no, that's not what i'm trying to do, either.
i'm trying to draw an isovist in 2d plan for a set field of view. a bit like this: http://www.lydiaheard.com/citywalker/assets_c/2008/10/compact_isovist1.html
but restricted to a 60 span and changing in realtime as the viewers moves.

I figure the simplest way to do this is to calculate the full 60 degree view cone and the subtract the 'shadow' shapes of any objects in the way. Hence my query.

If this has been done before in processing, i'd love to see it, but I can't find anything.
S

Re: 2d shape subtraction
Reply #3 - May 15th, 2010, 9:29am
 
ok

dynamic isovist constructed; but using a different method after all.

see here for details:
http://dl.dropbox.com/u/6460407/_00_ISOVIST.zip

S
Page Index Toggle Pages: 1