Archived

This topic is now archived and is closed to further replies.

paulcoz

Determining a portal during CSG subtract?

Recommended Posts

paulcoz    230
I'm trying to figure out an algorithm to calculate the portal made during a CSG subtract. If I have a list of polygons that are segments of one or more sliced faces in an object, how can I determine which points make up the hole in the object? I know it has something to do with the inner edges, but I'm having trouble working out which slices contain these, and whether points on slices are part of these. Any suggestions? Paulcoz. Edited by - paulcoz on December 12, 2001 6:51:36 PM

Share this post


Link to post
Share on other sites
TerranFury    142
You''re dealing with only convex sectors, I assume? Just find coplanar faces then. Then, for each pair of faces that intersect, the portal is the area in both faces. Clip one face to the second and you''ve got your portal.

Share this post


Link to post
Share on other sites
paulcoz    230
TerranFury,

Your method will work, but only for faces which are perfectly aligned (as you say co-planar). The method I'm trying to implement looks at the inner edges of the sliced face and creates a portal out of that eg. it will deal with co-planar joins and joins that aren't co-planar. I'm not 100% sure but I think this method will also deal with non-convex subtractions, even if the resulting portal is too complex and thus slow to clip to in real-time.

A good example is a pyramid with four points at the base. Slice a cube out of the centre of the spire to make a cubic hollow (not just a flat top) and you can see how the portal to the hollow is made by the sliced edges of the pyramid.

LATER - I think the hole can be found by checking which polygon edges are not shared with other polygons. Before the two objects are merged in the CSG operation to form a new solid, the portal can be determined by adding all the unshared edges together...I think...

Paulcoz.

Edited by - paulcoz on December 13, 2001 1:36:14 AM

Share this post


Link to post
Share on other sites