Sign in to follow this  

Boolean add of two polygons in 2D?

This topic is 4712 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Where do I find some information or sample code that robust and quite fast. I.e a function like: int polyAdd(Vertex* dest, const Vertex* sourceA, const int countA, const Vertex* sourceB, const int countB); I'm trying to calculate the total area of a bunch of triangles, without adding the overlapped area twice. I guess I could create a bsp, for the edges of the first triangle, then adding the other triangles by clipping them against the bsp tree!? How do you robustly clip triangles against a bsp tree without getting to many fragments? [Edited by - eq on January 17, 2005 1:38:30 PM]

Share this post


Link to post
Share on other sites
Are your source polygons convex? If so, it's pretty easy to find the intersection. You could then get the area as A(poly1) + A(poly2) - A(poly1 ^ poly2).

If they aren't necessarily convex, then it's going to be a fair bit trickier. I couldn't say offhand how to do it.

Share this post


Link to post
Share on other sites
I start with once triangle, then I add another once, after that step it could take any shape, even as two separate pieces. After adding a third triangle two pieces might be joined together.

Share this post


Link to post
Share on other sites

This topic is 4712 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this