Page 1 of 1

Face adjacency

Posted: Thu Oct 10, 2024 1:57 am
by Pham THN
Hello

I need a way to check if two faces IBRepFace_DG are adjacent. What is the way to do it?

Thanks in advance.

Re: Face adjacency

Posted: Fri Oct 11, 2024 1:04 am
by Chris Weber
Adjacent faces share an edge, so IBRepEdge_DG.GetOtherFace() should be the key here.

Suppose you have faceThis and faceOther. Use faceThis.GetEdges(). Then for every edge call

Code: Select all

IBRepFace_DG faceOther = edge.GetOtherFace(faceThis);
IBRepShape_DG shThis = faceThis.As<IBRepShape_DG>();
IBRepShape_DG shOther = faceOther.As<IBRepShape_DG>();
if(shOther.IsEqual(shThis))
	adjacent = true;