## 2d Polygon Intersection

bizimCity
Unregistered

Post: #1
I have two and more polygon.. Other polygon intersec with these polygons. I want to intersection points of the other points.
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Member
Posts: 320
Joined: 2003.06
Post: #3
hmmm... I have a cat and there are other cats. Other cats fight with my cat. I want to intersection dogs with other dogs.

huh?

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Moderator
Posts: 776
Joined: 2003.04
Post: #4
reubert Wrote:huh?
Quote:Location: turkey

I've seen native speakers with less clear posts, cut the guy some slack.
Member
Posts: 161
Joined: 2005.07
Post: #5
reubert Wrote:hmmm... I have a cat and there are other cats. Other cats fight with my cat. I want to intersection dogs with other dogs.
A point is a part of a polygon, but a dog is not part of a cat. Your analogy is therefore flawed. If you're going to slam someone for not making sense, at least make sense while doing it.
Sage
Posts: 1,199
Joined: 2004.10
Post: #6
As a general answer to the question, if your polygons can be described as a set of line segments ( where a line is a->b ) it can be very simple to determine which intersect and where, simply by checking each segment against each segment.

Now, making that run quickly is an exercise up to the reader. Obvious approaches involve spatial partitioning ( to minimize the set of which lines *might* intersect others ) and boundary-box checks.

Also, if your polygons involve bezier curves, or splines or the like, it would be best to have -- if performance is an issue -- a high quality subdivision for rendering, and a low quality version for collision detection.

I have some code, if you want to see ( mine only handles beziers, though, and it's very ugly since I wrote it 6 or 7 years ago and was screwing around, but it works ).
Member
Posts: 320
Joined: 2003.06
Post: #7
points taken guys, my apologies bizimCity.

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com