Face adjacency

Everything DG Kernel: Technical discussions and issues
Post Reply
Pham THN
Posts: 1
Joined: Thu Oct 10, 2024 1:55 am

Face adjacency

Post 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.
Chris Weber
Posts: 1
Joined: Fri Oct 11, 2024 12:51 am

Re: Face adjacency

Post 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;
Post Reply