#### Archived

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

# Determining a portal during CSG subtract?

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

## Recommended Posts

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 on other sites
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 on other sites
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

1. 1
Rutin
25
2. 2
3. 3
JoeJ
19
4. 4
5. 5

• 10
• 11
• 9
• 9
• 10
• ### Forum Statistics

• Total Topics
631752
• Total Posts
3002095
×