• Advertisement
Sign in to follow this  

Cutting polygons

This topic is 3966 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

Hi for all I would like to know if anyone knows how can I cut a polygon. I've searched in the internet and I've seen that I must use the polygon subdivision. Someone done something like this? Is there are a tutorials or any tpe of resources? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Depends on what you want to do:

Changing geometry permanently -> subdivision
Just insert new points, delete the old polygon an create the cut polygons from the old and new points. For example you want to devide the triangle ABC. You insert a point D at AC the delete the triangle ABC and create 2 new triangles ABD and DBC - et voilá - you've devided the polygon.

Only a "visual" cut
You want to have a polygon cut visually by an arbitrary plane but want to keep the original geometry. Then you use clip planes which do the "visual" cut when rendering. Try a google on OpenGL clip planes.

Share this post


Link to post
Share on other sites
I'll change the geometry permanently. But I'm working with complex models(3DS models). Subdivision, I think, works for simple models(square, triangles) and the processing will be very slow if I use subdivision.
Is there atr other way

Share this post


Link to post
Share on other sites
You could pre-cut the model in a 3d program and then swap it out when you want it to be cut. But this, of course, would only work for specific fractures.

Share this post


Link to post
Share on other sites
Check out Sutherland Hodgman clipping. One good presentation at:
http://www.cs.princeton.edu/courses/archive/fall00/cs426/lectures/clip/sld035.htm

In order to map the concept to 3D, just use a plane/multiple planes as the "boundary" and use ray-plane intersection to find the "clip-points". May be faster ways to do this, but it's a simple concept. I'm using it to cut up large TIN-terrains in several patches...

Edit:
Also, in case of a very large mesh you can speed up things by culling away polygons that are clearly outside the clip-area and won't be clipped anyway.

/Mike

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement