harefort

02-09-2009, 06:20 PM

Hey everybody!

I'm looking for a performant way to find an edge that shares a face but no vert with an other edge.

The failsafe way is to find all the edge of the faces that contain the first edge and then dismiss all edges that share a vert with the first edge.

But I wonder whether there is a faster way.

With getFaceEdge <int> <int> you can get all the edges of a face and I wonder whether these are sorted.

On a quad edge 1 and edge 3 seem to always fullfill my criteria.

I used this snippet to test this on a quad only poly:

aFaces = #{1..$.numFaces}

iFails = 0

for each in aFaces do

(

local aEdges = #($.getFaceEdge each 1,$.getFaceEdge each 3)

local aVerts = #{$.getEdgeVertex aEdges[1] 1,$.getEdgeVertex aEdges[1] 2,$.getEdgeVertex aEdges[2] 1,$.getEdgeVertex aEdges[2] 2}

if aVerts.numberSet != 4 then

(

iFails += 1

)

)

print iFails

Does somebody know for sure whether the edges of a face are sorted in this way?

Thanks a lot!

I'm looking for a performant way to find an edge that shares a face but no vert with an other edge.

The failsafe way is to find all the edge of the faces that contain the first edge and then dismiss all edges that share a vert with the first edge.

But I wonder whether there is a faster way.

With getFaceEdge <int> <int> you can get all the edges of a face and I wonder whether these are sorted.

On a quad edge 1 and edge 3 seem to always fullfill my criteria.

I used this snippet to test this on a quad only poly:

aFaces = #{1..$.numFaces}

iFails = 0

for each in aFaces do

(

local aEdges = #($.getFaceEdge each 1,$.getFaceEdge each 3)

local aVerts = #{$.getEdgeVertex aEdges[1] 1,$.getEdgeVertex aEdges[1] 2,$.getEdgeVertex aEdges[2] 1,$.getEdgeVertex aEdges[2] 2}

if aVerts.numberSet != 4 then

(

iFails += 1

)

)

print iFails

Does somebody know for sure whether the edges of a face are sorted in this way?

Thanks a lot!